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 use GDI+ function Bitmap( Class type, String resource )

How to use GDI+ function Bitmap( Class type, String resource )

Scheduled Pinned Locked Moved C / C++ / MFC
graphicswinformshelptutorialquestion
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.
  • C Offline
    C Offline
    Chen XuNuo
    wrote on last edited by
    #1

    Recently I begin to program with GDI+,and I want to contruct a Bitmap object with the function Bitmap( Class type, String resource ),because my bitmap is in resource(is it right to use the function?).But I don't know how to set the parameters "type" and "resource"~ Help~:confused:

    S M 2 Replies Last reply
    0
    • C Chen XuNuo

      Recently I begin to program with GDI+,and I want to contruct a Bitmap object with the function Bitmap( Class type, String resource ),because my bitmap is in resource(is it right to use the function?).But I don't know how to set the parameters "type" and "resource"~ Help~:confused:

      S Offline
      S Offline
      Sameerkumar Namdeo
      wrote on last edited by
      #2

      Construct CBitmap object to first load the bitmap from resource. Then use that object to get the handle of bitmap. Finally ,from that handle you can construct a GDI+ Bitmap object by using Bitmap::FromHandle() function.

      1 Reply Last reply
      0
      • C Chen XuNuo

        Recently I begin to program with GDI+,and I want to contruct a Bitmap object with the function Bitmap( Class type, String resource ),because my bitmap is in resource(is it right to use the function?).But I don't know how to set the parameters "type" and "resource"~ Help~:confused:

        M Offline
        M Offline
        Mark Salsbery
        wrote on last edited by
        #3

        Or you can use this constructor: Bitmap(HINSTANCE, const WCHAR *) e.g. Gdiplus::Bitmap bitmap(hInst, MAKEINTRESOURCEW(IDB_BITMAP)); Mark -- modified at 0:02 Friday 22nd June, 2007 Fixed Typo

        "Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder

        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