Thread: Loading & displaying an image

  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, 04:17 AM
  2. Loading image from Resource
    By parad0x13 in forum C++ Programming
    Replies: 1
    Last Post: 03-15-2009, 10:36 PM
  3. Loading an image in from a resource file
    By starcatcher in forum C++ Programming
    Replies: 4
    Last Post: 04-15-2008, 06:44 AM
  4. Image class - loading image file
    By GaPe in forum Windows Programming
    Replies: 2
    Last Post: 07-11-2004, 01:35 PM
  5. Image Loading Troubles
    By frenchfry164 in forum C++ Programming
    Replies: 3
    Last Post: 11-02-2003, 01:07 PM