本文整理汇总了C++中TDC::ExtTextOut方法的典型用法代码示例。如果您正苦于以下问题:C++ TDC::ExtTextOut方法的具体用法?C++ TDC::ExtTextOut怎么用?C++ TDC::ExtTextOut使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TDC
的用法示例。
在下文中一共展示了TDC::ExtTextOut方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: rect
// MFC style function, that draws a filled rect. Is this faster???
void
FillSolidRect(TDC& dc, int x, int y, int cx, int cy, TColor clr)
{
TColor oldColor = dc.SetBkColor(clr);
TRect rect(x, y, x + cx, y + cy);
dc.ExtTextOut(0, 0, ETO_OPAQUE, &rect, _T(""), 0, 0);
dc.SetBkColor(oldColor);
}
示例2: face
//
/// Paint the text gadget by painting gadget borders, & then painting text in
/// the InnerRect. Empty or 0 text blanks the gadget.
//
/// Calls TGadget::PaintBorder to paint the border. Calls TGadget::GetInnerRect to
/// calculate the area of the text gadget's rectangle. If the text is left-aligned,
/// Paint calls dc.GetTextExtent to compute the width and height of a line of the
/// text. To set the background color, Paint calls dc.GetSysColor and sets the
/// default background color to face shading (COLOR_BTNFACE). To set the button text
/// color, Paint calls dc.SetTextColor and sets the default button text color to
/// COLOR_BTNTEXT. To draw the text, Paint calls dc.ExtTextOut and passes the
/// parameters ETO_CLIPPED (so the text is clipped to fit the rectangle) and
/// ETO_OPAQUE (so the rectangle is filled with the current background color).
//
void
TTextGadget::Paint(TDC& dc)
{
PaintBorder(dc);
TRect innerRect;
GetInnerRect(innerRect);
if (!Font)
dc.SelectObject(GetGadgetWindow()->GetFont());
else
dc.SelectObject(*Font);
TColor textColor = GetEnabledColor();
if(!GetEnabled())
textColor = TColor::Sys3dHilight;
bool transparent = GetGadgetWindow()->GetFlatStyle() & TGadgetWindow::FlatXPTheme;
if(!Text){
if (!transparent)
{
TColor color = dc.SetBkColor(TColor::Sys3dFace);
dc.ExtTextOut(0,0, ETO_OPAQUE, &innerRect, _T(""), 0);
dc.SetBkColor(color);
}
}
else
{
// Create a UI Face object for this button & let it paint the button face
//
uint align[] = {DT_LEFT, DT_CENTER, DT_RIGHT};
uint format = DT_SINGLELINE | DT_VCENTER | align[Align];
TUIFace face(innerRect, Text, BkgndColor, format);
TPoint dstPt(innerRect.TopLeft());
dc.SetBkColor(BkgndColor);
TColor oldTxColor = dc.SetTextColor(textColor);
if (!GetEnabled())
face.Paint(dc, dstPt, TUIFace::Disabled, false, !transparent);
else
face.Paint(dc, dstPt, TUIFace::Normal, false, !transparent);
dc.SetTextColor(oldTxColor);
}
dc.RestoreFont();
}
示例3: GetClientRect
//
/// Adjusts the message bar and paints a highlight line. Then, PaintGadgets either
/// paints the hint text if any is set or calls TGadgetWindow::PaintGadgets to
/// repaint each gadget.
//
void
TMessageBar::PaintGadgets(TDC& dc, bool erase, TRect& rect)
{
if (HighlightLine && rect.top == 0)
dc.TextRect(0, 0, rect.right, TUIMetric::CyBorder, TColor::Sys3dHilight);
if (!HintText.empty())
{
TRect clientRect = GetClientRect();
int y = (clientRect.bottom - GetFontHeight()) / 2;
if (HighlightLine)
clientRect.top += TUIMetric::CyBorder;
dc.SelectObject(GetFont());
dc.SetBkColor(TColor::Sys3dFace);
dc.ExtTextOut(5, y, ETO_OPAQUE, &clientRect, HintText, static_cast<int>(HintText.length()));
}
else
{
TGadgetWindow::PaintGadgets(dc, erase, rect);
}
}
示例4:
void
TTabCheckList::PaintText(TDC& dc, const TRect& textRect, const tstring& text)
{
dc.ExtTextOut(textRect.TopLeft(), ETO_OPAQUE, &textRect, _T(""), 0, 0);
dc.TabbedTextOut(textRect.TopLeft(), text, -1, TabStops.Size(), &TabStops[0], textRect.left);
}