How do you save a picture?

visualsteve
04-30-2006, 08:15 PM
I have an image on my form (form1), how can I save it to a file?
What is the best format for an image that you don't want to compress or alter the pixels in saving?

shaul_ahuva
04-30-2006, 09:23 PM
Image.Save...

If you don't want compression, save it as a bitmap. If you want a good compression/quality ratio use PNG.

visualsteve
05-01-2006, 01:14 AM
Okay, but how do I tell the program to save the Form1 image?
So far I have "Dim IMG as bitmap" and "IMG.Save(TEXT2.TEXT)"
But this program has no idea where it's image is coming from.

Iceplug
05-01-2006, 03:53 PM
Forms don't have images - images have images. If you were unfortunate to be drawing onto a form, you should be drawing to a Bitmap if you want to save.

In which case, to draw to a Bitmap, you get a Graphics object like
bmp = New Bitmap(xx, yy)
GFX = Graphics.FromImage(bmp)

visualsteve
05-09-2006, 11:35 PM
How can I convert a form image to a bitmap?

jo0ls
05-10-2006, 03:31 AM
Where is the image? I'm guessing it is the property of some control, so:

Me.PictureBox1.Image.Save("C:\image.bmp", System.Drawing.Imaging.ImageFormat.Bmp)

Shaul meant save as BMP for no compression (bmp is the "bitmap file format").

iosys
05-17-2006, 05:04 PM
If you have drawn an image directly to the form, there is a method built into controls called DrawToBitmap(). I imagine it would be something like:

Dim b as new bitmap(myform.width,myform.height)
myform.drawtobitmap(b, myform.clientrectangle)
b.save(...)

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum