Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

control shot c# WF

// doing a screenshot from control "panel2"
string filename = "временный файл.jpeg";
Bitmap printscreen = new Bitmap(panel2.Width - 5, panel2.Height - 5);
Graphics graphics = Graphics.FromImage(printscreen as System.Drawing.Image);
int top = this.Top + panel2.Top + 35;
int left = this.Left + panel2.Left + 10;
graphics.CopyFromScreen(left, top, 0, 0, printscreen.Size);
printscreen.Save(filename, System.Drawing.Imaging.ImageFormat.Jpeg);
 
PREVIOUS NEXT
Tagged: #control #shot #WF
ADD COMMENT
Topic
Name
2+7 =