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#
  4. Access GDI+ Image pointer from unmanaged C++ dll...

Access GDI+ Image pointer from unmanaged C++ dll...

Scheduled Pinned Locked Moved C#
csharpc++winformsgraphicsquestion
2 Posts 2 Posters 1 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
    SpiderMan
    wrote on last edited by
    #1

    I have a C++ dll that opens an image file using GDI+ and gets a thumbnail of the opened image using GetThumbnailImage. I would like the C++ DLL to be able to return a pointer to the Image and then have a custom C# control of mine display it. Does anyone know how I can share this image information between the two languages? (I know I can use C#'s GDI image functions to create the thumbnail also, but the C++ version is much faster).

    A 1 Reply Last reply
    0
    • S SpiderMan

      I have a C++ dll that opens an image file using GDI+ and gets a thumbnail of the opened image using GetThumbnailImage. I would like the C++ DLL to be able to return a pointer to the Image and then have a custom C# control of mine display it. Does anyone know how I can share this image information between the two languages? (I know I can use C#'s GDI image functions to create the thumbnail also, but the C++ version is much faster).

      A Offline
      A Offline
      Andy Moore
      wrote on last edited by
      #2

      You could have the C++ dll return the handle to the image using the GDI+ Bitmap.GetHBitmap(). Your C# control could then get an IntPtr containing the handle to the bitmap and use Image.FromHBitmap() to get the image object back. Human beings were not meant to sit in little cubicles staring at computer screens all day, filling out useless forms and listening to eight different bosses drone on about about mission statements. -- Peter Gibbons

      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