Solved

HBITMAP conversion

Posted on 1997-05-13
4
757 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
Comment Utility
I think CBitmap::FromHandle ( HBITMAP hBitmap) will do what you want.Hop this helps youEdgar
0
 

Author Comment

by:yakky
Comment Utility
Edited text of question
0
 

Author Comment

by:yakky
Comment Utility
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
Comment Utility
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

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
deburging in oracle form 12 76
countEvens challenge 2 57
no14 challenge 14 56
fix34  challenge 9 96
This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
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.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

743 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

14 Experts available now in Live!

Get 1:1 Help Now