Ciao a tutto il forum
io ho creato queste righe per fare uno screenshot da una pagina web
Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
Timer1.Enabled = True
End Sub
Private Sub Timer1_Tick(sender As System.Object, e As System.EventArgs) Handles Timer1.Tick
Timer1.Enabled = False
' Load the webpage into a WebBrowser control
WebBrowser1.ScriptErrorsSuppressed = True
WebBrowser1.Navigate("http://www.miosito.controlScreenShot")
End Sub
Private Sub WebBrowser1_DocumentCompleted(sender As System.Object, e As System.Windows.Forms.WebBrowserDocumentCompletedEventArgs) Handles webbrowser1.DocumentCompleted
If Not WebBrowser1.Url.Equals("equals:blank") Then
WebBrowser1.ScriptErrorsSuppressed = True
WebBrowser1.Refresh()
End If
WebBrowser1.Width = Width
webbrowser1.Height = Height
If Width = -1 Then
' Take Screenshot of the web pages full width
WebBrowser1.Width = WebBrowser1.Document.Body.ScrollRectangle.Width
End If
If Height = -1 Then
' Take Screenshot of the web pages full height
webbrowser1.Height = webbrowser1.Document.Body.ScrollRectangle.Height
End If
Dim bitmap As New Bitmap(WebBrowser1.Width, WebBrowser1.Height)
webbrowser1.DrawToBitmap(bitmap, New Rectangle(0, 0, webbrowser1.Width, webbrowser1.Height))
PictureBox1.image = bitmap
PictureBox1.Image.Save(TextBox2.Text, System.Drawing.Imaging.ImageFormat.Jpeg)
Dim imag As New PictureBox()
imag.Height = 200
imag.Width = 370
Dim myCallback As New Image.GetThumbnailImageAbort(AddressOf ThumbnailCallback)
Dim myThumbnail As Image = bitmap.GetThumbnailImage(567, 330, myCallback, IntPtr.Zero)
imag.Image = myThumbnail
Flppictures.Controls.Add(imag)
End Sub
Public Function ThumbnailCallback() As Boolean
Return False
End Function
funziona perfettamente
però: e qui penso sia richiesta htppweb
il problema e che vorrei aggiungere credenziali + porta (possibilmente)e non riesco mi aiutate
grazie