idiot's guide to rotting at home

Wednesday, June 20, 2007

cross-eyed

wednesday afternoon decipher this:

Private Sub OnDocumentComplete(ByVal sender As Object, ByVal e As AxSHDocVw.DWebBrowserEvents2_DocumentCompleteEvent)

Dim srcGraphics As Graphics = Me.axWebBrowser1.CreateGraphics
Try

Dim destGraphics As Graphics = Me.pictureBox1.CreateGraphics
Try
Dim hdcDest As IntPtr = destGraphics.GetHdc
Dim hdcSrc As IntPtr = srcGraphics.GetHdc
GDI32.BitBlt(hdcDest, 0, 0, Me.axWebBrowser1.ClientRectangle.Width, Me.axWebBrowser1.ClientRectangle.Height, hdcSrc, 0, 0, CType(GDI32.TernaryRasterOperations.SRCCOPY, Integer))
srcGraphics.ReleaseHdc(hdcSrc)
destGraphics.ReleaseHdc(hdcDest)
Finally
CType(destGraphics, IDisposable).Dispose()
End Try
Finally
CType(srcGraphics, IDisposable).Dispose()
End Try
End Sub


ok. basically it just creates a screenshot/image of a webpage. you know the snapshot feature you see in blogs? this is pretty much it..
lots more to go. darn. someone give me a cup of hot chocolate with whip cream on top. while you're at it, lunch too. thank you very much.

0 Comments:

Post a Comment

<< Home