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. COM
  4. Accessing images trough IHTMLDocument2

Accessing images trough IHTMLDocument2

Scheduled Pinned Locked Moved COM
comquestion
5 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.
  • S Offline
    S Offline
    SysLo
    wrote on last edited by
    #1

    Hi, The IHTMLDocument2 interface has the method get_images(), which supposedly returns the images found in the document. But trough that interface I can only access the attributes concerning the images (e.g. height, width, border etc.). So my question can I access the actual image data from somewhere. From IHTMLDocument2 or from some other related interface. I'm developing an ActiveX component which needs to alter images on pages. "There is no reason for any individuals to have a computer in their home". Ken Olson, president and founder of Digital Equipment Corp.

    H 1 Reply Last reply
    0
    • S SysLo

      Hi, The IHTMLDocument2 interface has the method get_images(), which supposedly returns the images found in the document. But trough that interface I can only access the attributes concerning the images (e.g. height, width, border etc.). So my question can I access the actual image data from somewhere. From IHTMLDocument2 or from some other related interface. I'm developing an ActiveX component which needs to alter images on pages. "There is no reason for any individuals to have a computer in their home". Ken Olson, president and founder of Digital Equipment Corp.

      H Offline
      H Offline
      Heath Stewart
      wrote on last edited by
      #2

      There doesn't seem to be any way of doing this, short of hosting the WebBrowser control (or MSHTML) and handling the markup and rendering yourself, which I'm betting isn't an option. Intead, what about displaying the image in your ActiveX control. That way, it would have exclusive control over the display of the image. MSN Photos used to have a print wizard that worked similar (they probably still do, but they went to strickly subscription-based usability so I can't use it anymore). You could still get certain images on the page by getting their src attribute and downloading and displaying in your ActiveX. Just an alternative suggestion.

      Reminiscent of my younger years...

      10 LOAD "SCISSORS" 20 RUN

      S 1 Reply Last reply
      0
      • H Heath Stewart

        There doesn't seem to be any way of doing this, short of hosting the WebBrowser control (or MSHTML) and handling the markup and rendering yourself, which I'm betting isn't an option. Intead, what about displaying the image in your ActiveX control. That way, it would have exclusive control over the display of the image. MSN Photos used to have a print wizard that worked similar (they probably still do, but they went to strickly subscription-based usability so I can't use it anymore). You could still get certain images on the page by getting their src attribute and downloading and displaying in your ActiveX. Just an alternative suggestion.

        Reminiscent of my younger years...

        10 LOAD "SCISSORS" 20 RUN

        S Offline
        S Offline
        SysLo
        wrote on last edited by
        #3

        Yep, I was also thinking about, taking the src of the image and then downloading it again and so. Though it is kind of stupid to download the images two times, so I was hoping for an easier solution. But I quess I have to live with this ... Thanx

        H 1 Reply Last reply
        0
        • S SysLo

          Yep, I was also thinking about, taking the src of the image and then downloading it again and so. Though it is kind of stupid to download the images two times, so I was hoping for an easier solution. But I quess I have to live with this ... Thanx

          H Offline
          H Offline
          Heath Stewart
          wrote on last edited by
          #4

          You don't actually have to download it twice. Use the moniker functions like IE does like URLDownloadToCacheFile, which even gives you callback. The file is pulled from the cache based on the browser's cache settings. You can also bind an image to the URL moniker directly, which is how IE / Windows usually handles things. This, agian, should be under the control of the cache settings.

          Reminiscent of my younger years...

          10 LOAD "SCISSORS" 20 RUN

          S 1 Reply Last reply
          0
          • H Heath Stewart

            You don't actually have to download it twice. Use the moniker functions like IE does like URLDownloadToCacheFile, which even gives you callback. The file is pulled from the cache based on the browser's cache settings. You can also bind an image to the URL moniker directly, which is how IE / Windows usually handles things. This, agian, should be under the control of the cache settings.

            Reminiscent of my younger years...

            10 LOAD "SCISSORS" 20 RUN

            S Offline
            S Offline
            SysLo
            wrote on last edited by
            #5

            That sounds good. at least better than downloading the images twice. I'll have to try that. Thnx again for your answer :)

            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