00001 /* 00002 /-------------------------------------------------------------------- 00003 | 00004 | $Id: dibgrit_8h-source.html,v 1.2 2004/09/15 15:26:24 uzadow Exp $ 00005 | Bitmap Graphic item class 00006 | 00007 | A bitmap on a canvas. 00008 | 00009 | Copyright (c) 1996-2002 Ulrich von Zadow 00010 | 00011 \-------------------------------------------------------------------- 00012 */ 00013 00014 #ifndef INCL_DIBGRIT 00015 #define INCL_DIBGRIT 00016 00017 #include "gritem.h" 00018 00019 class PLBmp; 00020 00021 class CDIBGrItem : public CGrItem 00022 { 00023 00024 DECLARE_DYNAMIC (CDIBGrItem); 00025 00026 public: 00027 CDIBGrItem 00028 ( int x, // Position on the canvas 00029 int y, 00030 int w, // Width 00031 int h, // Height 00032 int z, // Position in z-Order 00033 BYTE Opacity, // Opacity of the object. 255 is completely 00034 // opaque, 0 is completely transparent. 00035 PLBmp * pBmp // The bitmap. 00036 ); 00037 00038 ~CDIBGrItem 00039 (); 00040 00041 virtual void Draw 00042 ( PLBmp * pCanvas, 00043 CRect * pUpdateRect 00044 ); 00045 // Responsible for drawing the object on the canvas. 00046 00047 PLBmp * GetBmp 00048 () 00049 { 00050 return m_pBmp; 00051 } 00052 00053 private: 00054 void drawClippedNoScale 00055 ( PLBmp * pCanvas, 00056 CRect * pRect 00057 ); 00058 // Draws the object. pRect must have been clipped already. 00059 // Assumes that no scaling is nessesary. 00060 00061 void drawAlphaLine 00062 ( BYTE * pDest, 00063 BYTE * pSrc, 00064 CRect * pRect 00065 ); 00066 00067 void drawFadeLine 00068 ( BYTE * pDest, 00069 BYTE * pSrc, 00070 CRect * pRect 00071 ); 00072 00073 void drawClipped 00074 ( PLBmp * pCanvas, 00075 CRect * pRect 00076 ); 00077 00078 void drawClippedNoAlpha 00079 ( PLBmp * pCanvas, 00080 CRect * pRect 00081 ); 00082 00083 // Member variables. 00084 00085 PLBmp * m_pBmp; 00086 }; 00087 00088 #endif 00089 /* 00090 /-------------------------------------------------------------------- 00091 | 00092 | $Log: dibgrit_8h-source.html,v $ 00092 | Revision 1.2 2004/09/15 15:26:24 uzadow 00092 | Linux compatibility changes, doc update. 00092 | 00093 | Revision 1.6 2002/02/24 13:00:57 uzadow 00094 | Documentation update; removed buggy PLFilterRotate. 00095 | 00096 | Revision 1.5 2001/09/16 19:03:23 uzadow 00097 | Added global name prefix PL, changed most filenames. 00098 | 00099 | Revision 1.4 2000/08/13 12:11:44 Administrator 00100 | Added experimental DirectDraw-Support 00101 | 00102 | Revision 1.3 2000/01/16 20:43:19 anonymous 00103 | Removed MFC dependencies 00104 | 00105 | 00106 \-------------------------------------------------------------------- 00107 */