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. GDI+ : construct Image from an IStream

GDI+ : construct Image from an IStream

Scheduled Pinned Locked Moved C / C++ / MFC
winformsgraphicsperformancequestion
7 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
    sstoyan
    wrote on last edited by
    #1

    im trying to construct a GDI+ Image object from an IStream; the IStream is created on global memory successfully and assigned valid image data but, when i try image = ::new Image(stream) laststatus says something about wrong/incorrect arguments ("InvalidParameter" i think) has anybody tried this ?

    J 1 Reply Last reply
    0
    • S sstoyan

      im trying to construct a GDI+ Image object from an IStream; the IStream is created on global memory successfully and assigned valid image data but, when i try image = ::new Image(stream) laststatus says something about wrong/incorrect arguments ("InvalidParameter" i think) has anybody tried this ?

      J Offline
      J Offline
      Jorgen Sigvardsson
      wrote on last edited by
      #2

      Did you rewind the stream? I.e. pStream->Seek(0, STREAM_SEEK_SET, 0)? -- Try walking in my shoes. You stumble in my footsteps.

      S 2 Replies Last reply
      0
      • J Jorgen Sigvardsson

        Did you rewind the stream? I.e. pStream->Seek(0, STREAM_SEEK_SET, 0)? -- Try walking in my shoes. You stumble in my footsteps.

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

        never knew i had to ! :eek: Thank you for the hint - will give it a try

        J 1 Reply Last reply
        0
        • J Jorgen Sigvardsson

          Did you rewind the stream? I.e. pStream->Seek(0, STREAM_SEEK_SET, 0)? -- Try walking in my shoes. You stumble in my footsteps.

          S Offline
          S Offline
          sstoyan
          wrote on last edited by
          #4

          nope, doesnt work still the GDI+ Image still has property nativeImage = 0x00 and lastResult is InvalidParameter any other ideas ?

          J 1 Reply Last reply
          0
          • S sstoyan

            never knew i had to ! :eek: Thank you for the hint - will give it a try

            J Offline
            J Offline
            Jorgen Sigvardsson
            wrote on last edited by
            #5

            I've run into that problem a couple of times. :-O -- Try walking in my shoes. You stumble in my footsteps.

            1 Reply Last reply
            0
            • S sstoyan

              nope, doesnt work still the GDI+ Image still has property nativeImage = 0x00 and lastResult is InvalidParameter any other ideas ?

              J Offline
              J Offline
              Jorgen Sigvardsson
              wrote on last edited by
              #6

              Sorry, I'm out of ideas. :( -- Try walking in my shoes. You stumble in my footsteps.

              S 1 Reply Last reply
              0
              • J Jorgen Sigvardsson

                Sorry, I'm out of ideas. :( -- Try walking in my shoes. You stumble in my footsteps.

                S Offline
                S Offline
                sstoyan
                wrote on last edited by
                #7

                thanx, Jörgen i think i found the cause - its actually not the IStream, but the GIF image data inside of it that makes the Image constructor fail. When i exported the GIF image and saved it anew (in acdsee) - the new file is slightly different and Image aquires it without problems. I'll be digging it some more, but its a different matter now :) thanx again see you around

                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