Welcome Guest! You need to login or register to make posts.

Notification

Icon
Error

Options
Go to last post Go to first unread
bmiller  
#1 Posted : Wednesday, July 2, 2014 12:44:58 PM(UTC)
bmiller

Rank: Newbie

Groups: Member
Joined: 7/2/2014(UTC)
Posts: 3

I'm trying to use the .NET component to draw multi-line text. Here is my code:

Code:
graphics.DrawText(text, font, brush, rect, false, 3); 


The problem is that the line feeds are ignored and the text appears on the same line. What am I doing wrong?

Edited by moderator Thursday, July 3, 2014 1:21:04 AM(UTC)  | Reason: Not specified

Fedor  
#2 Posted : Thursday, July 3, 2014 1:39:16 AM(UTC)
Fedor

Rank: Advanced Member

Groups: Member, Administration, Moderator
Joined: 7/28/2003(UTC)
Posts: 1,660

Thanks: 5 times
Was thanked: 76 time(s) in 74 post(s)
You should use the class BoundedText for it. I have attached the result as well.

Code:
var a = new Aurigma.GraphicsMill.Bitmap(320, 320, Aurigma.GraphicsMill.PixelFormat.Format32bppArgb
	, Aurigma.GraphicsMill.RgbColor.White);

var gr = a.GetAdvancedGraphics();

var content = @"Graphis Mill

One area of focus is pre-press processing, and Graphics Mill is popular among customers in both the traditional and specialty printing industries.";

var text = new Aurigma.GraphicsMill.AdvancedDrawing.BoundedText(content, gr.CreateFont("Segoe UI", 20))
{
	Rectangle = new System.Drawing.RectangleF(10, 10, gr.Width - 20, gr.Height - 20)
};

gr.DrawRectangle(new Aurigma.GraphicsMill.AdvancedDrawing.Pen(Aurigma.GraphicsMill.RgbColor.Blue, 0.3f)
	, text.Rectangle);

gr.DrawText(text);

a.Save(@"C:\Temp\out.png");

Edited by user Thursday, July 3, 2014 1:41:08 AM(UTC)  | Reason: Not specified

Fedor attached the following image(s):
out.png
Best regards,
Fedor Skvortsov
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.