home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c082_122 / 2.ddi / ACLOCK.ZIP / BITMAP.H < prev    next >
Encoding:
C/C++ Source or Header  |  1992-06-10  |  1.0 KB  |  41 lines

  1. // ObjectWindows - (C) Copyright 1992 by Borland International
  2.  
  3. #ifndef __BITMAP_H
  4. #define __BITMAP_H
  5.  
  6. // Interface to simple library of classes to use for Windows GDI.
  7.  
  8. class _EXPORT Bitmap
  9. {
  10.     private:
  11.         HANDLE hBitmap;
  12.         int GetBitmap( BITMAP FAR * lpbm )
  13.         {
  14.             return GetObject( hBitmap, sizeof( BITMAP ), (LPSTR) lpbm );
  15.         }
  16.     public:
  17.     Bitmap( HINSTANCE hInstance, char FAR * lpszBitmapName )
  18.         {
  19.             hBitmap = LoadBitmap( hInstance, lpszBitmapName );
  20.         }
  21.         ~Bitmap( void )
  22.         {
  23.             DeleteObject( hBitmap );
  24.         }
  25.         void FAR Display( HDC hDC, short xStart, short yStart );
  26.         // Get the size of the bitmap in logical coordinates.
  27.         POINT GetSize( HDC hDC )
  28.         {
  29.             BITMAP bm;
  30.             POINT ptSize;
  31.  
  32.             GetBitmap( &bm );
  33.             ptSize.x = bm.bmWidth;
  34.             ptSize.y = bm.bmHeight;
  35.             DPtoLP( hDC, &ptSize, 1 );
  36.             return ptSize;
  37.         }
  38. };
  39.  
  40. #endif  // __BITMAP_H
  41.