Solved

BMP

Posted on 1998-04-10
5
266 Views
Last Modified: 2013-11-19
I'm currently programming under windows in c++ 4.5 by borland, my problem is that i can't get aany kind of BMP to display, and was wondering if you would have any ideas on how to write the code to display a BMP of any kind.
0
Comment
Question by:Megabyte
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
5 Comments
 
LVL 22

Accepted Solution

by:
nietod earned 100 total points
ID: 1184188
answer coming.
0
 
LVL 22

Expert Comment

by:nietod
ID: 1184189
This is a synopsis.  If you have questions or need more details, ask.

1.  You probably already have a DC for the screen, or window that you want to draw to (if not let me know) but you need to create a compatible memory DC, using CreateCompatibleDC().
2,  You need to load the bitmap with LoadBitmap() or LoadImage().
3.  Select the new bitmap into the memory DC with SelectObject().(saving the previous bitmap handle so that it may be selected in when you are done.
4.  Copy the image from the memory DC to the screen DC using BitBlt() or StretchBlt().
5.  You are now done, but you have to clean up.
6.   Restore the saved bitmap to the memory DC with SelectObject().
7.  Destroy the memory DC with DeleteDC().





0
 
LVL 22

Expert Comment

by:nietod
ID: 1184190
Note that that technique relies on the fact that LoadBitmap() or LoadImage() return device dependant bitmaps (DDB) for the display.  If you need to drtaw on other devices, like a printer, you will need to use device independant bitmaps (DIB).
0
 

Author Comment

by:Megabyte
ID: 1184191
A thousand thank you's if any of it works, great job E.E
0
 
LVL 22

Expert Comment

by:nietod
ID: 1184192
If any of it works?

You probably should get it to work BEFORE accepting an answer.  That way you can get more help if you need it.  However, if you need more help, post a comment here and I can help you.
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article will show you some of the more useful Standard Template Library (STL) algorithms through the use of working examples.  You will learn about how these algorithms fit into the STL architecture, how they work with STL containers, and why t…
Container Orchestration platforms empower organizations to scale their apps at an exceptional rate. This is the reason numerous innovation-driven companies are moving apps to an appropriated datacenter wide platform that empowers them to scale at a …
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question