Permalink
Browse files

Allow the screenshot save location to be configurable by using a File…

…Browser.
  • Loading branch information...
1 parent 53673a1 commit 6a56e572ff51326cdff23746f1e0ca6ad85ab456 @robertgreiner committed Jan 17, 2012
Showing with 14 additions and 5 deletions.
  1. +1 −1 Slapshot/Screenshot.cs
  2. +3 −1 Slapshot/Slapshot.Designer.cs
  3. +7 −3 Slapshot/Slapshot.cs
  4. +3 −0 Slapshot/Slapshot.resx
@@ -62,7 +62,7 @@ private void ProcessBitmap(Rectangle rectangle)
private void SaveImage(Image image)
{
- image.Save(FileName, SaveFormat);
+ image.Save(FilePath, SaveFormat);
}
}
}
Oops, something went wrong.
View
@@ -8,6 +8,7 @@ public partial class Slapshot : Form
{
private string SaveDirectory;
private ImageFormat SaveFormat;
+ private Screenshot Screen;
public Slapshot()
{
@@ -19,6 +20,7 @@ private void Initialize()
{
SaveDirectory = ".";
SaveFormat = ImageFormat.Png;
+ Screen = new Screenshot(SaveDirectory, SaveFormat);
}
private void Slapshot_SizeChanged(object sender, EventArgs e)
@@ -43,8 +45,8 @@ private void minimizeToTray()
private void CaptureMenuItem_Click(object sender, EventArgs e)
{
- var screenshot = new Screenshot(SaveDirectory, SaveFormat);
- screenshot.CaptureEntireScreen();
+ MessageBox.Show(Screen.FilePath);
+ Screen.CaptureEntireScreen();
}
private void CloseMenuItem_Click(object sender, EventArgs e)
@@ -54,7 +56,9 @@ private void CloseMenuItem_Click(object sender, EventArgs e)
private void DirectoryMenuItem_Click(object sender, EventArgs e)
{
-
+ FolderBrowser.ShowDialog();
+ SaveDirectory = FolderBrowser.SelectedPath;
+ Screen = new Screenshot(SaveDirectory, SaveFormat);
}
}
}
@@ -148,6 +148,9 @@
AACAAQAAgAEAAA==
</value>
</data>
+ <metadata name="FolderBrowser.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+ <value>279, 17</value>
+ </metadata>
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAQAQAABMLAAATCwAAAAAAAAAA

0 comments on commit 6a56e57

Please sign in to comment.