A
almurph
RE: Tryign to convert Graphics object to a bitmap
Hi,
Hope you can help me with this. I have to open a file and add some
text to it and then display it. So I create an Image object then
import it into a Graphics object and add the text.
I then try converting it to a bitmap image using the following
line:
Bitmap newBit = new Bitmap(440, 60, gfx);
but this does not works as when I display it the image does not
appear.
Can anyone help me please? Any suggestions/corrections/hints/code-
samples would be much appreciated.
Thank you,
Al.
**** CODE ****
Image img = Image.FromFile ("C:\a.jpg");
Font myFont = new Font("Arial", 16);
SolidBrush myBrush = new SolidBrush(Color.Black);
Graphics gfx=Graphics.FromImage(img);
gfx.DrawString("Some Data", myFont, myBrush, 100.0F, 30.0F);
Bitmap newBit = new Bitmap(440, 60, gfx);
this.pbInputImage.Image = newBit ;
**** END CODE ****
Hi,
Hope you can help me with this. I have to open a file and add some
text to it and then display it. So I create an Image object then
import it into a Graphics object and add the text.
I then try converting it to a bitmap image using the following
line:
Bitmap newBit = new Bitmap(440, 60, gfx);
but this does not works as when I display it the image does not
appear.
Can anyone help me please? Any suggestions/corrections/hints/code-
samples would be much appreciated.
Thank you,
Al.
**** CODE ****
Image img = Image.FromFile ("C:\a.jpg");
Font myFont = new Font("Arial", 16);
SolidBrush myBrush = new SolidBrush(Color.Black);
Graphics gfx=Graphics.FromImage(img);
gfx.DrawString("Some Data", myFont, myBrush, 100.0F, 30.0F);
Bitmap newBit = new Bitmap(440, 60, gfx);
this.pbInputImage.Image = newBit ;
**** END CODE ****