public void GoruntuyuYakala(bool imlec, Rectangle rc) { try { Point imlec_pozisyon = new Point(Cursor.Position.X, Cursor.Position.Y); Size imlec_boyut = new Size(); imlec_boyut.Height = Cursor.Current.Size.Height; imlec_boyut.Width = Cursor.Current.Size.Width; Rectangle Sinirlar; if (rc.Width != 0 && rc.Height != 0 && rc.X != 0 && rc.Y != 0) { Bitmap image1 = new Bitmap(rc.Width, rc.Height); Graphics g = Graphics.FromImage(image1); g.CopyFromScreen(new Point(rc.X, rc.Y), Point.Empty, rc.Size); Image image = SCapture.Control(Control.MousePosition, Settings.Default.imlec); imgBox.Image = image1; this.Show(); this.WindowState = FormWindowState.Maximized; image.Dispose(); Formislemleri(); } else { Sinirlar = Screen.GetBounds(Screen.GetBounds(Point.Empty)); Goruntuyu_al(imlec, imlec_boyut, imlec_pozisyon, Point.Empty, Point.Empty, Sinirlar); Formislemleri(); } } catch { } }
public static Bitmap Window(IntPtr handle, bool includeCursor) { if (handle != IntPtr.Zero) { return(SCapture.Control(handle, includeCursor)); } throw new SCaptureException("Invalid window handle."); }
public static Bitmap Control(Point screenPoint, bool includeCursor) { IntPtr intPtr = SCapture.UnsafeNativeMethods.WindowFromPoint(screenPoint); if (intPtr != IntPtr.Zero) { return(SCapture.Control(intPtr, includeCursor)); } throw new SCaptureException("Could not find any control at the specified point."); }
public static Bitmap ActiveWindow(bool includeCursor) { IntPtr foregroundWindow = SCapture.UnsafeNativeMethods.GetForegroundWindow(); if (foregroundWindow != IntPtr.Zero) { return(SCapture.Control(foregroundWindow, includeCursor)); } throw new SCaptureException("Could not find any active window."); }
public static Bitmap Window(Point screenPoint, bool includeCursor) { IntPtr intPtr = SCapture.UnsafeNativeMethods.WindowFromPoint(screenPoint); if (!(intPtr != IntPtr.Zero)) { throw new SCaptureException("Could not find any window at the specified point."); } IntPtr ancestor = SCapture.UnsafeNativeMethods.GetAncestor(intPtr, 3u); if (ancestor != IntPtr.Zero) { return(SCapture.Control(ancestor, includeCursor)); } return(SCapture.Control(intPtr, includeCursor)); }