2010-06-25 2 views
2

il y a beaucoup de librairies d'extraction d'écran open source pour python, php. Cependant, je n'ai pas trouvé de contrepartie .Net. Pourriez-vous recommander n'importe quelle bibliothèque pour le scrappage d'écran ou simplement l'analyse syntaxique html qui rendent la vie plus facile.Y a-t-il une bibliothèque C# pour le grattage d'écran?

+0

Je pense qu'il s'agit d'un doublon, vérifiez ce deux: http://stackoverflow.com/questions/100358/looking-for-c-html-parser http://stackoverflow.com/questions/653357/html- parsing-libraries-for-net – Adirael

Répondre

2

mise en œuvre de la méthode:

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); 
      } 
     } 
    } 

Les appels suivants:

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); 

crédit à l'auteur original @http://www.codeproject.com/KB/cs/TeboScreen.aspx

+0

La capture d'écran n'est pas un grattage d'écran – emd

0

Utilisez IRobot de IRobotSoft.

Questions connexes