TalanSoft Toolkits  201707
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Groups Pages
Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
DC Class Reference

Detailed Description

Device context (DC) wrapper.

Public Member Functions

 DC ()
 
 DC (HDC hDC)
 
virtual ~DC ()
 
void DrawLine (UINT iX1, UINT iY1, UINT iX2, UINT iY2, COLORREF clrColor)
 
void MoveTo (UINT iX, UINT iY)
 
void LineTo (UINT iX, UINT iY, COLORREF clrColor)
 
void LineTo (UINT iX, UINT iY)
 
HFONT CreateAndSelectFont (const TCHAR *pszFace, UINT iSize, INT iWeight=FW_NORMAL)
 
void CreateCompatible (HDC hDC)
 
void Delete ()
 
void ReleaseDC (HWND hWnd)
 
int DrawText (const char *pszString, RECT *rcBounds, UINT iFormat=DT_LEFT|DT_END_ELLIPSIS)
 
BOOL TextOut (const TCHAR *pszString, UINT iX, UINT iY)
 
COLORREF GetPixel (UINT iX, UINT iY)
 
BOOL SetPixel (UINT iX, UINT iY, COLORREF clrColor)
 
HDC GetDC () const
 
int FillRect (const RECT &rc, HBRUSH hBrush)
 
BOOL DrawFrameControl (RECT *pRect, UINT iType, UINT iState)
 
HGDIOBJ SelectObject (HGDIOBJ hObj)
 
int SetBkMode (INT iMode)
 
COLORREF SetTextColor (COLORREF clrColor)
 
COLORREF SetBkColor (COLORREF clrColor)
 
BOOL Ellipse (int iLeftRect, int iTopRect, int iRightRect, int iBottomRect)
 
tBool StretchBlitToDC (int bmp_w, int bmp_h, int bmp_bpp, BYTE *bmp_pixels, int src_x, int src_y, int src_w, int src_h, int dest_x, int dest_y, int dest_w, int dest_h)
 
tBool BlitToDC (int bmp_w, int bmp_h, int bmp_bpp, BYTE *bmp_pixels, int src_x, int src_y, int dest_x, int dest_y, int w, int h)
 

Static Public Member Functions

static tBool FillBitmapInfo (BITMAPINFOHEADER *bi, int w, int h, int bpp)
 

Protected Attributes

BOOL mbReleaseDC
 
HDC mhDC
 

Constructor & Destructor Documentation

DC ( )
DC ( HDC  hDC)
virtual ~DC ( )
virtual

Member Function Documentation

void DrawLine ( UINT  iX1,
UINT  iY1,
UINT  iX2,
UINT  iY2,
COLORREF  clrColor 
)
void MoveTo ( UINT  iX,
UINT  iY 
)
void LineTo ( UINT  iX,
UINT  iY,
COLORREF  clrColor 
)
void LineTo ( UINT  iX,
UINT  iY 
)
HFONT CreateAndSelectFont ( const TCHAR *  pszFace,
UINT  iSize,
INT  iWeight = FW_NORMAL 
)
Remarks
Caller is responsible for deleting font
void CreateCompatible ( HDC  hDC)
void Delete ( )
void ReleaseDC ( HWND  hWnd)
int DrawText ( const char *  pszString,
RECT *  rcBounds,
UINT  iFormat = DT_LEFT | DT_END_ELLIPSIS 
)
BOOL TextOut ( const TCHAR *  pszString,
UINT  iX,
UINT  iY 
)
COLORREF GetPixel ( UINT  iX,
UINT  iY 
)
BOOL SetPixel ( UINT  iX,
UINT  iY,
COLORREF  clrColor 
)
HDC GetDC ( ) const
int FillRect ( const RECT &  rc,
HBRUSH  hBrush 
)
BOOL DrawFrameControl ( RECT *  pRect,
UINT  iType,
UINT  iState 
)
HGDIOBJ SelectObject ( HGDIOBJ  hObj)
int SetBkMode ( INT  iMode)
COLORREF SetTextColor ( COLORREF  clrColor)
COLORREF SetBkColor ( COLORREF  clrColor)
BOOL Ellipse ( int  iLeftRect,
int  iTopRect,
int  iRightRect,
int  iBottomRect 
)
static tBool FillBitmapInfo ( BITMAPINFOHEADER *  bi,
int  w,
int  h,
int  bpp 
)
static
tBool StretchBlitToDC ( int  bmp_w,
int  bmp_h,
int  bmp_bpp,
BYTE *  bmp_pixels,
int  src_x,
int  src_y,
int  src_w,
int  src_h,
int  dest_x,
int  dest_y,
int  dest_w,
int  dest_h 
)
tBool BlitToDC ( int  bmp_w,
int  bmp_h,
int  bmp_bpp,
BYTE *  bmp_pixels,
int  src_x,
int  src_y,
int  dest_x,
int  dest_y,
int  w,
int  h 
)

Member Data Documentation

BOOL mbReleaseDC
protected
HDC mhDC
protected