A way to save screenshot into a file?

Ask general questions here.
wyll
Posts: 34
Joined: Wed Aug 01, 2012 3:19 pm

A way to save screenshot into a file?

Post by wyll » Mon Oct 29, 2012 11:10 am

Hi there,

is there a way to save the surrounding of the mousepointer as a screenshot into a specific folder?

something like
x=mouse.position.x;
y=mouse.position.y;

Point p = new Point(x,y);
//and then get the area like 50 pixels up, down, left & right 
//save that crop image in folder (C:\somewhere)
regards
Wyll

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: A way to save screenshot into a file?

Post by Support Team » Tue Oct 30, 2012 1:49 pm

Hi Wyll,

This code could work for you:
Bitmap image = Imaging.CaptureDesktopImage(new Rectangle(int x, int y, int width, int height));
image.Save("test.jpg", System.Drawing.Imaging.ImageFormat.Jpeg);
, for more information please take a look at our online API: Imaging Class.

Regards,
Markus
.
Image

wyll
Posts: 34
Joined: Wed Aug 01, 2012 3:19 pm

Re: A way to save screenshot into a file?

Post by wyll » Tue Oct 30, 2012 2:52 pm

Hi Markus,

thanks a lot, that is exactly what i was looking for.

regards ,
Wyll