Loading & displaying an image

This is a discussion on Loading & displaying an image within the Windows Programming forums, part of the Platform Specific Boards category; Popular topic but can't get it to work... I used two functions... LoadImage & DrawState My code Code: WM_CREATE { ...

  1. #1
    Registered User
    Join Date
    Apr 2008
    Posts
    610

    Loading & displaying an image

    Popular topic but can't get it to work... I used two functions... LoadImage & DrawState

    My code
    Code:
    WM_CREATE
    {
    hBmp = LoadImage(GetModuleHandle(NULL), MAKEINTRESOURCE(IDB_BITMAP1), 
    IMAGE_BMP, 0, 0, LR_DEFAULTSIZE);
    }
    ...............
    
    WM_PAINT
    {
    hdc = BeginPaint(hwnd, &pntS);
    DrawState(hdc, NULL, NULL, (LPARAM)hBmp, 0, xPos, 
    yPos, 0, 0, DST_BITMAP | DSS_NORMAL);	
    EndPaint(hwnd, &pntS);		
    }
    Nothing shows on my window.... Any suggestions? My image is a resource file

  2. #2
    Registered User
    Join Date
    Apr 2008
    Posts
    610
    Quote Originally Posted by csonx_p View Post
    Popular topic but can't get it to work... I used two functions... LoadImage & DrawState

    My code
    Code:
    WM_CREATE
    {
    hBmp = LoadImage(GetModuleHandle(NULL), MAKEINTRESOURCE(IDB_BITMAP1), 
    IMAGE_BMP, 0, 0, LR_DEFAULTSIZE);
    }
    ...............
    
    WM_PAINT
    {
    hdc = BeginPaint(hwnd, &pntS);
    DrawState(hdc, NULL, NULL, (LPARAM)hBmp, 0, xPos, 
    yPos, 0, 0, DST_BITMAP | DSS_NORMAL);	
    EndPaint(hwnd, &pntS);		
    }
    Nothing shows on my window.... Any suggestions? My image is a resource file
    My Bad! IMAGE_BMP should be IMAGE_BITMAP...

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Problem reading tiff image files?
    By compz in forum C++ Programming
    Replies: 9
    Last Post: 10-30-2009, 05:17 AM
  2. Loading image from Resource
    By parad0x13 in forum C++ Programming
    Replies: 1
    Last Post: 03-15-2009, 11:36 PM
  3. Loading an image in from a resource file
    By starcatcher in forum C++ Programming
    Replies: 4
    Last Post: 04-15-2008, 07:44 AM
  4. Image class - loading image file
    By GaPe in forum Windows Programming
    Replies: 2
    Last Post: 07-11-2004, 02:35 PM
  5. Image Loading Troubles
    By frenchfry164 in forum C++ Programming
    Replies: 3
    Last Post: 11-02-2003, 01:07 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21