Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug修复 #34

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file removed Installer/ScreenTask.zip
Binary file not shown.
Binary file modified Installer/ScreenTaskInstaller.exe
Binary file not shown.
8 changes: 4 additions & 4 deletions ScreenTask/FullScreenCapture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@ private struct POINTAPI
private static extern bool GetCursorInfo(out CURSORINFO pci);

[DllImport("user32.dll", SetLastError = true)]
static extern bool DrawIconEx(IntPtr hdc, int xLeft, int yTop, IntPtr hIcon, int cxWidth, int cyHeight, int istepIfAniCur, IntPtr hbrFlickerFreeDraw, int diFlags);
private static extern bool DrawIconEx(IntPtr hdc, int xLeft, int yTop, IntPtr hIcon, int cxWidth, int cyHeight, int istepIfAniCur, IntPtr hbrFlickerFreeDraw, int diFlags);

private const Int32 CURSOR_SHOWING = 0x0001;
private const Int32 DI_NORMAL = 0x0003;

public static Bitmap CaptureFullScreen(bool captureMouse)
public Bitmap CaptureFullScreen(bool captureMouse)
{
var allBounds = Screen.AllScreens.Select(s => s.Bounds).ToArray();
Rectangle bounds = Rectangle.FromLTRB(allBounds.Min(b => b.Left), allBounds.Min(b => b.Top), allBounds.Max(b => b.Right), allBounds.Max(b => b.Bottom));
Expand All @@ -45,15 +45,15 @@ public static Bitmap CaptureFullScreen(bool captureMouse)
return bitmap;
}

public static Bitmap CapturePrimaryScreen(bool captureMouse)
public Bitmap CapturePrimaryScreen(bool captureMouse)
{
Rectangle bounds = Screen.PrimaryScreen.Bounds;

var bitmap = CaptureScreen(bounds, captureMouse);
return bitmap;
}

public static Bitmap CaptureScreen(Rectangle bounds, bool captureMouse)
public Bitmap CaptureScreen(Rectangle bounds, bool captureMouse)
{
Bitmap result = new Bitmap(bounds.Width, bounds.Height);

Expand Down
Loading