e.Graphics.DrawString("not a rectangle");
e.Graphics.FillRectangle(Brushes.White, 0,0, 50,10);
I want to have 1 pixel border to the text I draw.
But if I first draw the white text (the border), and then the black text (the enterior), the problem is that "drawString()" does not give the size in pixels, but in points.
If I can specify the font-size in pixels, you can do:
1. "not a rectangle", font-size = 22px, x = 10, y = 10
2. "not a rectangle", font-size = 20px, y = 11, y = 11
I've only had 2 hours of sleep today so I'm outta ideas. Keep in mind that when you shrink a font down, it also shrinks the spacing. So you won't get a perfect outline and if the text is long, your letters may be completely offset.
| H | E | L | L | O 12px
| H| E| L| L| O 11px
That's why i recommend an outline font. There may be some kind of transform that deals with this better.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.