Professional UI Solutions
Site Map   /  Register
 
 

Forum

Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Prof-UIS General Discussion » CExtBitmap -> CBitmap Collapse All
Subject Author Date
Devin Kim Jul 30, 2008 - 6:06 AM

I want to copy the bitmap data from the CExtBitmap to the CBitmap.


How can I do this??

Devin Kim Jul 31, 2008 - 8:02 PM

Thank you for your reply.


But I want to copy the image data without creating. (Already the CExtBitmap class has the image data.)


Could you tell me how to get the HBITMAP handle of the CExtBitmap class without creating again. :)

Technical Support Jul 31, 2008 - 1:15 PM

Please use the following code;

CExtBitmap bmpExt;
      . . .
HBITMAP hBmpTemporarily = bmpExt.CreateBitmap();
      if( hBmpTemporarily == NULL )
            return;
CBitmap & bmpMFC = . . .
      if( bmpMFC.GetSafeHandle() != NULL )
            bmpMFC.DeleteObject();
      bmpMFC.Attach( hBmpTemporarily );


Devin Kim Jul 31, 2008 - 8:04 PM

Thank you for your reply.


But I want to copy the image data without creating. (Already the CExtBitmap class has the image data.)


Could you tell me how to get the HBITMAP handle of the CExtBitmap class without creating again. :)

Technical Support Aug 1, 2008 - 12:38 PM

The CBitmap class in MFC is designed as a wrapper for HBITMAP GDI handles. The CExtBitmap class in Prof-UIS ishas little to do with CBitmap and it written form scratch which contains bitmap data internally without allocating any handles. There are a lot of often required features in the CExtBitmap class: loading/saving from streams and file system, alpha-channel based painting on any Windows OS starting from Windows 95/NT4, direct pixel data access, various smooth resizing methods, various of bitmap effects. The CExtBitmap class is absolutely not related to GDI subsystem provided with Windows. So, you should use the code we will provide you in our previous answer. You can alternatively switch to CExtBitmap objects without CBitmap objects.