BOOL CDIB::Create( int width, int height, int bits ) { /* Free existing image */ DestroyDIB(); BITMAPINFOHEADER bmInfo; memset( &bmInfo, 0, sizeof( BITMAPINFOHEADER ) ); bmInfo.biSize = sizeof( BITMAPINFOHEADER ); bmInfo.biWidth = width; bmInfo.biHeight = height; bmInfo.biPlanes = 1; bmInfo.biBitCount = bits; bmInfo.biCompression = BI_RGB; return Create( bmInfo ); }
void InvalidateMapImage() { MySetRect(&mapImageRect,0,0,0,0); #ifdef MAC if (model -> mapImage) // test line/body STH { KillGWorld (model -> mapImage); model -> mapImage = nil; } #else if (model -> mapImage) // test line/body STH { DestroyDIB(model -> mapImage); model -> mapImage = nil; } #endif }
zBOOL ZDib2::Create( int lWidth, int lHeight, int uBits ) { // Free existing image. DestroyDIB( ); // ASSERT( lBits == 24 || lBits == 8 ); BITMAPINFOHEADER bmInfo; zmemset( &bmInfo, 0, sizeof( BITMAPINFOHEADER ) ); bmInfo.biSize = sizeof( BITMAPINFOHEADER ); bmInfo.biWidth = lWidth; bmInfo.biHeight = lHeight; bmInfo.biPlanes = 1; bmInfo.biBitCount = uBits; bmInfo.biCompression = BI_RGB; return( Create( bmInfo ) ); }
CDIB::~CDIB() { DestroyDIB(); }
ZDib2::~ZDib2( ) { DestroyDIB( ); }