有很多用于python,php的开源屏幕抓取库。但是我找不到任何.Net对应物。你能推荐任何用于屏幕抓取的库或只是html解析,这会让生活更轻松。
答案 0 :(得分:9)
答案 1 :(得分:2)
方法实施:
public static void CaptureImage(Point SourcePoint, Point DestinationPoint,
Rectangle SelectionRectangle, string FilePath)
{
using (Bitmap bitmap = new Bitmap(SelectionRectangle.Width,
SelectionRectangle.Height))
{
using (Graphics g = Graphics.FromImage(bitmap))
{
g.CopyFromScreen(SourcePoint, DestinationPoint,
SelectionRectangle.Size);
}
bitmap.Save(FilePath, ImageFormat.Bmp);
}
}
}
后续电话:
Point StartPoint = new Point(ClickPoint.X, ClickPoint.Y);
Rectangle bounds = new Rectangle(ClickPoint.X, ClickPoint.Y,
CurrentPoint.X - ClickPoint.X, CurrentPoint.Y - ClickPoint.Y);
ScreenShot.CaptureImage(StartPoint, Point.Empty, bounds, ScreenPath);
答案 2 :(得分:0)
使用IRobotSoft的IRobot。