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 display an image loaded from a file on a dialog ?

How to display an image loaded from a file on a dialog ?

Scheduled Pinned Locked Moved C / C++ / MFC
graphicstutorialquestion
2 Posts 2 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.
  • Q Offline
    Q Offline
    Qadddd
    wrote on last edited by
    #1

    Hello, what I would like to do is to display a logo (jpg or bmp) in a static control on a dialog. This logo will always have the same size and will be stored in a file logo.jpg or logo.bmp located on user station, it will be loaded in the dialog at initialization time (no bitmap stored in the ressources). This will allow me to be more flexible and to customize the dialog for each user station. I will just give each user a different file logo.jpg or logo.bmp. Thanks in advance for any information Regards DD

    A 1 Reply Last reply
    0
    • Q Qadddd

      Hello, what I would like to do is to display a logo (jpg or bmp) in a static control on a dialog. This logo will always have the same size and will be stored in a file logo.jpg or logo.bmp located on user station, it will be loaded in the dialog at initialization time (no bitmap stored in the ressources). This will allow me to be more flexible and to customize the dialog for each user station. I will just give each user a different file logo.jpg or logo.bmp. Thanks in advance for any information Regards DD

      A Offline
      A Offline
      algol
      wrote on last edited by
      #2

      CStatic::SetBitmap() (or send an STM_SETIMAGE message) and LoadImage with LR_LOADFROMFILE parameter (for BMPs). JPGs you can load with OleLoadPicturePath() and obtain hBmp through IPicture::get_Handle. You can also use IPicture::Render() to draw loaded image.

      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