Re: Graphics drawstring doesn't affect PictureBox bitmap image

From: Bob Powell [MVP] (bob_at__spamkiller_bobpowell.net)
Date: 10/26/04


Date: Wed, 27 Oct 2004 00:49:36 +0200

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/gdiplus_faq.htm
The GDI+ FAQ RSS feed: http://www.bobpowell.net/faqfeed.xml
Windows Forms Tips and Tricks RSS: http://www.bobpowell.net/tipstricks.xml
Bob's Blog: http://bobpowelldotnet.blogspot.com/atom.xml
"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
>
>


Relevant Pages

  • Re: GdipCreateHBITMAPFromBitmap + PixelFormat32bppARGB
    ... The Windows bitmap specification was drawn up for Windows 3.1 ... Alpha blended bitmaps were not supported. ... The documentation for AlphaBlend function implies that Windows GDI ... an alpha channel. ...
    (microsoft.public.dotnet.framework.windowsforms)
  • Re: The story: Painting bitmap to screen is slow
    ... The general "trick" behind great GDI+ performance is to do all drawing ... single bitmap to the screen. ... I heard Microsoft broke GDI acceleration for some operations in Vista. ... your configuration of Vista or graphics driver. ...
    (microsoft.public.dotnet.framework.drawing)
  • Re: How to draw graphics on a bitmap ?
    ... The GDI+ FAQ has the answer to this question.. ... You cannot draw directly onto a bitmap having an indexed pixel format. ...
    (microsoft.public.dotnet.languages.vb)
  • The story: Painting bitmap to screen is slow
    ... I've done a lot graphics programming by now and the thing that bothers me with GDI+ in .NET framework the most is slow drawing of bitmaps to screen. ... In Win32, there were two types of bitmaps, compatible and memory bitmap. ...
    (microsoft.public.dotnet.framework.drawing)
  • Re: Creating a GDI+ Bitmap from an 8-bit Bitmap
    ... Ok, when I create the GDI+ bitmap from a DIB, the image looks a bit better. ... That tells me that something is still a bit off with my palette. ...
    (microsoft.public.win32.programmer.gdi)

Quantcast