Link to home
Start Free TrialLog in
Avatar of Jack_Jones
Jack_Jones

asked on

Visual Basic Screen Capture, with know coordinates.

Hello,

 I am wondering if I can supply a manual set of coordinates of the X / Y location to capture from. Using this currently and works great for the whole screen, but want to supply the location of where to capture from manual coords that I can plug in. Thanks


Dim bounds As Rectangle
        Dim screenshot As System.Drawing.Bitmap
        Dim graph As Graphics
        bounds = Screen.PrimaryScreen.Bounds
        screenshot = New System.Drawing.Bitmap(bounds.Width, bounds.Height, System.Drawing.Imaging.PixelFormat.Format32bppArgb)
        graph = Graphics.FromImage(screenshot)
        graph.CopyFromScreen(bounds.X, bounds.Y, 0, 0, bounds.Size, CopyPixelOperation.SourceCopy)
        Enhance_Performance.PictureBox1.Image = screenshot

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Carlos Villegas
Carlos Villegas
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Or maybe I'm over simplifying your question?...
Avatar of Jack_Jones
Jack_Jones

ASKER

It's dead on for the x, y, and does what I need it to. Thanks for the help. ;)
Glad to help buddy!