By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,820 Members | 1,142 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,820 IT Pros & Developers. It's quick & easy.

Display BMP using C in VC++ environment

saranjegan
P: 51
hi, this is the task

displaying a bmp image in VC++ environment using C

i have finished reading the header information but i don know how to display the image using the details

let me know your valuable suggestion
Feb 22 '07 #1
Share this Question
Share on Google+
3 Replies


Banfa
Expert Mod 5K+
P: 8,916
  1. Create a Screen compatible bitmap the right size to hold you BMP (CreateCompatibleBitmap)
  2. Create a screen compatible DC (device context) (CreateCompatibleDC)
  3. Select the bitmap created in 1 into the device context (SelectObject)
  4. Load the bitmap created in 1 with the data from your bitmap file (CreateDIBitmap) or from a resource in you executable (LoadBitmap)
  5. You can then copy the bitmap between the DC created in 2 and a screen DC.
Feb 22 '07 #2

saranjegan
P: 51
  1. Create a Screen compatible bitmap the right size to hold you BMP (CreateCompatibleBitmap)
  2. Create a screen compatible DC (device context) (CreateCompatibleDC)
  3. Select the bitmap created in 1 into the device context (SelectObject)
  4. Load the bitmap created in 1 with the data from your bitmap file (CreateDIBitmap) or from a resource in you executable (LoadBitmap)
  5. You can then copy the bitmap between the DC created in 2 and a screen DC.
thanks for your suggestion...but am new to vc++ environment so i cant catch with your points.....give a valuable message..so it sounds me better understanding....
Feb 23 '07 #3

Banfa
Expert Mod 5K+
P: 8,916
The names in brakets are function names which you can look up in you help files or Windows reference or on the MSDN website.

Copying from one dc to another is achieved using the function BitBlt.
Feb 23 '07 #4

Post your reply

Sign in to post your reply or Sign up for a free account.