jajaja no amigo, se envio de casualidad, el codigo de capturar es este:
Mi aplicacion:
![](http://img694.imageshack.us/img694/1022/appt.jpg)
El codigo posible a la solucion en el boton capturar pero que no me funciona:
Private Sub Capturar(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCapturar.Click
Dim srcGraphics As Graphics = WebBrowser1.CreateGraphics
Try
Dim destGraphics As Graphics = PictureBox1.CreateGraphics
Dim bmpSource As New Bitmap(PictureBox1.Width, PictureBox1.Height, destGraphics)
bmpSource.Save("Image.jpg", System.Drawing.Imaging.ImageFormat.Jpeg)
Try
Dim hdcDest As IntPtr = destGraphics.GetHdc
Dim hdcSrc As IntPtr = srcGraphics.GetHdc
BitBlt(hdcDest, 0, 0, WebBrowser1.ClientRectangle.Width, WebBrowser1.ClientRectangle.Height, hdcSrc, 0, 0, CType(TernaryRasterOperations.SRCCOPY, Integer))
srcGraphics.ReleaseHdc(hdcSrc)
destGraphics.ReleaseHdc(hdcDest)
lblCaptura.Visible = True
PictureBox1.Image = bmpSource.Clone()
Finally
CType(destGraphics, IDisposable).Dispose()
End Try
Finally
CType(srcGraphics, IDisposable).Dispose()
End Try
End Sub
Código (vbnet) [Seleccionar]
Private Declare Function BitBlt Lib "gdi32" (ByVal hDestDC As Integer, ByVal X As Integer, ByVal Y As Integer, ByVal nWidth As Integer, ByVal nHeight As Integer, ByVal hSrcDC As Integer, ByVal xSrc As Integer, ByVal ySrc As Integer, ByVal dwRop As Integer) As Integer
Public Enum TernaryRasterOperations 'API BitBlt
SRCCOPY = &HCC0020
SRCPAINT = &HEE0086
SRCAND = &H8800C6
SRCINVERT = &H660046
SRCERASE = &H440328
NOTSRCCOPY = &H330008
NOTSRCERASE = &H1100A6
MERGECOPY = &HC000CA
MERGEPAINT = &HBB0226
PATCOPY = &HF00021
PATPAINT = &HFB0A09
PATINVERT = &H5A0049
DSTINVERT = &H550009
BLACKNESS = &H42
WHITENESS = &HFF0062
End Enum
Private Sub Capturar(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCapturar.Click
Dim srcGraphics As Graphics = WebBrowser1.CreateGraphics
Try
Dim destGraphics As Graphics = PictureBox1.CreateGraphics
Try
Dim hdcDest As IntPtr = destGraphics.GetHdc
Dim hdcSrc As IntPtr = srcGraphics.GetHdc
BitBlt(hdcDest, 0, 0, WebBrowser1.ClientRectangle.Width, WebBrowser1.ClientRectangle.Height, hdcSrc, 0, 0, CType(TernaryRasterOperations.SRCCOPY, Integer))
srcGraphics.ReleaseHdc(hdcSrc)
destGraphics.ReleaseHdc(hdcDest)
lblCaptura.Visible = True
Finally
CType(destGraphics, IDisposable).Dispose()
End Try
Finally
CType(srcGraphics, IDisposable).Dispose()
End Try
End Sub
Mi aplicacion:
![](http://img694.imageshack.us/img694/1022/appt.jpg)
El codigo posible a la solucion en el boton capturar pero que no me funciona:
Private Sub Capturar(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCapturar.Click
Dim srcGraphics As Graphics = WebBrowser1.CreateGraphics
Try
Dim destGraphics As Graphics = PictureBox1.CreateGraphics
Dim bmpSource As New Bitmap(PictureBox1.Width, PictureBox1.Height, destGraphics)
bmpSource.Save("Image.jpg", System.Drawing.Imaging.ImageFormat.Jpeg)
Try
Dim hdcDest As IntPtr = destGraphics.GetHdc
Dim hdcSrc As IntPtr = srcGraphics.GetHdc
BitBlt(hdcDest, 0, 0, WebBrowser1.ClientRectangle.Width, WebBrowser1.ClientRectangle.Height, hdcSrc, 0, 0, CType(TernaryRasterOperations.SRCCOPY, Integer))
srcGraphics.ReleaseHdc(hdcSrc)
destGraphics.ReleaseHdc(hdcDest)
lblCaptura.Visible = True
PictureBox1.Image = bmpSource.Clone()
Finally
CType(destGraphics, IDisposable).Dispose()
End Try
Finally
CType(srcGraphics, IDisposable).Dispose()
End Try
End Sub