Solved

HBITMAP conversion

Posted on 1997-05-13
4
763 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 25 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
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.
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

679 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