
-----------------------------------
isaiahk9
Mon Jul 19, 2010 2:52 pm

Saving a picture/image
-----------------------------------
Hey, I'm making a program where (in barest simplicity) the user can upload pictures (already figured out), and then save them, so that they can turn off the program, and re-open the program with the same images there.  I can't just remember the file directory and re-call the images, as one of the major features of the program is so that others can see the images.

As such, I'm at a loss.  I know how to save text, and all sorts of things that can be represented by text, but does anyone know how to save a picture or image?

-----------------------------------
Insectoid
Tue Jul 20, 2010 8:01 am

RE:Saving a picture/image
-----------------------------------
I think the best way would just be to copy the image from the original folder to a new one with all the program's images in it. I'm sure VB can do this (it'd be pretty weak if it couldn't). Something like Turing's Dir.Copy (or something). 

This is, of course, assuming you're uploading to a remote server.

-----------------------------------
TheGuardian001
Tue Jul 20, 2010 8:29 am

Re: Saving a picture/image
-----------------------------------
Technically any image can be shown as text. The computer doesn't care if the bytes in the file are interpreted as ASCII codes or as image pixels. You could, if you wanted to, just read and save the file as text, although I certainly don't recommend it.

If you're using the System.Drawing.Bitmap type to store your image in the program (supports bmp, jpg, tiff, png, exif, and gif files,) I believe it has a [url=http://msdn.microsoft.com/en-us/library/9t4syfhh.aspx]Save() method built in.

-----------------------------------
isaiahk9
Tue Jul 20, 2010 10:54 am

RE:Saving a picture/image
-----------------------------------
@Insectoid: Theoretically that could work, it would just be a little inefficient with my program.  However, it's a good idea as a backup if TheGuardian001's method doesn't work.
@TheGuardian001: Ty, I'll try the save method.
