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. LoadImage (newbie)

LoadImage (newbie)

Scheduled Pinned Locked Moved C / C++ / MFC
questiondata-structures
3 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.
  • D Offline
    D Offline
    dave2k
    wrote on last edited by
    #1

    I have the structrue [code] struct Card{ char szFileName[MAX_PATH]; BYTE *lpImage; Cards CardType; };[/code] an array of this structure will store 52 images representing different cards. at the begining of my program i need to load all the images, and this is my effort for loading an image: [code] HBITMAP hbm = LoadImage(0, (LPCTSTR)"img.bmp", IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE | LR_DEFAULTSIZE);[/code] hbm is of type HBITMAP, so how can i get it into the structure where theimage type is of BYTE? cheers

    T 1 Reply Last reply
    0
    • D dave2k

      I have the structrue [code] struct Card{ char szFileName[MAX_PATH]; BYTE *lpImage; Cards CardType; };[/code] an array of this structure will store 52 images representing different cards. at the begining of my program i need to load all the images, and this is my effort for loading an image: [code] HBITMAP hbm = LoadImage(0, (LPCTSTR)"img.bmp", IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE | LR_DEFAULTSIZE);[/code] hbm is of type HBITMAP, so how can i get it into the structure where theimage type is of BYTE? cheers

      T Offline
      T Offline
      toxcct
      wrote on last edited by
      #2

      in your structure, why don't you just replace BYTE* by HBITMAP* ?


      TOXCCT >>> GEII power
      [toxcct][VisualCalc]

      D 1 Reply Last reply
      0
      • T toxcct

        in your structure, why don't you just replace BYTE* by HBITMAP* ?


        TOXCCT >>> GEII power
        [toxcct][VisualCalc]

        D Offline
        D Offline
        dave2k
        wrote on last edited by
        #3

        someone created that structure for me. later on, each image will be passed into memcmp (memory compare), along with a gui bitmap, to see whether the bitmap exists. will this still work with HBITMAP?

        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