Click here to Skip to main content
16,020,568 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
before asking me to apologize to the parties that interfere with my question.
I just want to ask questions to learn C #.

I ask, is there another way to save the images contained in a PictureBox?
I use this during savedialog.
in some cases I want to save images automatically
with the path and filename that has existed since the beginning.

Thanks in advance!
Posted

i think this is the good site for you(biggner) to practice..,

Here[^]
 
Share this answer
 
Hi,

if you want to save your image automatically, you could use a timer that saves the image in the Timer.Tick event handler.
It would look something like this:
C#
private void timer1_Tick(object sender, EventArgs e)
{
  pictureBox1.Image.Save("C:\\Test.bmp");
}
 
Share this answer
 
v2
Comments
gunkrr 18-Jan-11 1:47am    
can i use timer in timer
for example
private void timer1_Tick(object sender, EventArgs e)
{
timer2.start();
}

can i do that??
JF2015 18-Jan-11 1:59am    
Of course you can do that, but I don't really know why you would want to.
JOAT-MON 18-Jan-11 1:59am    
@gunkrr - If you are using the ImageLocation property or the .Load() function of the PictureBox to set the image initially, then you can pass the ImageLocation property to the .Save() function.
If you are creating a bitmap, or other image, then setting the Image property, not using the ImageLocation property, then you can store the path to the image file in the PictureBox.Tag property and pass it as a string to the .Save() function.
Espen Harlinn 18-Jan-11 8:47am    
5+ - Good answer and a nice follow up :)
Hi,
You just use this method to store image as file:
Use BitMap class Save method
 
Share this answer
 
Comments
gunkrr 18-Jan-11 1:47am    
thx
but can you give me example in code??

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900