• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 772
  • Last Modified:

HBITMAP conversion

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
yakky
Asked:
yakky
  • 2
1 Solution
 
EHaimerlCommented:
I think CBitmap::FromHandle ( HBITMAP hBitmap) will do what you want.Hop this helps youEdgar
0
 
yakkyAuthor Commented:
Edited text of question
0
 
yakkyAuthor Commented:
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
 
RONSLOWCommented:
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now