[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.drawing

Graphics drawstring doesn't affect PictureBox bitmap image

Christopher Secules

10/26/2004 7:04:00 PM

I have a Picturebox that continuously gets updated with either different
patterns and/or strings of text written on it. I have the text updating in
the PictureBox's Paint event. Then I use e.Graphics.DrawString(...) to draw
the string on the screen.

I noticed, however, that after the paint event is handled, the newly drawn
string is not saved as part of the bitmap. Is there any way to save the
entire contents of the picturebox (bitmap + graphics stuff), so that the
string will be included as part of the bitmap?

I've looked at graphics.save, but that only saves the state of the graphics
object, not the bitmap. I've looked at bitmap and picturebox methods to no
avail. Any help would be greatly appreciated!

Thanks,
Chris


1 Answer

Bob Powell

10/26/2004 10:50:00 PM

0

You have to draw on the bitmap itself. The GDI+ FAQ article "Drawing on an
existing image" explains.

--
Bob Powell [MVP]
Visual C#, System.Drawing

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/gdipl...

The GDI+ FAQ RSS feed: http://www.bobpowell.net/f...
Windows Forms Tips and Tricks RSS: http://www.bobpowell.net/tips...
Bob's Blog: http://bobpowelldotnet.blogspot.co...






"Christopher Secules" <secules@pica.army.mil> wrote in message
news:e%23SJS64uEHA.3152@TK2MSFTNGP14.phx.gbl...
> I have a Picturebox that continuously gets updated with either different
> patterns and/or strings of text written on it. I have the text updating
in
> the PictureBox's Paint event. Then I use e.Graphics.DrawString(...) to
draw
> the string on the screen.
>
> I noticed, however, that after the paint event is handled, the newly drawn
> string is not saved as part of the bitmap. Is there any way to save the
> entire contents of the picturebox (bitmap + graphics stuff), so that the
> string will be included as part of the bitmap?
>
> I've looked at graphics.save, but that only saves the state of the
graphics
> object, not the bitmap. I've looked at bitmap and picturebox methods to
no
> avail. Any help would be greatly appreciated!
>
> Thanks,
> Chris
>
>