Hi i have a form and i want to know how to save pictures to it?
Hi, everyone i have a program that you add images to the mainform, but when you exit the program the pictures do not save how can i do this, i need to save the pictures to the mainform. i have tryed this.
And it dose not work, am i doing something wrong, and its under a button.
Re: Hi i have a form and i want to know how to save pictures to it?
What does the code inside SaveMainForm look like ?
Re: Hi i have a form and i want to know how to save pictures to it?
Well basically you do not save anything to the form. What you would need to do is save to a file of some sort then read from that file to load the images when the program starts. How you should do this depends on what you are doing but for example you may just need to save the path/filename to a text file then read that text file during load and load the images that are listed in the text file.
Re: Hi i have a form and i want to know how to save pictures to it?
Quote:
Hi, everyone i have a program that you add images to the mainform, but when you exit the program the pictures do not save how can i do this, i need to save the pictures to the mainform. i have tryed this.
Did you write anything if so please provide what you have written ? .we will give more suggestion .anyway if you want to put the picture .so that when user run the project every time picture will show at the form at runtime .if so press f4 .and go to properies window .select the path of picture in the picture property of form .it is easy without write anything .save the project .it will save picture automatically .:)
Re: Hi i have a form and i want to know how to save pictures to it?
That only works for 1 picture per control and must be done at design time which is not what the poster appears to be asking for.
Re: Hi i have a form and i want to know how to save pictures to it?
I agree with DataMiser about the way you load and show your image. But if you really need to do the job this way you probably will have a hard time.
A window has a handle (hWnd). That handle could be translated to a DeviceContext's handle (hDC) using hDC=GetDC(hWnd). Find out the coordinates you want to save, use bitblt to copy your selection to a destinatino hDC (Let's say hDCdst=GetDC(Picturebox.hWnd) you created in the same window (form) or in a different window (inside or outside the same process). From that point you can use the VB SavePicture function to save you StdPicture (PictureBox.Picture) to a file.
Good luck!
Re: Hi i have a form and i want to know how to save pictures to it?
I was under the impression that the poster is using picture or image controls and wants to load pictures to them at runtime then recall them when the programs is ran. This would not be that hard. I would use an INI file.
Re: Hi i have a form and i want to know how to save pictures to it?
mwahaha.. I guess I misunderstood the question completely. I thought an app prints images that needed to be saved :)