all groups > visual studio .net general > august 2006 >
You're in the

visual studio .net general

group:

Save Image from AxWebBrowser


Save Image from AxWebBrowser SBK
8/9/2006 1:34:05 PM
visual studio .net general: Hi,

Basically, I'm using this method (code segment, doc is the html document
(etc)):


Dim element As mshtml.HTMLImgClass

element = doc.getElementById(nextId)

elementWidth = element.offsetWidth
elementHeight = element.offsetHeight
render = CType(element, IHTMLElementRender)

memoryBitmap = New Bitmap(elementWidth, elementHeight,
System.Drawing.Imaging.PixelFormat.Format32bppRgb)
memGraphics = Graphics.FromImage(memoryBitmap)
memDC = memGraphics.GetHdc()
render.DrawToDC(memDC)
memGraphics.ReleaseHdc(memDC)

eps = New EncoderParameters(1)
eps.Param(0) = New EncoderParameter(Encoder.Quality, jpgQUALITY)
ici = GetEncoderInfo("image/jpeg")
memoryBitmap.Save(location, eps, ici)


Everything works fine until the image is larger than my screen resolution.
For example, if the image height is larger than the screen height (say 1024
pixels), that part of the image that is more than 1024 will just be black.

How do I get around this?
RE: Save Image from AxWebBrowser SBK
8/10/2006 8:35:02 AM
Or...
If someone could point me to the forum that might have more insight into
this problem...

AddThis Social Bookmark Button