Hi,
I made a VB class to generate images on the fly.
The idea is to generate an image with a text, a font, a font size, a
maximum width and height given as parameters, and the text to fit in the
image.
I'm experiencing 2 problems:
firstable, I can't set the text exactly at the top left corner.
I use the Graphics.DrawString method as following:
g.DrawString(myString, New Font(myFont, myFontSize), myFBrush, 0, 0)
Depending on the font and the font size, the text will be positionned
differently on the image (like 2 or 3 pixels from the top left corner of
the image, not at 0,0).
Secondable, I'm using the Graphics.MeasureString function to determine
what will be my image size (as I want the text to fit "perfectly" in the
image). Once again, the function doesn't return the proper size of the
text, and I have to adjust the width and height to get finer results.
Does anybody had to work on a similar problem ? What options do you
suggest ?
thx,
seb
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!