How could I do a quick save option so that it auto saves to a certain location that the user doesn't have to choose and as a .jpg?
Sorry if it's really simple, I've only recently started learning it at college
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.
Re: Saving a picture without manually choosing the location?
btw - there is a set of methods available that will combine paths and filenames - part of the System.IO namespace
they work like this:
Code:
Dim strReportFolder As String = System.Web.Configuration.WebConfigurationManager.AppSettings("reportfolder")
Dim strStagingFolder As String = Path.Combine(strReportFolder, "staging")
Dim strBusyFile As String = Path.Combine(strStagingFolder, "Busy.txt")
That first Dim gets the path from a web.config file - you could just as easily hardwire that but if you are going to run this app elsewhere you need a way to make that more "variable"
Re: Saving a picture without manually choosing the location?
Originally Posted by szlamany
btw - there is a set of methods available that will combine paths and filenames - part of the System.IO namespace
they work like this:
Code:
Dim strReportFolder As String = System.Web.Configuration.WebConfigurationManager.AppSettings("reportfolder")
Dim strStagingFolder As String = Path.Combine(strReportFolder, "staging")
Dim strBusyFile As String = Path.Combine(strStagingFolder, "Busy.txt")
That first Dim gets the path from a web.config file - you could just as easily hardwire that but if you are going to run this app elsewhere you need a way to make that more "variable"
When you say to use the variable if I want to use it elsewhere, I have now changed it to use environment.username instead of "karl". I am not sure if that is the same thing but programmed differently or if you are talking about different?
Re: Saving a picture without manually choosing the location?
You are hardwiring Desktop\Screenshot though - if it's a personnal use app - or you can force people to create a folder on their desktop (some would say a desktop should only have SHORTCUTS - never a folder) then you have no issues.
Otherwise you should put the path in your app.config files - winforms have one of those - right?
*** Read the sticky in the DB forum about how to get your question answered quickly!! ***
Please remember to rate posts! Rate any post you find helpful - even in old threads! Use the link to the left - "Rate this Post".