Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

HBITMAP conversion

Posted on 1997-05-13
4
Medium Priority
?
769 Views
Last Modified: 2013-11-20
Im a bit stuck, I need to convert a HBITMAP, bitmap into a CBitmap bitmap, can anyone tell me how to do this.

Ok CBitmap::FromHandle(HBITMAP) succeeds, however it only returns a temporary object, When I try to display it nothing happens.

Thanks in advance
Ian Robertson
0
Comment
Question by:yakky
  • 2
4 Comments
 

Expert Comment

by:EHaimerl
ID: 1301510
I think CBitmap::FromHandle ( HBITMAP hBitmap) will do what you want.Hop this helps youEdgar
0
 

Author Comment

by:yakky
ID: 1301511
Edited text of question
0
 

Author Comment

by:yakky
ID: 1301512
Ive already tried ::FromHandle, but it only returns a temporary object. When I try to display the  object nothing happens.
Any suggestions gratefully received

Ian
0
 
LVL 10

Accepted Solution

by:
RONSLOW earned 50 total points
ID: 1301513
Use the Attach method to permanently attach a HBITMAP handle to a CBitmap object.

You may need to detach when winished unless you want the HBITMAP bitmap to be deleted when the CBitmap object is destructed.

0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

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

Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
Ready to get certified? Check out some courses that help you prepare for third-party exams.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Loops Section Overview

972 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