Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. How to Save Picture(Image)

How to Save Picture(Image)

Scheduled Pinned Locked Moved C / C++ / MFC
helptutorialquestion
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • V Offline
    V Offline
    voo doo12
    wrote on last edited by
    #1

    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.

    N 1 Reply Last reply
    0
    • V voo doo12

      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.

      N Offline
      N Offline
      Niklas L
      wrote on last edited by
      #2

      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 use IHTMLElementRender.DrawToDC on the img element itself I suppose. See also: Capture an HTML document as an image[^] http://www.nathanm.com/ihtmlelementrender-opacity/[^]

      home

      modified on Sunday, June 6, 2010 4:21 PM

      V 1 Reply Last reply
      0
      • N Niklas L

        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 use IHTMLElementRender.DrawToDC on the img element itself I suppose. See also: Capture an HTML document as an image[^] http://www.nathanm.com/ihtmlelementrender-opacity/[^]

        home

        modified on Sunday, June 6, 2010 4:21 PM

        V Offline
        V Offline
        voo doo12
        wrote on last edited by
        #3

        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?

        N 1 Reply Last reply
        0
        • V voo doo12

          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?

          N Offline
          N Offline
          Niklas L
          wrote on last edited by
          #4

          Hristo gave you a working sample here Save Image from WebBrowser control[^] Didn't that work for you?

          home

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups