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 and GDIplus

GDI and GDIplus

Scheduled Pinned Locked Moved C / C++ / MFC
graphicsquestion
3 Posts 3 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.
  • A Offline
    A Offline
    Anonymous
    wrote on last edited by
    #1

    Hello, Can GDI and GDIplus co-exist in the VC project. I am thinking of mixing use of these libraries. My existing library is using GDI but it seems that GDIplus has some cool functions which I think it would great to incorporate into it also. Possible? Would it crash or lib conflict? thank you.

    M PJ ArendsP 2 Replies Last reply
    0
    • A Anonymous

      Hello, Can GDI and GDIplus co-exist in the VC project. I am thinking of mixing use of these libraries. My existing library is using GDI but it seems that GDIplus has some cool functions which I think it would great to incorporate into it also. Possible? Would it crash or lib conflict? thank you.

      M Offline
      M Offline
      Martin Koorts
      wrote on last edited by
      #2

      Hi I haven't used GDI+ but inspecting the GDI+ Graphics class, I see a constructor that takes a HDC, so you should be able to mix the 2. Martin

      1 Reply Last reply
      0
      • A Anonymous

        Hello, Can GDI and GDIplus co-exist in the VC project. I am thinking of mixing use of these libraries. My existing library is using GDI but it seems that GDIplus has some cool functions which I think it would great to incorporate into it also. Possible? Would it crash or lib conflict? thank you.

        PJ ArendsP Offline
        PJ ArendsP Offline
        PJ Arends
        wrote on last edited by
        #3

        Yes they can coexist. But the trick is getting the HDC for GDI drawing. You have to first create the Gdiplus::Graphics object that you will do all your drawing on, then call Graphics::GetHDC to get the HDC you need for your GDI calls. If you draw on a HDC with GDI and then try to attach a Graphics object to the same HDC the Graphics constructor will erase all the drawing you have done. Lookup Graphics::GetHDC and Graphics::ReleaseHDC in MSDN for more info.


        "You're obviously a superstar." - Christian Graus about me - 12 Feb '03 "Obviously ???  You're definitely a superstar!!!" mYkel - 21 Jun '04 Within you lies the power for good - Use it!


        Honoured as one of The Most Helpful Members of 2004

        Within you lies the power for good; Use it!

        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