Skip to content

Commit

Permalink
Improved schreenshooter usability.
Browse files Browse the repository at this point in the history
  • Loading branch information
TBXin committed Jun 3, 2017
1 parent 4155bb1 commit 81a9385
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/NToolbox/Windows/ScreenshooterWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ public ScreenshooterWindow([NotNull] ToolboxConfiguration configuration)
if (configuration == null) throw new ArgumentNullException("configuration");

m_configuration = configuration;
m_screenSize = m_bigScreenSize;

InitializeComponent();
InitializeControls();
Expand Down Expand Up @@ -176,6 +175,10 @@ private Bitmap TakeScreenshot(bool ignoreErrors = false)
? m_bigScreenSize
: m_smallScreenSize;
}
else if (m_screenSize.IsEmpty)
{
return new Bitmap(1, 1);
}

data = data.Take(m_screenSize.Width * m_screenSize.Height / 8).ToArray();
return CreateBitmapFromBytesArray(m_screenSize.Width, m_screenSize.Height, data);
Expand Down

0 comments on commit 81a9385

Please sign in to comment.