Skip to content

Commit b1cfc08

Browse files
committed
Ignoring zero size forms
1 parent 0440dca commit b1cfc08

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/Coderr.Client.WinForms/FormScreenshooter.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ static FormScreenshooter()
3636
/// <param name="destination">Will be saved as JPEG.</param>
3737
public void Capture(Form form, Stream destination)
3838
{
39+
if (form.Width == 0 || form.Height == 0)
40+
return;
41+
3942
using (var g = form.CreateGraphics())
4043
{
4144
using (var bmp = new Bitmap(form.Width, form.Height, PixelFormat))

0 commit comments

Comments
 (0)