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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Adding Pictures

Adding Pictures

Scheduled Pinned Locked Moved C / C++ / MFC
c++graphicshelp
4 Posts 2 Posters 1 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.
  • G Offline
    G Offline
    Grimes
    wrote on last edited by
    #1

    Hello everybody I would appreciate it if I can get help adding a picture into my program. I'm using visual c++ 6. This must really be simple, I just need the picture on my main dialog, but the program should be able to run without having the bitmap with it. thanx...

    KOM UIT DAAAAA!!!

    H 1 Reply Last reply
    0
    • G Grimes

      Hello everybody I would appreciate it if I can get help adding a picture into my program. I'm using visual c++ 6. This must really be simple, I just need the picture on my main dialog, but the program should be able to run without having the bitmap with it. thanx...

      KOM UIT DAAAAA!!!

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

      You can import bmp file to resource and use of CBitmap::LoadBitmap for load use of WM_PAINT or WM_ERASEBKGNDfor draw it,but my suggestion is you reading your file from disk instead import it to your project because it increase size of your exe:)


      WhiteSky


      G 1 Reply Last reply
      0
      • H Hamid Taebi

        You can import bmp file to resource and use of CBitmap::LoadBitmap for load use of WM_PAINT or WM_ERASEBKGNDfor draw it,but my suggestion is you reading your file from disk instead import it to your project because it increase size of your exe:)


        WhiteSky


        G Offline
        G Offline
        Grimes
        wrote on last edited by
        #3

        How should i add the bitmap to the resources? The size of the exe isn't a issue in this case, thanx for the help....

        KOM UIT DAAAAA!!!

        H 1 Reply Last reply
        0
        • G Grimes

          How should i add the bitmap to the resources? The size of the exe isn't a issue in this case, thanx for the help....

          KOM UIT DAAAAA!!!

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

          Right click on resource window and select Add Resource and click import button and select your file and click open button now this file insert to resources now you can use from this code in your program CBitmap p; p.LoadBitmap(IDB_BITMAP1); and then on WM_PAINT try to draw it Resource Window->Add Resource->Import->Select File->click open -------------------- But if you have a picture on clipboard and you want to insert it to resource you can create a bitmap on resource and if Color file is True Color then select True Color on resource and then use of Shift+Insert now this picture paste on resource :)


          WhiteSky


          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