home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 1998 May / Pcwk5b98.iso / Borland / Cplus45 / BC45 / GDIDEMO.PAK / BITBLT.H < prev    next >
C/C++ Source or Header  |  1995-08-29  |  1KB  |  49 lines

  1. //----------------------------------------------------------------------------
  2. // ObjectWindows - (C) Copyright 1991, 1993 by Borland International
  3. //   BitBlt demo window header
  4. //----------------------------------------------------------------------------
  5. #ifndef __BITBLT_H
  6. #define __BITBLT_H
  7.  
  8. #include "demobase.h"
  9. class _EXPCLASS TBitmap;
  10.  
  11. // BitBlt demo constants 
  12. const int BackgroundId       = 100; // Bitmap ID of background bitmap 
  13. const int ShipId             = 101; // Bitmap ID of Ship Bitmap 
  14. const int MonoShipId         = 102; // Bitmap ID of Monochrome mask of ship 
  15. const int BitmapSize         = 72;  // Size of Ship bitmap 
  16.  
  17. class TBitBltWindow : public TBaseDemoWindow {
  18.   public:
  19.     TBitBltWindow();
  20.     ~TBitBltWindow();
  21.  
  22.   protected:
  23.     void    SetupWindow();
  24.     void    TimerTick();
  25.     void    EvSize(UINT SizeType, TSize& Size);
  26.     void    Paint(TDC& dc, BOOL, TRect&);
  27.  
  28.   private:
  29.     TPoint      WindowSize;
  30.     TBitmap*    ScratchBitmap;
  31.     TBitmap*    StretchedBkgnd;
  32.     TBitmap*    Background;
  33.     TBitmap*    MonoShip;
  34.     TBitmap*    Ship;
  35.     int         OldX;
  36.     int         OldY;
  37.     int         Delta;
  38.     int         X;
  39.     int         Y;
  40.     int         CurClick;
  41.  
  42.     void        CalculateNewXY();
  43.  
  44.   DECLARE_RESPONSE_TABLE(TBitBltWindow);
  45.   DECLARE_CASTABLE;
  46. };
  47.  
  48. #endif
  49.