|
-
Feb 5th, 2012, 10:16 AM
#1
Thread Starter
Lively Member
Re: Saving a picture without manually choosing the location?
I can do the file name, I am unsure how to add the location in?
I have
Quick save Code:
quicksave.FileName = "screenshot" & intCount + 1
PictureBox1.Image.Save(quicksave.FileName, System.Drawing.Imaging.ImageFormat.Jpeg)
and I want it to save to "C:\Users\Karl\Desktop\Screenshot"?
-
Feb 5th, 2012, 10:26 AM
#2
Re: Saving a picture without manually choosing the location?
What is this quicksave.filename and intCount +1 all about? As i previously said you need to hard code the location. When i say hard code write the string value exactly as how you would see it.
For example if you wanted to save the picture from multiple instances in your application with possibly a different location each time you can make a new method as such.
vb Code:
Private Sub SavePictureBox(ByVal path As String) PictureBox1.Image.Save(path, System.Drawing.Imaging.ImageFormat.Jpeg) End Sub
Now when calling this method you would pass an argument.
vb Code:
SavePictureBox("C:\Users\Karl\Desktop\Screenshot\filename.jpeg")
vb Code:
PictureBox1.Image.Save("C:\Users\Karl\Desktop\Screenshot\filename.jpeg", System.Drawing.Imaging.ImageFormat.Jpeg)
-
Feb 5th, 2012, 10:53 AM
#3
Thread Starter
Lively Member
Re: Saving a picture without manually choosing the location?
Ahh thank you, I misunderstood the first time, it is working now.
The intCount is the number of files in that folder, so by adding 1 to it, it should be a unique filename.
I did it like this to include the intCount
vb Code:
PictureBox1.Image.Save("C:\Users\Karl\Desktop\Screenshot\" & quicksave.FileName & ".jpg", System.Drawing.Imaging.ImageFormat.Jpeg)
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|