Display BMP using C in VC++ environment

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • saranjegan
    New Member
    • Feb 2007
    • 50

    Display BMP using C in VC++ environment

    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
  • Banfa
    Recognized Expert Expert
    • Feb 2006
    • 9067

    #2
    1. Create a Screen compatible bitmap the right size to hold you BMP (CreateCompatib leBitmap)
    2. Create a screen compatible DC (device context) (CreateCompatib leDC)
    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.

    Comment

    • saranjegan
      New Member
      • Feb 2007
      • 50

      #3
      Originally posted by Banfa
      1. Create a Screen compatible bitmap the right size to hold you BMP (CreateCompatib leBitmap)
      2. Create a screen compatible DC (device context) (CreateCompatib leDC)
      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...bu t am new to vc++ environment so i cant catch with your points.....give a valuable message..so it sounds me better understanding.. ..

      Comment

      • Banfa
        Recognized Expert Expert
        • Feb 2006
        • 9067

        #4
        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.

        Comment

        Working...