📄 tdc.h
字号:
BOOL Polyline(LPPOINT lpPoints, int nCount);
BOOL AngleArc(int x, int y, int nRadius, float fStartAngle, float fSweepAngle);
BOOL ArcTo(int x1, int y1, int x2, int y2, int x3, int y3, int x4, int y4);
BOOL ArcTo(LPCRECT lpRect, POINT ptStart, POINT ptEnd);
int GetArcDirection() const;
int SetArcDirection(int nArcDirection);
BOOL PolyDraw(const POINT* lpPoints, const BYTE* lpTypes, int nCount);
BOOL PolylineTo(const POINT* lpPoints, int nCount);
BOOL PolyPolyline(const POINT* lpPoints,
const DWORD* lpPolyPoints, int nCount);
BOOL PolyBezier(const POINT* lpPoints, int nCount);
BOOL PolyBezierTo(const POINT* lpPoints, int nCount);
// Simple Drawing Functions
void FillRect(LPCRECT lpRect, TBrush* pBrush);
void FrameRect(LPCRECT lpRect, TBrush* pBrush);
void InvertRect(LPCRECT lpRect);
BOOL DrawIcon(int x, int y, HICON hIcon);
BOOL DrawIcon(POINT point, HICON hIcon);
#if (WINVER >= 0x400)
BOOL DrawState(TPoint pt, TSize size, HBITMAP hBitmap, UINT nFlags,
HBRUSH hBrush = NULL);
//BOOL DrawState(TPoint pt, TSize size, CBitmap* pBitmap, UINT nFlags,
// TBrush* pBrush = NULL);
//BOOL DrawState(TPoint pt, TSize size, HICON hIcon, UINT nFlags,
// HBRUSH hBrush = NULL);
//BOOL DrawState(TPoint pt, TSize size, HICON hIcon, UINT nFlags,
// TBrush* pBrush = NULL);
//BOOL DrawState(TPoint pt, TSize size, LPCTSTR lpszText, UINT nFlags,
// BOOL bPrefixText = TRUE, int nTextLen = 0, HBRUSH hBrush = NULL);
//BOOL DrawState(TPoint pt, TSize size, LPCTSTR lpszText, UINT nFlags,
// BOOL bPrefixText = TRUE, int nTextLen = 0, TBrush* pBrush = NULL);
//BOOL DrawState(TPoint pt, TSize size, DRAWSTATEPROC lpDrawProc,
// LPARAM lData, UINT nFlags, HBRUSH hBrush = NULL);
//BOOL DrawState(TPoint pt, TSize size, DRAWSTATEPROC lpDrawProc,
// LPARAM lData, UINT nFlags, TBrush* pBrush = NULL);
#endif
// Ellipse and Polygon Functions
BOOL Chord(int x1, int y1, int x2, int y2, int x3, int y3,
int x4, int y4);
BOOL Chord(LPCRECT lpRect, POINT ptStart, POINT ptEnd);
void DrawFocusRect(LPCRECT lpRect);
BOOL Ellipse(int x1, int y1, int x2, int y2);
BOOL Ellipse(LPCRECT lpRect);
BOOL Pie(int x1, int y1, int x2, int y2, int x3, int y3, int x4, int y4);
BOOL Pie(LPCRECT lpRect, POINT ptStart, POINT ptEnd);
BOOL Polygon(LPPOINT lpPoints, int nCount);
BOOL PolyPolygon(LPPOINT lpPoints, LPINT lpPolyCounts, int nCount);
BOOL Rectangle(int x1, int y1, int x2, int y2);
BOOL Rectangle(LPCRECT lpRect);
BOOL RoundRect(int x1, int y1, int x2, int y2, int x3, int y3);
BOOL RoundRect(LPCRECT lpRect, POINT point);
// Bitmap Functions
BOOL PatBlt(int x, int y, int nWidth, int nHeight, DWORD dwRop);
BOOL BitBlt(int x, int y, int nWidth, int nHeight, TDC* pSrcDC,
int xSrc, int ySrc, DWORD dwRop);
BOOL StretchBlt(int x, int y, int nWidth, int nHeight, TDC* pSrcDC,
int xSrc, int ySrc, int nSrcWidth, int nSrcHeight, DWORD dwRop);
COLORREF GetPixel(int x, int y) const;
COLORREF GetPixel(POINT point) const;
COLORREF SetPixel(int x, int y, COLORREF crColor);
COLORREF SetPixel(POINT point, COLORREF crColor);
BOOL FloodFill(int x, int y, COLORREF crColor);
BOOL ExtFloodFill(int x, int y, COLORREF crColor, UINT nFillType);
//BOOL MaskBlt(int x, int y, int nWidth, int nHeight, TDC* pSrcDC,
// int xSrc, int ySrc, CBitmap& maskBitmap, int xMask, int yMask,
// DWORD dwRop);
//BOOL PlgBlt(LPPOINT lpPoint, TDC* pSrcDC, int xSrc, int ySrc,
// int nWidth, int nHeight, CBitmap& maskBitmap, int xMask, int yMask);
BOOL SetPixelV(int x, int y, COLORREF crColor);
BOOL SetPixelV(POINT point, COLORREF crColor);
// Text Functions
virtual BOOL TextOut(int x, int y, LPCTSTR lpszString, int nCount);
// BOOL TextOut(int x, int y, const CString& str);
virtual BOOL ExtTextOut(int x, int y, UINT nOptions, LPCRECT lpRect,
LPCTSTR lpszString, UINT nCount, LPINT lpDxWidths);
// BOOL ExtTextOut(int x, int y, UINT nOptions, LPCRECT lpRect,
// const CString& str, LPINT lpDxWidths);
virtual TSize TabbedTextOut(int x, int y, LPCTSTR lpszString, int nCount,
int nTabPositions, LPINT lpnTabStopPositions, int nTabOrigin);
// TSize TabbedTextOut(int x, int y, const CString& str,
// int nTabPositions, LPINT lpnTabStopPositions, int nTabOrigin);
virtual int DrawText(LPCTSTR lpszString, int nCount, LPRECT lpRect,
UINT nFormat);
// int DrawText(const CString& str, LPRECT lpRect, UINT nFormat);
TSize GetTextExtent(LPCTSTR lpszString, int nCount) const;
//TSize GetTextExtent(const CString& str) const;
TSize GetOutputTextExtent(LPCTSTR lpszString, int nCount) const;
//TSize GetOutputTextExtent(const CString& str) const;
TSize GetTabbedTextExtent(LPCTSTR lpszString, int nCount,
int nTabPositions, LPINT lpnTabStopPositions) const;
TSize GetTabbedTextExtent(const CString& str,
int nTabPositions, LPINT lpnTabStopPositions) const;
TSize GetOutputTabbedTextExtent(LPCTSTR lpszString, int nCount,
int nTabPositions, LPINT lpnTabStopPositions) const;
TSize GetOutputTabbedTextExtent(const CString& str,
int nTabPositions, LPINT lpnTabStopPositions) const;
virtual BOOL GrayString(TBrush* pBrush,
BOOL (CALLBACK* lpfnOutput)(HDC, LPARAM, int), LPARAM lpData,
int nCount, int x, int y, int nWidth, int nHeight);
UINT GetTextAlign() const;
UINT SetTextAlign(UINT nFlags);
int GetTextFace(int nCount, LPTSTR lpszFacename) const;
int GetTextFace(CString& rString) const;
BOOL GetTextMetrics(LPTEXTMETRIC lpMetrics) const;
BOOL GetOutputTextMetrics(LPTEXTMETRIC lpMetrics) const;
int SetTextJustification(int nBreakExtra, int nBreakCount);
int GetTextCharacterExtra() const;
int SetTextCharacterExtra(int nCharExtra);
// Advanced Drawing
#if (WINVER >= 0x400)
BOOL DrawEdge(LPRECT lpRect, UINT nEdge, UINT nFlags);
BOOL DrawFrameControl(LPRECT lpRect, UINT nType, UINT nState);
#endif
// Scrolling Functions
BOOL ScrollDC(int dx, int dy, LPCRECT lpRectScroll, LPCRECT lpRectClip,
CRgn* pRgnUpdate, LPRECT lpRectUpdate);
// Font Functions
BOOL GetCharWidth(UINT nFirstChar, UINT nLastChar, LPINT lpBuffer) const;
BOOL GetOutputCharWidth(UINT nFirstChar, UINT nLastChar, LPINT lpBuffer) const;
DWORD SetMapperFlags(DWORD dwFlag);
TSize GetAspectRatioFilter() const;
BOOL GetCharABCWidths(UINT nFirstChar, UINT nLastChar, LPABC lpabc) const;
DWORD GetFontData(DWORD dwTable, DWORD dwOffset, LPVOID lpData, DWORD cbData) const;
int GetKerningPairs(int nPairs, LPKERNINGPAIR lpkrnpair) const;
UINT GetOutlineTextMetrics(UINT cbData, LPOUTLINETEXTMETRIC lpotm) const;
DWORD GetGlyphOutline(UINT nChar, UINT nFormat, LPGLYPHMETRICS lpgm,
DWORD cbBuffer, LPVOID lpBuffer, const MAT2* lpmat2) const;
BOOL GetCharABCWidths(UINT nFirstChar, UINT nLastChar,
LPABCFLOAT lpABCF) const;
BOOL GetCharWidth(UINT nFirstChar, UINT nLastChar,
float* lpFloatBuffer) const;
// Printer/Device Escape Functions
virtual int Escape(int nEscape, int nCount,
LPCSTR lpszInData, LPVOID lpOutData);
int Escape(int nEscape, int nInputSize, LPCSTR lpszInputData,
int nOutputSize, LPSTR lpszOutputData);
int DrawEscape(int nEscape, int nInputSize, LPCSTR lpszInputData);
// Escape helpers
int StartDoc(LPCTSTR lpszDocName); // old Win3.0 version
int StartDoc(LPDOCINFO lpDocInfo);
int StartPage();
int EndPage();
int SetAbortProc(BOOL (CALLBACK* lpfn)(HDC, int));
int AbortDoc();
int EndDoc();
// MetaFile Functions
BOOL PlayMetaFile(HMETAFILE hMF);
BOOL PlayMetaFile(HENHMETAFILE hEnhMetaFile, LPCRECT lpBounds);
BOOL AddMetaFileComment(UINT nDataSize, const BYTE* pCommentData);
// can be used for enhanced metafiles only
// Path Functions
BOOL AbortPath();
BOOL BeginPath();
BOOL CloseFigure();
BOOL EndPath();
BOOL FillPath();
BOOL FlattenPath();
BOOL StrokeAndFillPath();
BOOL StrokePath();
BOOL WidenPath();
float GetMiterLimit() const;
BOOL SetMiterLimit(float fMiterLimit);
int GetPath(LPPOINT lpPoints, LPBYTE lpTypes, int nCount) const;
BOOL SelectClipPath(int nMode);
// Misc Helper Functions
static TBrush* PASCAL GetHalftoneBrush();
void DrawDragRect(LPCRECT lpRect, SIZE size,
LPCRECT lpRectLast, SIZE sizeLast,
TBrush* pBrush = NULL, TBrush* pBrushLast = NULL);
void FillSolidRect(LPCRECT lpRect, COLORREF clr);
void FillSolidRect(int x, int y, int cx, int cy, COLORREF clr);
void Draw3dRect(LPCRECT lpRect, COLORREF clrTopLeft, COLORREF clrBottomRight);
void Draw3dRect(int x, int y, int cx, int cy,
COLORREF clrTopLeft, COLORREF clrBottomRight);
// Implementation
public:
virtual ~TDC();
#ifdef _DEBUG
virtual void AssertValid() const;
//virtual void Dump(CDumpContext& dc) const;
#endif
// advanced use and implementation
BOOL m_bPrinting;
//HGDIOBJ SelectObject(HGDIOBJ); // do not use for regions
protected:
// used for implementation of non-virtual SelectObject calls
//static CGdiObject* PASCAL SelectGdiObject(HDC hDC, HGDIOBJ h);
//--------------*/
};
#endif // !defined(AFX_TDC_H__9B3516AA_85FF_11D5_B10B_C55DF8D77E35__INCLUDED_)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -