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. load bitmap..............

load bitmap..............

Scheduled Pinned Locked Moved C / C++ / MFC
graphicshelpquestionlearning
8 Posts 5 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
    ani_ikram
    wrote on last edited by
    #1

    how can i load image from c: directory and then making a resouce ID for that image using coding as bmp.loadbitmap require resource ID of bitmap. plz help..

    P P 2 Replies Last reply
    0
    • A ani_ikram

      how can i load image from c: directory and then making a resouce ID for that image using coding as bmp.loadbitmap require resource ID of bitmap. plz help..

      P Offline
      P Offline
      Perspx
      wrote on last edited by
      #2

      If you want to do drawing with your bitmap, use the LoadImage() function, with hinst as NULL, lpszName as the path to your bitmap, uType as IMAGE_BITMAP and fuLoad as LR_LOADFROMFILE. This will then return a HANDLE which can be used in GDI drawing functions. Regards, --Perspx

      "I've got my kids brainwashed: You don't use Google, and you don't use an iPod." - Steve Ballmer
      "Some people have told me they don't think a fat penguin really embodies the grace of Linux, which just tells me they have never seen an angry penguin charging at them in excess of 100mph." - Linus Torvalds

      A 1 Reply Last reply
      0
      • A ani_ikram

        how can i load image from c: directory and then making a resouce ID for that image using coding as bmp.loadbitmap require resource ID of bitmap. plz help..

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

        use LoadImage() with the LR_LOADFROMFILE flag.

        A 1 Reply Last reply
        0
        • P Perspx

          If you want to do drawing with your bitmap, use the LoadImage() function, with hinst as NULL, lpszName as the path to your bitmap, uType as IMAGE_BITMAP and fuLoad as LR_LOADFROMFILE. This will then return a HANDLE which can be used in GDI drawing functions. Regards, --Perspx

          "I've got my kids brainwashed: You don't use Google, and you don't use an iPod." - Steve Ballmer
          "Some people have told me they don't think a fat penguin really embodies the grace of Linux, which just tells me they have never seen an angry penguin charging at them in excess of 100mph." - Linus Torvalds

          A Offline
          A Offline
          ani_ikram
          wrote on last edited by
          #4

          i need resource id in some method is there anyway to create resource id while loading image .

          P 1 Reply Last reply
          0
          • P PJ Arends

            use LoadImage() with the LR_LOADFROMFILE flag.

            A Offline
            A Offline
            ani_ikram
            wrote on last edited by
            #5

            using HBITMAP hbitmap = (HBITMAP)LoadImage(NULL,"D:\\a.bmp",IMAGE_BITMAP,0,0,LR_LOADFROMFILE); but how can make resource ID of this image.

            K M 2 Replies Last reply
            0
            • A ani_ikram

              using HBITMAP hbitmap = (HBITMAP)LoadImage(NULL,"D:\\a.bmp",IMAGE_BITMAP,0,0,LR_LOADFROMFILE); but how can make resource ID of this image.

              K Offline
              K Offline
              KarstenK
              wrote on last edited by
              #6

              If you have loaded the bitmap once you havent to load it anymore. :doh: You can make copies or use it. Read the CBitmap class in MFC. :zzz:

              Greetings from Germany

              1 Reply Last reply
              0
              • A ani_ikram

                using HBITMAP hbitmap = (HBITMAP)LoadImage(NULL,"D:\\a.bmp",IMAGE_BITMAP,0,0,LR_LOADFROMFILE); but how can make resource ID of this image.

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

                ani_ikram wrote:

                how can make resource ID of this image.

                You can't. Only resources have resource IDs!

                Mark Salsbery Microsoft MVP - Visual C++ :java:

                1 Reply Last reply
                0
                • A ani_ikram

                  i need resource id in some method is there anyway to create resource id while loading image .

                  P Offline
                  P Offline
                  Perspx
                  wrote on last edited by
                  #8

                  As Mark said, resource ID's are for resources only. What is it that you are trying to achieve? Regards, --Perspx

                  "I've got my kids brainwashed: You don't use Google, and you don't use an iPod." - Steve Ballmer
                  "Some people have told me they don't think a fat penguin really embodies the grace of Linux, which just tells me they have never seen an angry penguin charging at them in excess of 100mph." - Linus Torvalds

                  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