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 add an backrground image in a form?

how to add an backrground image in a form?

Scheduled Pinned Locked Moved C / C++ / MFC
tutorialquestion
4 Posts 4 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.
  • P Offline
    P Offline
    panthal
    wrote on last edited by
    #1

    hi, i'am trying to add an image as background of a form. but i don't know , how to add? if you know please tell me thanks panthal

    C D H 3 Replies Last reply
    0
    • P panthal

      hi, i'am trying to add an image as background of a form. but i don't know , how to add? if you know please tell me thanks panthal

      C Offline
      C Offline
      chandu004
      wrote on last edited by
      #2

      use picture control.

      1 Reply Last reply
      0
      • P panthal

        hi, i'am trying to add an image as background of a form. but i don't know , how to add? if you know please tell me thanks panthal

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

        panthal wrote:

        if you know please tell me

        See here.


        "Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman

        "To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne

        1 Reply Last reply
        0
        • P panthal

          hi, i'am trying to add an image as background of a form. but i don't know , how to add? if you know please tell me thanks panthal

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

          If you want to show image on the forum you can use of WM_ERASEBKGN with CImage class like this

          #include "AtlImage.h"

          CImage m_Image;
          m_Image.Load("c:\\123.jpg");

          BOOL CdddDlg::OnEraseBkgnd(CDC* pDC)
          {

          ppp.BitBlt(pDC->m_hDC,0,0);
          return TRUE;
          }

          This is a minumum code for show image on the forum. But if you want to use of a control to show an image you can use of Static control you must insert Static control of Toolbar on the forum and use of this code

          CImage m_Image;
          m_Image.Load("c:\\1234.jpg");
          m_Static.SetBitmap(m_Image.Detach());

          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