|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Webbrowser drawtobitmap does not workI have visual studio 2005 on XP SP2. I have a simple sample application using a webbrowser and 2 buttons. Button1 loads the page Button2 saves the screenshot But for some reason the screenshot is always blank Sample code: -------------- Private Function CreateScreenshot(ByVal Control As Control) As Bitmap Dim Screenshot As New Bitmap(Control.Width, Control.Height) Control.DrawToBitmap(Screenshot, New Rectangle(0, 0, Control.Width, Control.Height)) Return Screenshot End Function Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click WebBrowser1.Navigate(New Uri("http://www.hln.be/")) End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click Dim bm As Bitmap bm = CreateScreenshot(WebBrowser1) bm.Save("c:\temp\test.png", System.Drawing.Imaging.ImageFormat.Png) End Sub Any ideas? "GM" <inva***@invalid.com> schrieb: This method doesn't work in a stable way. I believe this fact is documented > I have visual studio 2005 on XP SP2. > I have a simple sample application using a webbrowser and 2 buttons. > Button1 loads the page > Button2 saves the screenshot > But for some reason the screenshot is always blank somewhere. -- M S Herfried K. Wagner M V P <URL:http://dotnet.mvps.org/> V B <URL:http://classicvb.org/petition/>
UGH, Framework goes just so far AGAIN!
forms collection? Help with truncating WEBREQUEST AND WEBRESPONSE PROBLEM URGENT: Problem when iterating through a custom collection (dictionary based) with FOR...EACH GUI Design Question Problem when iterating through custom dictionary based collection with FOR...EACH...NEXT Process output redirection? Using a VB.net dll in VB6 How to know if a file is ready. |
|||||||||||||||||||||||