图片截图,分左右两边保存为两张图片
private bool Pictures_interception(Point S, int最新钓鱼用具 width, int height)
{
//获得当前屏幕的分辨率
Screen scr = Screen.PrimaryScreen;
Rectangle rc = scr.Bounds;
int iWidth = rc.Width;
int iHeight = rc.Height;
Image myImage = new Bitmap(iWidth, iHeight);
开学第一课读后感//从一个继承自Image类的对象中创建Graphics对象
丁俊晖第四杆147 Graphics g = Graphics.FromImage(myImage);
//抓屏并拷贝到myImage里
g.CopyFromScreen(S, new Point(0, 0), new Size(width, height));
探案电视剧Bitmap bmp = new Bitmap(myImage);
Image myImage1 = new Bitmap(iWidth, iHeight);
Image myImage2 = new我的世界怎么去末地 Bitmap(iWidth, iHeight);
Graphics g1 = Graphics.FromImage(myImage1);
Graphics蛋糕的寸指的是什么 g2 = Graphics.FromImage(myImage2);
g1.DrawImage(myImage, new Rectangle(0, 0, 180, height), 0, 0, 180, height, GraphicsUnit.Pixel);
g2.DrawImage(myImage, new Rectangle(0, 0, 30, height), 180, 0, 30, height, GraphicsUnit.Pixel);
Bitmap bmp1 = new Bitmap(myImage1);
bmp1.Save("bmp\\image1-" + bmp_index.ToString() + ".bmp");
Bitmap bmp2 = new Bitmap(myImage2);
bmp2.Save("bmp\\image2-" + bmp_index.ToString() + ".bmp");
bmp.Dispose();
g.Dispose();
myImage.Dispose();
return true;
}
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。
发表评论