VB.Net : saving a graphic as a file 
Author Message
 VB.Net : saving a graphic as a file

I want to load a bitmap in a picturebox, to draw rectangles, ellipses,
etc..., and then to save the updated image in a file. Unfortunately
the saved image is not updated. The code is:
        PictureBox1.Image = Image.FromFile(BkgFileName)
        Dim oGraphic As Graphics
        oGraphic.FromImage(PictureBox1.Image)
        Dim newimage As New System.Drawing.Bitmap(BkgFileName,
pUseICM)
        Dim Brush As New SolidBrush(ShapeColor)
        oGraphic.FillEllipse(Brush, X, Y, W, H)
        newimage = Image.FromFile(Filename, pUseICM)
        oGraphic.DrawImage(newimage, Xi, Yi, Wi, Hi)
        PictureBox1.Image.Save(pfilename, ImageFormat.Jpeg)
 Can you help me?


Thu, 14 Apr 2005 19:03:24 GMT  
 VB.Net : saving a graphic as a file
Almost everybody here is using VB6 or lower. While you may get a stray
answer to VB.NET questions here, you should ask them in newsgroups
devoted exclusively to .NET programming. Look for newsgroups with the
word "dotnet" in their name. For the microsoft news server, try these
newsgroups...

microsoft.public.dotnet.general
microsoft.public.dotnet.languages.vb

For the news.devx.com news server, try these

vb.dotnet.discussion
vb.dotnet.technical

There are some others, but these should get you started.

Rick - MVP


Quote:
> I want to load a bitmap in a picturebox, to draw rectangles, ellipses,
> etc..., and then to save the updated image in a file. Unfortunately
> the saved image is not updated. The code is:
>         PictureBox1.Image = Image.FromFile(BkgFileName)
>         Dim oGraphic As Graphics
>         oGraphic.FromImage(PictureBox1.Image)
>         Dim newimage As New System.Drawing.Bitmap(BkgFileName,
> pUseICM)
>         Dim Brush As New SolidBrush(ShapeColor)
>         oGraphic.FillEllipse(Brush, X, Y, W, H)
>         newimage = Image.FromFile(Filename, pUseICM)
>         oGraphic.DrawImage(newimage, Xi, Yi, Wi, Hi)
>         PictureBox1.Image.Save(pfilename, ImageFormat.Jpeg)
>  Can you help me?



Thu, 14 Apr 2005 23:07:55 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Saving graphics objects to an standard graphics file

2. Overlaying text onto a graphic and saving as graphic

3. How to save graphics with some other data to nongraphics file

4. Saving graphics to a file in QBasic4.5

5. Saving more than one graphics in a file?

6. saving graphics in an array or to a file

7. Save routine for graphics files?

8. Saving graphics in a file

9. save mschart as a graphic file

10. how to save PictureBox graphics into JPEG file

11. Saving richtextbox to graphic file

12. Save Browser Contents to Graphic file

 

 
Powered by phpBB® Forum Software