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. bitmaps

bitmaps

Scheduled Pinned Locked Moved C / C++ / MFC
c++graphicstutoriallearning
4 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.
  • _ Offline
    _ Offline
    _tasleem
    wrote on last edited by
    #1

    hi i want to display the bitmap on the picture box in visual c++.code i had used is below if the loadbitmap the id of bitmap present in the resource is passed it loads and displays but if the id is not in the resource then it does not displays the bitmap. bitmap=LoadBitmap(NULL,MAKEINTRESOURCE("C:\\ff.bmp")); if(bitmap==NULL) //it displays the fail MessageBox("fail "); m_pic.SetBitmap(bitmap); i want to display the image whose id is not present in the resource. how to do that. ddd

    M D 3 Replies Last reply
    0
    • _ _tasleem

      hi i want to display the bitmap on the picture box in visual c++.code i had used is below if the loadbitmap the id of bitmap present in the resource is passed it loads and displays but if the id is not in the resource then it does not displays the bitmap. bitmap=LoadBitmap(NULL,MAKEINTRESOURCE("C:\\ff.bmp")); if(bitmap==NULL) //it displays the fail MessageBox("fail "); m_pic.SetBitmap(bitmap); i want to display the image whose id is not present in the resource. how to do that. ddd

      M Offline
      M Offline
      M Mehrdad M
      wrote on last edited by
      #2

      if youwant show a bimap file , you can use CImage Class.

      1 Reply Last reply
      0
      • _ _tasleem

        hi i want to display the bitmap on the picture box in visual c++.code i had used is below if the loadbitmap the id of bitmap present in the resource is passed it loads and displays but if the id is not in the resource then it does not displays the bitmap. bitmap=LoadBitmap(NULL,MAKEINTRESOURCE("C:\\ff.bmp")); if(bitmap==NULL) //it displays the fail MessageBox("fail "); m_pic.SetBitmap(bitmap); i want to display the image whose id is not present in the resource. how to do that. ddd

        M Offline
        M Offline
        M Mehrdad M
        wrote on last edited by
        #3

        if you want show a bitmap file ,like c:\\ff.bmp, you can use CImage MFC Class(VC++7 ).

        1 Reply Last reply
        0
        • _ _tasleem

          hi i want to display the bitmap on the picture box in visual c++.code i had used is below if the loadbitmap the id of bitmap present in the resource is passed it loads and displays but if the id is not in the resource then it does not displays the bitmap. bitmap=LoadBitmap(NULL,MAKEINTRESOURCE("C:\\ff.bmp")); if(bitmap==NULL) //it displays the fail MessageBox("fail "); m_pic.SetBitmap(bitmap); i want to display the image whose id is not present in the resource. how to do that. ddd

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

          tasleem143 wrote: bitmap=LoadBitmap(NULL,MAKEINTRESOURCE("C:\\ff.bmp")); What's this? MAKEINTRESOURCE() does not take a string for its argument. In the project's resource.h file:

          #define IDC_MYBITMAP 1234 // or some other appropriate value

          In the project's .rc file:

          IDC_MYBITMAP BITMAP DISCARDABLE "c:\\ff.bmp"

          In the .cpp file:

          HBITMAP hBitmap = LoadBitmap(NULL, MAKEINTRESOURCE(IDC_MYBITMAP));
          if (NULL == hBitmap)
          AfxMessageBox("LoadBitmap() failed.");
          else
          m_pic.SetBitmap(hBitmap);


          "One must learn from the bite of the fire to leave it alone." - Native American Proverb

          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