|
-
May 2nd, 2005, 03:25 PM
#6
Re: HTML to BMP in VB.NET
Actually, after having reviewed your code again, you're already putting it into the bitmaps hDC, so all you should need is:
Dim doc As mshtml.HTMLDocument = DirectCast(Me.AxWebBrowser1.Document, mshtml.HTMLDocument)
Dim bodyElement As mshtml.IHTMLElement
Dim render2 As IHTMLElementRender
bodyElement = doc.body
render2 = bodyElement
Dim BitMap AsNew Bitmap(600, 400)
Dim g As Graphics = Graphics.FromImage(BitMap)
memDC = g.GetHdc()
Try
render2.DrawToDC(memDC)
Catch ex As Exception
MsgBox(ex.ToString)
EndTry
BitMap.Save("c:\newread\test.tif", System.Drawing.Imaging.ImageFormat.Tiff)
MsgBox("Image created!")
I don't us those browser controls, so I'm assuming DrawToDC is doing what we think it is.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|