DrawString on Bitmap

F

Frecklefoot

I have a Bitmap image on which I want to render a string. I know about the
GDI+ DrawString() method, but I need a Graphics reference to use it. I
couldn't find any function to get the Bitmap's Graphics reference. Is there
another way to do this?

TIA!
 
E

Erik Frey

Frecklefoot said:
I have a Bitmap image on which I want to render a string. I know about the
GDI+ DrawString() method, but I need a Graphics reference to use it. I
couldn't find any function to get the Bitmap's Graphics reference. Is there
another way to do this?

TIA!

Bitmap myBitmap = new Bitmap(@"C:\Documents and
Settings\Joe\Pics\myPic.bmp");
Graphics g = Graphics.FromImage(myBitmap);

Erik
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top