实现效果:
知识运用:
Graphics类的CopyFromScreen方法 //该方法用于执行颜色数据(对应于由像素组成的矩形)从屏幕到Graphics的绘图画面的为块传输
public void CopyFromScreen(int sourceX, int sourceY, int destinationX, int destinationY, Size blockRegionSize);
实现代码:
private Bitmap CaptureNoCursor() { Bitmap bmap = new Bitmap(Screen.GetWorkingArea(this).Width,Screen.GetWorkingArea(this).Height); using(Graphics g=Graphics.FromImage(bmap)) { g.CopyFromScreen(0,0,0,0,bmap.Size); } return bmap; }