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. calculate the size of HBITMAP

calculate the size of HBITMAP

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

    How to calculate the memory size of HBITMAP after loading it.As the size of Bitmap depends upon the system settings(Pexels, color etc.) -- modified at 4:37 Tuesday 16th May, 2006

    H J S D 4 Replies Last reply
    0
    • A anilksingh

      How to calculate the memory size of HBITMAP after loading it.As the size of Bitmap depends upon the system settings(Pexels, color etc.) -- modified at 4:37 Tuesday 16th May, 2006

      H Offline
      H Offline
      Hamid Taebi
      wrote on last edited by
      #2

      Can you be more specific_**


      **_

      WhiteSky


      1 Reply Last reply
      0
      • A anilksingh

        How to calculate the memory size of HBITMAP after loading it.As the size of Bitmap depends upon the system settings(Pexels, color etc.) -- modified at 4:37 Tuesday 16th May, 2006

        J Offline
        J Offline
        Jitendra gangwar
        wrote on last edited by
        #3

        Hi, Use GetObject API The GetObject function retrieves information for the specified graphics object. int GetObject( HGDIOBJ hgdiobj, // handle to graphics object int cbBuffer, // size of buffer for object information LPVOID lpvObject // buffer for object information );

        1 Reply Last reply
        0
        • A anilksingh

          How to calculate the memory size of HBITMAP after loading it.As the size of Bitmap depends upon the system settings(Pexels, color etc.) -- modified at 4:37 Tuesday 16th May, 2006

          S Offline
          S Offline
          Sarath C
          wrote on last edited by
          #4

          try this one. CBitmap bitmap; bitmap.LoadBitmap(IDB_BITMAP1); BITMAP bm; bitmap.GetBitmap( &bm ); bmWidth = bm.bmWidth; bmHeight = bm.bmHeight; this will work. -Sarath

          1 Reply Last reply
          0
          • A anilksingh

            How to calculate the memory size of HBITMAP after loading it.As the size of Bitmap depends upon the system settings(Pexels, color etc.) -- modified at 4:37 Tuesday 16th May, 2006

            D Offline
            D Offline
            David Crow
            wrote on last edited by
            #5

            Use:

            HBITMAP hBitmap = LoadBitmap(...);
            BITMAP bmp;
            GetObject(hBitmap, sizeof(bmp), &bmp);
            int nWidth = bmp.bmWidth;
            int nHeight = bmp.bmHeight;


            "The largest fire starts but with the smallest spark." - David Crow

            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