[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

BMP

Posted on 1998-04-10
5
Medium Priority
?
268 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 300 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

When writing generic code, using template meta-programming techniques, it is sometimes useful to know if a type is convertible to another type. A good example of when this might be is if you are writing diagnostic instrumentation for code to generat…
Unlike C#, C++ doesn't have native support for sealing classes (so they cannot be sub-classed). At the cost of a virtual base class pointer it is possible to implement a pseudo sealing mechanism The trick is to virtually inherit from a base class…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.
Suggested Courses

656 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