Re: From Graphics to Image
Christopher Frazier <[email protected]>
| Newsgroups | gmane.comp.windows.devel.dotnet.winforms |
|---|---|
| Message-ID | <[email protected]> |
Then
pictureBox1.Image.Save() to save the results.
--
-Christopher
| AspInsider
http://chrisfrazier.net/blog
(\__/)
(='.'=) This is Bunny. Copy and paste bunny into your
(")_(") signature to help him gain world domination.
-----Original Message-----
From: Discussion forum for developers using Windows Forms to build apps and
controls [mailto:[email protected]] On Behalf Of samir
parekh
Sent: Monday, May 21, 2007 10:07 AM
To: [email protected]
Subject: Re: [DOTNET-WINFORMS] From Graphics to Image
SORRY TO INTERRUPT....
but there seems to be some misunderstanding..
set the image property of the picture box to the image after editing the
image
Bitmap bmp = new Bitmap(pictureBox1.Width, pictureBox1.Height);
Graphics g = Graphics.FromImage(bmp);
g.Clear(Color.Blue);
pictureBox1.Image = bmp;
pictureBox1.Refresh();
Regards
samir
Fabian Schmied <[email protected]> wrote: > Graphics g =
Graphics.FromImage(b);
>
> Then you should be able to use "g" to draw your graph on "b", and then use
> b.Save() to save the result, or g.DrawImage() to paint the image on the
> screen.
The first part is right, but if "g" is the Graphics object obtained
via Graphics.FromImage(b), then g.DrawImage won't paint the image on
the screen. Instead, it can be used to paint a different image on the
graphics object (which in turn paints on "b").
To show the image on the screen, you can use a PictureBox or a Paint
event's PaintEventArgs.Graphics.DrawImage().
Fabian
---------------------------------
Get the free Yahoo! toolbar and rest assured with the added security of
spyware protection.