Jump to content


BitBlt usage


1 reply to this topic

#1 Guest_Kite_*

  • Guests

Posted 24 December 2007 - 06:57 PM

Can you please tell me how to use BitBlt function to draw into Image from HBITMAP. I try to use below code and image always black, what is wrong? Or maybe you know how to draw into your image from HBITMAP without intermediate data

Gdiplus::Bitmap* pBitmap = Gdiplus::Bitmap::FromFile( fullName );
if ( !pBitmap )
return;

HBITMAP hbmp;
Gdiplus::Status status = pBitmap->GetHBITMAP( Color::Red, &hbmp );

int iWidth = pBitmap->GetWidth();
int iHeight = pBitmap->GetHeight();

HRESULT hr = m_image->Init->Image( iWidth, iHeight );
hr = m_image->Fill->ByColor( 0xff00ff ); //just for test

CComVariant var;
var = (long)hbmp;

//hr is S_OK, but image is black.
hr = m_image->View->BitBlt( 0, 0, iWidth, iHeight, 0, 0, ToImage, var );



#2 Alex Murovany

    Member

  • Moderators
  • PipPip
  • 26 posts

Posted 25 December 2007 - 11:26 AM

Hello,

Unfortunately we don't know methods to draw into VIMAS Image from HBITMAP without intermediate data. HBITMAP is a device-dependent storage format, so data should be converted to device-independent form before the the using.

Best regards.
Alex Murovany.
VIMAS Technologies, product manager.
www.vimas.com/ve_imm.htm




Reply to this topic



  


1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users