What I'm trying to do is use the DrawString () method to draw a string into a bitmap. To do this, I need to create a bitmap and get the Graphics object from the bitmap, and then call DrawString () on that Graphics object.
The problem is, how can I know in advance, when I create my initial bitmap, how many pixels are wide and longer for my bitmap?
I know this has something to do with MeasureString (), but to use MeasureString () I need to get the Graphics object from the bitmap. I cannot get this until I create a bitmap, which I cannot do until I know the size. This is like a circular paradox!
Can someone please help me with this?
source
share