Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

HBITMAP conversion

Posted on 1997-05-13
4
Medium Priority
?
768 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
[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
  • 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
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…
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.
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…

688 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