How to Save Picture(Image)
-
Hi everyone I've a project where i have webBrowser control to display web page contents. When a user wants to save pictures(image(s)) to hard drive instead of he/she right clicking the picture(image) and clicking 'Save Picture As...', I have a button the user click that button and programatically saves the picture(image). I googled, post my question at MSDN, here, for a year and half no luck. I found some codes but they only save the portion of picture (image) which is displayed by screen. When ever the picture(image) is larger than the computer's physical screen size, I endes up saving partial picture(image). This forum seems more live than any other forum I know. Please help. Help.
-
Hi everyone I've a project where i have webBrowser control to display web page contents. When a user wants to save pictures(image(s)) to hard drive instead of he/she right clicking the picture(image) and clicking 'Save Picture As...', I have a button the user click that button and programatically saves the picture(image). I googled, post my question at MSDN, here, for a year and half no luck. I found some codes but they only save the portion of picture (image) which is displayed by screen. When ever the picture(image) is larger than the computer's physical screen size, I endes up saving partial picture(image). This forum seems more live than any other forum I know. Please help. Help.
By image, do you mean the rendered html page as an image, or individual images on the page (img tags)? I assume the first since the latter is not very difficult. Have you tried
IHTMLElementRender.DrawToDC
on the root element, and supplying your own DC with a selected bitmap? Edit: maybe it was the latter case anyway. I looked to see if there was an easy way, but it seems you cannot easily get a handle to the actual bitmap of the image. But you could still useIHTMLElementRender.DrawToDC
on the img element itself I suppose. See also: Capture an HTML document as an image[^] http://www.nathanm.com/ihtmlelementrender-opacity/[^]modified on Sunday, June 6, 2010 4:21 PM
-
By image, do you mean the rendered html page as an image, or individual images on the page (img tags)? I assume the first since the latter is not very difficult. Have you tried
IHTMLElementRender.DrawToDC
on the root element, and supplying your own DC with a selected bitmap? Edit: maybe it was the latter case anyway. I looked to see if there was an easy way, but it seems you cannot easily get a handle to the actual bitmap of the image. But you could still useIHTMLElementRender.DrawToDC
on the img element itself I suppose. See also: Capture an HTML document as an image[^] http://www.nathanm.com/ihtmlelementrender-opacity/[^]modified on Sunday, June 6, 2010 4:21 PM
Actually, I'm tring to save individual images in a web page. The problem is if any individual image is larger than the physical size of my computr's screen, IHTMLElementRender::DrawToDC() only draws to the size of my computer screen size. So I ended up with partial image. Do you konw how to save an entire image?
-
Actually, I'm tring to save individual images in a web page. The problem is if any individual image is larger than the physical size of my computr's screen, IHTMLElementRender::DrawToDC() only draws to the size of my computer screen size. So I ended up with partial image. Do you konw how to save an entire image?