DCUtils.h
上传用户:tonybian
上传日期:2007-01-18
资源大小:328k
文件大小:2k
源码类别:

图形图象

开发平台:

WINDOWS

  1. // dcutils.h: interface for the CDCUtils class.
  2. //
  3. //////////////////////////////////////////////////////////////////////
  4. #if !defined(AFX_DCUTILS_H__E2D3C5A3_8841_4FAB_80F2_940FF382C7B2__INCLUDED_)
  5. #define AFX_DCUTILS_H__E2D3C5A3_8841_4FAB_80F2_940FF382C7B2__INCLUDED_
  6. #if _MSC_VER > 1000
  7. #pragma once
  8. #endif // _MSC_VER > 1000
  9. class CDCUtils  
  10. {
  11. public:
  12. //
  13. // Helper Functions and variables:
  14. //
  15.     static CBitmap m_bmpDesktop;
  16. static double DegreeToRadian( double degree );
  17. static CDC* GetDCFromBmp( CDC *pDC, CBitmap& bmpSource );
  18. static CDC* GetDCFromBmp( CDC *pDC, UINT uResourceID, CSize* pSize=NULL );
  19. static CDC* CreateBitmappedDC( CDC * pDC, CBitmap* pBitmap = NULL, CSize* pSize=NULL, BITMAP* pBmp=NULL );
  20. //
  21. // "Worker Functions"
  22. //
  23. static void GetDesktopImage( CBitmap* pBitmap = NULL );
  24. static void PaintRect( CDC* pDC, int x, int y, int w, int h, COLORREF color);
  25. static void DrawText( CDC* pDC, CPoint Location, CString strText, CString strFontName, int nFontWidth, int nFontHeight, COLORREF crFontColour, long FontWeight=FW_BOLD);
  26. static void PaintHatch( CDC* pDC, CRect area, COLORREF crFG=RGB(0,70,30), COLORREF crBG=NULL);
  27. static void Draw3DRect( CDC* pDC, CRect& area, bool bDeflate=false, COLORREF crFill=-1, COLORREF crHilite=-1, COLORREF crLoLite=-1);
  28. static void LinearGradient( CDC *pDC, CRect &rect, COLORREF clrFrom, COLORREF clrTo, BOOL bHorizontal = TRUE);
  29. static void RadialGradient( CDC *pDC, CRect &rect, COLORREF clrFrom, COLORREF clrTo );
  30. static void DrawElectricity( CDC *pDC, CRect rect );
  31. static void MakeGlass( CDC *pDC, CWnd* pWnd, CRect rect, UINT uBmpID );
  32. static void PaintDesktop( CDC *pDC, CWnd* pWnd, CRect SourceRect, CRect DestRect);
  33. static void DrawLine( CDC *pDC, CPoint From, CPoint To );
  34. static void DrawSineWave( CDC *pDC, CRect rect, double dwCycles, COLORREF crPen = 0x000 );
  35. static void TileBitmap( CDC *pDC, CRect rect, UINT uResourceID );
  36. static void PaintBitmap( CDC *pDC, CWnd* pWnd, CRect rect, UINT uBmpID, bool bStretchToFit = true, bool bOverlay=false );
  37. static void BlitBitmap( CDC *pDC, CRect rect, UINT uResourceID, COLORREF crMask=RGB(0,0,0), double dDegreesRotation=0 );
  38. //
  39. // Other
  40. //
  41. CDCUtils();
  42. virtual ~CDCUtils();
  43. };
  44. #endif // !defined(AFX_DCUTILS_H__E2D3C5A3_8841_4FAB_80F2_940FF382C7B2__INCLUDED_)