PointText
Posted: Mon May 15, 2017 5:40 am
Hi,
I'm trying to draw some text in my picture, I normally use a Rectangle and set the Text property, but this time I don't want a background to the text. What should I use? I also don't want a border, so setting the DrawStyle of the Rectangle to Edge isn't any good. I tried a PointText, but the font is all horrible, couldn't work out why.
I've attached the file showing the result using PointText. When I use a Rectangle with Text it looks nice
var label = new PointText();
label.Location = picture.PointDeviceToElement(new Vector(distanceFromLeftToRuler - tickLineLength - 10, heightInPixels));
label.Text = HTMLtoRTF.ConvertToUnicode(value);
label.TextAppearance = new Prodige.Drawing.Styles.TextAppearance() { SizeUnit = System.Drawing.GraphicsUnit.Millimeter, Size = 3f / picture.Scaling.X };
label.TextAppearance.HorizontalAlignment = System.Drawing.StringAlignment.Far;
label.TextAppearance.VerticalAlignment = System.Drawing.StringAlignment.Center;
What am I doing wrong?
Thanks,
Euan
I'm trying to draw some text in my picture, I normally use a Rectangle and set the Text property, but this time I don't want a background to the text. What should I use? I also don't want a border, so setting the DrawStyle of the Rectangle to Edge isn't any good. I tried a PointText, but the font is all horrible, couldn't work out why.
I've attached the file showing the result using PointText. When I use a Rectangle with Text it looks nice
var label = new PointText();
label.Location = picture.PointDeviceToElement(new Vector(distanceFromLeftToRuler - tickLineLength - 10, heightInPixels));
label.Text = HTMLtoRTF.ConvertToUnicode(value);
label.TextAppearance = new Prodige.Drawing.Styles.TextAppearance() { SizeUnit = System.Drawing.GraphicsUnit.Millimeter, Size = 3f / picture.Scaling.X };
label.TextAppearance.HorizontalAlignment = System.Drawing.StringAlignment.Far;
label.TextAppearance.VerticalAlignment = System.Drawing.StringAlignment.Center;
What am I doing wrong?
Thanks,
Euan