public override void Start(int delay, int left, int top, int width, int height, double scale, ProjectInfo project) { base.Start(delay, left, top, width, height, scale, project); #region Pointers //http://winprog.org/tutorial/bitmaps.html //_desktopWindow = User32.GetDesktopWindow(); WindowDeviceContext = User32.GetWindowDC(_desktopWindow); CompatibleDeviceContext = Gdi32.CreateCompatibleDC(WindowDeviceContext); CompatibleBitmap = Gdi32.CreateCompatibleBitmap(WindowDeviceContext, Width, Height); _oldBitmap = Gdi32.SelectObject(CompatibleDeviceContext, CompatibleBitmap); #endregion var pixelOp = CopyPixelOperations.SourceCopy; //If not in a remote desktop connection or if the improvement was disabled, capture layered windows too. if (!System.Windows.Forms.SystemInformation.TerminalServerSession || !UserSettings.All.RemoteImprovement) { pixelOp |= CopyPixelOperations.CaptureBlt; } PixelOperations = pixelOp; }
public static extern bool StretchBlt([In] IntPtr hdc, int nXDest, int nYDest, int nWidthDest, int nHeightDest, [In] IntPtr hdcSrc, int nXSrc, int nYSrc, int nWidthSource, int nHeightSource, CopyPixelOperations dwRop);
public static extern bool BitBlt([In] IntPtr hdc, int nXDest, int nYDest, int nWidth, int nHeight, [In] IntPtr hdcSrc, int nXSrc, int nYSrc, CopyPixelOperations dwRop);