I am trying to write a class to wrap the functionality of a bitmap in my program.
One useful feature is to copy a bitmap from another bitmap descriptor. I'm a little stuck:
void operator=( MyBitmapType & bmp ) { HDC dcMem; HDC dcSource; if( m_hBitmap != bmp.Handle() ) { if( m_hBitmap ) this->DisposeOf();
This code is missing one thing: how can I get an HDC for the original bitmap if everything I have in the original bitmap is a descriptor (e.g. HBITMAP?)
You can see in the code above, I used "dcSource" in the BitBlt () call. But I don't know how to get this dcSource from the source raster descriptor (bmp.Handle () returns the descriptor of the original raster image)
c ++ windows bitmap atl gdi
jtsPimp
source share