Solved

BMP

Posted on 1998-04-10
5
260 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
  • 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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Introduction This article is a continuation of the C/C++ Visual Studio Express debugger series. Part 1 provided a quick start guide in using the debugger. Part 2 focused on additional topics in breakpoints. As your assignments become a little more …
Keep your audience engaged and get the most out of your next presentation with these quick Prezi tips.
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.
It’s easy to embed any of your public Prezi presentations on your website or social network to share with others. Learn how simple it is in this tutorial.

746 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now