यूआरएल को इनपुट के रूप में प्रोग्राम किए गए वेबपृष्ठ का एक सेंसरशॉट कैसे लेता है?प्रोग्रामिंग के किसी वेबपृष्ठ का स्क्रीनशॉट लेना
और यहाँ मैं क्या अब तक है:
// The size of the browser window when we want to take the screenshot (and the size of the resulting bitmap)
Bitmap bitmap = new Bitmap(1024, 768);
Rectangle bitmapRect = new Rectangle(0, 0, 1024, 768);
// This is a method of the WebBrowser control, and the most important part
webBrowser1.DrawToBitmap(bitmap, bitmapRect);
// Generate a thumbnail of the screenshot (optional)
System.Drawing.Image origImage = bitmap;
System.Drawing.Image origThumbnail = new Bitmap(120, 90, origImage.PixelFormat);
Graphics oGraphic = Graphics.FromImage(origThumbnail);
oGraphic.CompositingQuality = CompositingQuality.HighQuality;
oGraphic.SmoothingMode = SmoothingMode.HighQuality;
oGraphic.InterpolationMode = InterpolationMode.HighQualityBicubic;
Rectangle oRectangle = new Rectangle(0, 0, 120, 90);
oGraphic.DrawImage(origImage, oRectangle);
// Save the file in PNG format
origThumbnail.Save(@"d:\Screenshot.png", ImageFormat.Png);
origImage.Dispose();
लेकिन यह काम नहीं कर रहा। यह केवल मुझे एक सफेद खाली तस्वीर दे रहा है। मुझे यहां क्या समझ नहीं आ रहा है?
क्या कोई अन्य तरीका है कि मैं प्रोग्रामिंग के वेब पेज का स्क्रीनशॉट प्राप्त कर सकता हूं?
यह प्रश्न कल पूछा गया था, हालांकि मुख्य रूप से पर्ल में निर्देशित किया गया था। शायद कुछ जवाब आपको मदद करेंगे, हालांकि स्पष्ट रूप से आपको एक और दिशा ले जाएगा। यहां [लिंक] है (http://stackoverflow.com/questions/2312852/how-can-i-take-creenshots-with-perl)। – lundmark