Partial Screen Capture using C#
I need to cr开发者_开发知识库eate an application in C# that captures part of the screen when certain part of the same screen changes. Thank you all.
You can use the System.Drawing.Graphics class. It has a CopyFromScreen method that will draw the content of a rectangular area of the screen into a Bitmap object.
It should do what you are after.
Have a look at this open source project called - Cropper. It is developed using C#.
Download the source code and have a look at it, you will get the basic idea of using System.Drawing classes.
Bitmap bmp = new Bitmap(rect.Width, rect.Height, PixelFormat.Format32bppArgb);
Graphics g = Graphics.FromImage(bmp);
g.CopyFromScreen(Left, Top, 0, 0, bmp.Size, CopyPixelOperation.SourceCopy);
bmp.Save(fileName, ImageFormat.Jpeg);
精彩评论