本文整理汇总了C++中GraphicsPath::AddString方法的典型用法代码示例。如果您正苦于以下问题:C++ GraphicsPath::AddString方法的具体用法?C++ GraphicsPath::AddString怎么用?C++ GraphicsPath::AddString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GraphicsPath
的用法示例。
在下文中一共展示了GraphicsPath::AddString方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DrawString
bool TextNoOutlineStrategy::DrawString(
Gdiplus::Graphics* pGraphics,
Gdiplus::FontFamily* pFontFamily,
Gdiplus::FontStyle fontStyle,
int nfontSize,
const wchar_t*pszText,
Gdiplus::Rect rtDraw,
Gdiplus::StringFormat* pStrFormat)
{
using namespace Gdiplus;
GraphicsPath path;
Status status = path.AddString(pszText,wcslen(pszText),pFontFamily,fontStyle,nfontSize,rtDraw,pStrFormat);
if(status!=Ok)
return false;
Status status2 = Ok;
if(m_bClrText)
{
SolidBrush brush(m_clrText);
status2 = pGraphics->FillPath(&brush, &path);
}
else
{
status2 = pGraphics->FillPath(m_pbrushText, &path);
}
return status2 == Ok;
}
示例2: DrawString
bool TextDblOutlineStrategy::DrawString(
Gdiplus::Graphics* pGraphics,
Gdiplus::FontFamily* pFontFamily,
Gdiplus::FontStyle fontStyle,
int nfontSize,
const wchar_t*pszText,
Gdiplus::Point ptDraw,
Gdiplus::StringFormat* pStrFormat)
{
using namespace Gdiplus;
GraphicsPath path;
Status status = path.AddString(pszText,wcslen(pszText),pFontFamily,fontStyle,nfontSize,ptDraw,pStrFormat);
if(status!=Ok)
return false;
Pen pen2(m_clrOutline2,m_nThickness1+m_nThickness2);
pen2.SetLineJoin(LineJoinRound);
pGraphics->DrawPath(&pen2, &path);
Pen pen1(m_clrOutline1,m_nThickness1);
pen1.SetLineJoin(LineJoinRound);
pGraphics->DrawPath(&pen1, &path);
Status status2 = Ok;
if(m_bClrText)
{
SolidBrush brush(m_clrText);
status2 = pGraphics->FillPath(&brush, &path);
}
else
{
status2 = pGraphics->FillPath(m_pbrushText, &path);
}
return status2 == Ok;
}
示例3: MeasureString
bool TextNoOutlineStrategy::MeasureString(
Gdiplus::Graphics* pGraphics,
Gdiplus::FontFamily* pFontFamily,
Gdiplus::FontStyle fontStyle,
int nfontSize,
const wchar_t*pszText,
Gdiplus::Rect rtDraw,
Gdiplus::StringFormat* pStrFormat,
float* pfPixelsStartX,
float* pfPixelsStartY,
float* pfDestWidth,
float* pfDestHeight )
{
using namespace Gdiplus;
GraphicsPath path;
Status status = path.AddString(pszText,wcslen(pszText),pFontFamily,fontStyle,nfontSize,rtDraw,pStrFormat);
if(status!=Ok)
return false;
*pfDestWidth= rtDraw.GetLeft();
*pfDestHeight= rtDraw.GetTop();
bool b = GDIPath::MeasureGraphicsPath(pGraphics, &path, pfPixelsStartX, pfPixelsStartY, pfDestWidth, pfDestHeight);
return b;
}
示例4: OverlayText
TexturePod OverlayText(string message)
{
InitializeGdi();
PezConfig cfg = PezGetConfig();
// Skip GDI text generation if the string is unchanged:
if (message == oc.PreviousMessage)
return oc.MessageTexture;
oc.PreviousMessage = message;
// Create the GDI+ drawing context and set it up:
Graphics* gfx = Graphics::FromImage(oc.GdiBitmap);
gfx->Clear(Color::Transparent);
gfx->SetSmoothingMode(SmoothingModeAntiAlias);
gfx->SetInterpolationMode(InterpolationModeHighQualityBicubic);
// Select a font:
FontFamily fontFamily(L"Trebuchet MS");
const float fontSize = 14;
PointF origin(10.0f, 10.0f);
StringFormat format(StringAlignmentNear);
// Create a path along the outline of the glyphs:
GraphicsPath path;
path.AddString(
wstring(message.begin(), message.end()).c_str(),
-1,
&fontFamily,
FontStyleRegular,
fontSize,
origin,
&format);
// Draw some glow to steer clear of crappy AA:
for (float width = 0; width < 3; ++width) {
Pen pen(Color(64, 0, 0, 0), width);
pen.SetLineJoin(LineJoinRound);
gfx->DrawPath(&pen, &path);
}
// Fill the glyphs:
SolidBrush brush(Color(50, 100, 200));
gfx->FillPath(&brush, &path);
// Lock the raw pixel data and pass it to OpenGL:
BitmapData data;
oc.GdiBitmap->LockBits(0, ImageLockModeRead, PixelFormat32bppARGB, &data);
_ASSERT(data.Stride == sizeof(unsigned int) * cfg.Width);
glBindTexture(GL_TEXTURE_2D, oc.MessageTexture.Handle);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, cfg.Width, cfg.Height, 0, GL_RGBA, GL_UNSIGNED_BYTE, data.Scan0);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
oc.GdiBitmap->UnlockBits(&data);
return oc.MessageTexture;
}
示例5: GPDrawShadowText
void GPDrawShadowText( Graphics& gc, CString& strTxtIn, CRect& rcIn, Gdiplus::Font& fontIn, ARGB BrushClrIn, ARGB PenClrIn , ARGB shadowPenClrIn /*= 0xff000000*/, ARGB shadowBrushClrIn /*= 0xff000000*/, int nOffXIn /*= 2*/, int nOffYIn /*= 2*/, StringFormat* fmtIn /*= NULL*/ )
{
Gdiplus::Font& gcfont = fontIn;
FontFamily fmy;
gcfont.GetFamily(&fmy);
int nfontStyle = gcfont.GetStyle();
REAL dFontSize = gcfont.GetSize();
Rect rcText = CRect2Rect(rcIn);
StringFormat fmt;
fmt.SetAlignment(StringAlignmentCenter);
fmt.SetTrimming(StringTrimmingEllipsisWord);
fmt.SetLineAlignment(StringAlignmentCenter);
StringFormat& fmtUse = fmtIn == NULL? fmt:*fmtIn;
GraphicsContainer gcContainer = gc.BeginContainer();
gc.SetSmoothingMode(SmoothingModeAntiAlias);
CComBSTR btrTxtIn(strTxtIn);
GraphicsPath textPath;
textPath.AddString(btrTxtIn, -1, &fmy, nfontStyle, dFontSize, rcText, &fmtUse);
Matrix mx;
mx.Translate(nOffXIn, nOffYIn);
textPath.Transform(&mx);
Pen textPen(ARGB2Color(shadowPenClrIn), 1);
SolidBrush textbrush(ARGB2Color(shadowBrushClrIn));
textPen.SetLineJoin(LineJoinRound);
if (shadowBrushClrIn != 0)
{
gc.FillPath(&textbrush, &textPath);
}
if (shadowPenClrIn != 0)
{
gc.DrawPath(&textPen, &textPath);
}
mx.Invert();
textPath.Transform(&mx);
textPen.SetColor(ARGB2Color(PenClrIn));
textbrush.SetColor(ARGB2Color(BrushClrIn));
if (BrushClrIn != 0)
{
gc.FillPath(&textbrush, &textPath);
}
if (PenClrIn != 0)
{
gc.DrawPath(&textPen, &textPath);
}
gc.EndContainer(gcContainer);
}
示例6: InitLineTextPath
wxGraphicsPath OOPDesktopLyric::InitLineTextPath(wxGraphicsContext *gc) {
wxASSERT(gc);
// 文本轮廓
wxGraphicsPen pen = gc->CreatePen(wxPen(wxColour(0,0,0,255), 3));
const wxString textToDraw(IsCurrLineValid() ?
(*m_currLine)->GetLyric() :
GetInteractiveOutput());
wxGraphicsPath path = gc->CreatePath();
//========================================
// 添加文本
FontFamily fontFamily(m_style.fontFace);
StringFormat stringFormat;
wxCoord winHeight;
GetSize(NULL, &winHeight);
wxASSERT(size_t(winHeight) >= m_style.pxFontSize);
GraphicsPath *nativePath = (GraphicsPath *) path.GetNativePath();
nativePath->AddString(textToDraw,
-1,
&fontFamily,
m_style.bold ? FontStyleBold : FontStyleRegular,
m_style.pxFontSize,
Point(0, (winHeight - m_style.pxFontSize) / 2),
&stringFormat);
WXGDIPlusPenData *penImpl = (WXGDIPlusPenData *) pen.GetGraphicsData();
RectF bounds;
nativePath->GetBounds(&bounds, NULL, penImpl->m_pen);
m_textPathBounds.m_x = bounds.X;
m_textPathBounds.m_y = bounds.Y;
m_textPathBounds.m_width = bounds.Width;
m_textPathBounds.m_height = bounds.Height;
path.UnGetNativePath(nativePath);
//========================================
// 添加到路径中
gc->SetPen(pen);
gc->StrokePath(path);
return path;
}
示例7: TestStringCx
int MusicUtils::TestStringCx(const wchar_t *szText)
{
//CDC tdc;
//tdc.CreateCompatibleDC(CDC::FromHandle(::GetDC(0)));
//HBITMAP hbitmap = CreateCompatibleBitmap(tdc.m_hDC,600,15);
//tdc.SelectObject(hbitmap);
//return tdc.GetOutputTextExtent(szText).cx;
GraphicsPath path;
FontFamily fontfamily;
Font font(L"宋体",14);
font.GetFamily(&fontfamily);
StringFormat strFormat;
strFormat.SetAlignment(StringAlignmentNear);
path.AddString(szText,-1,&fontfamily,font.GetStyle(),font.GetSize(),PointF(0,0),&strFormat);
RectF rcBound;
path.GetBounds(&rcBound);
return rcBound.Width;
}
示例8: GetTextBounds
// 获取文字需要的显示区域
Size GetTextBounds(const Font& font,const StringFormat& strFormat,const CString& strText)
{
GraphicsPath path;
FontFamily fontfamily;
font.GetFamily(&fontfamily);
BSTR bsText = strText.AllocSysString();
path.AddString(bsText,-1,&fontfamily,font.GetStyle(),font.GetSize(),PointF(0,0),&strFormat);
::SysFreeString(bsText);
RectF rcBound;
path.GetBounds(&rcBound);
REAL rHeight = font.GetHeight(0.0f);
return Size((int)(rcBound.Width > (int)rcBound.Width ? rcBound.Width + 1 : rcBound.Width),
(int)(rHeight > (int)rHeight ? rHeight + 4 : rHeight + 1));
//return Size((int)(rcBound.Width > (int)rcBound.Width ? rcBound.Width + 1 : rcBound.Width),
// (int)(rcBound.Height > (int)rcBound.Height ? rcBound.Height + 2 : rcBound.Height + 1));
}
示例9: drawLine
int Window::drawLine(HDC hdc, int oy, std::wstring string, TextFont* fnt)
{
using namespace Gdiplus;
int x = (showed ? 0 : leftMargin) - 5;
int y = (showed ? 0 : topMargin) + oy;
const wchar_t* text = string.c_str();
if (fnt == 0) fnt = font;
Graphics graphics(hdc);
graphics.SetSmoothingMode(SmoothingModeAntiAlias);
FontFamily fontFamily;
fnt->GetFamily(&fontFamily);
RectF boundRect = fnt->getTextBounds(hdc, clientRect, text);
x += ((clientRect.right - clientRect.left) - (int)(boundRect.GetRight() - boundRect.GetLeft()) - 2) / 2;
y -= ((int)boundRect.GetBottom()) + 5;
StringFormat strformat;
GraphicsPath path;
path.AddString(text, wcslen(text), &fontFamily,
fnt->GetStyle(), graphics.GetDpiY() * fnt->GetSize() / 72, Gdiplus::Point(x, y), &strformat );
// Outline color + size
Pen pen(Color(0, 0, 0), fnt->GetSize()/7);
pen.SetLineJoin(LineJoinRound);
graphics.DrawPath(&pen, &path);
// Text color
SolidBrush brush(Color(254, 254, 254));
graphics.FillPath(&brush, &path);
Rect bounds;
path.GetBounds(&bounds, 0, &pen);
return (int)boundRect.GetBottom();
}
示例10: DrawString
bool DiffusedShadowStrategy::DrawString(
Gdiplus::Graphics* pGraphics,
Gdiplus::FontFamily* pFontFamily,
Gdiplus::FontStyle fontStyle,
int nfontSize,
const wchar_t*pszText,
Gdiplus::Rect rtDraw,
Gdiplus::StringFormat* pStrFormat)
{
using namespace Gdiplus;
GraphicsPath path;
Status status = path.AddString(pszText,wcslen(pszText),pFontFamily,fontStyle,nfontSize,rtDraw,pStrFormat);
if(status!=Ok)
return false;
for(int i=1; i<=m_nThickness; ++i)
{
Pen pen(m_clrOutline,i);
pen.SetLineJoin(LineJoinRound);
pGraphics->DrawPath(&pen, &path);
}
Status status2 = Ok;
if(m_bOutlinetext==false)
{
for(int i=1; i<=m_nThickness; ++i)
{
SolidBrush brush(m_clrText);
status2 = pGraphics->FillPath(&brush, &path);
}
}
else
{
SolidBrush brush(m_clrText);
status2 = pGraphics->FillPath(&brush, &path);
}
return status2 == Ok;
}
示例11: OnPaint
void CMyDlg::OnPaint()
{
CPaintDC dc(this);
CRect rcClient;
GetClientRect(&rcClient);
Graphics graphics(dc);
if (version&&bIsAero) graphics.Clear(Color.Black);
else graphics.Clear(Color.White);
Bitmap CacheImage(rcClient.Width(),rcClient.Height());
Graphics buffer(&CacheImage);
buffer.SetSmoothingMode(SmoothingModeAntiAlias);
buffer.SetInterpolationMode(InterpolationModeHighQualityBicubic);
Image *logo;
Image *button;
ImageFromIDResource(2,"png",logo);
ImageFromIDResource(1,"png",button);
buffer.DrawImage(logo, -5,20);
buffer.DrawImage(button, 165,122);
buffer.DrawImage(button, 350,122);
FontFamily fontFamily(version?L"微软雅黑":L"宋体");
StringFormat strformat;
wchar_t pszbuf[512];
wsprintfW(pszbuf,L"本程序适用于 迅雷5.9 系列\n如果本软件有错,我概不负责,但我会尽力解决。\n只有极少数时候需要您指定安装目录(比如非官方版)。\n如果会员补丁失效,重新破解即可。\n\n\n请选择: 一键增强 %s取消增强\n\n2010年4月7日更新 www.shuax.com",version?L" ":L" ");
GraphicsPath path;
path.AddString(pszbuf, wcslen(pszbuf), &fontFamily, FontStyleRegular, version?15:16, Gdiplus::Point(version?90:80,version?9:20), &strformat );
Pen pen(Color(18, 255, 255, 255), 3.0);
//pen.SetLineJoin(LineJoinRound);
buffer.DrawPath(&pen, &path);
SolidBrush brush(Color(0,0,0));
buffer.FillPath(&brush, &path);
graphics.DrawImage(&CacheImage, 0, 0);
graphics.ReleaseHDC(dc);
}
示例12: MeasureString
bool TextDblOutlineStrategy::MeasureString(
Gdiplus::Graphics* pGraphics,
Gdiplus::FontFamily* pFontFamily,
Gdiplus::FontStyle fontStyle,
int nfontSize,
const wchar_t*pszText,
Gdiplus::Rect rtDraw,
Gdiplus::StringFormat* pStrFormat,
float* pfPixelsStartX,
float* pfPixelsStartY,
float* pfDestWidth,
float* pfDestHeight )
{
using namespace Gdiplus;
GraphicsPath path;
Status status = path.AddString(pszText,wcslen(pszText),pFontFamily,fontStyle,nfontSize,rtDraw,pStrFormat);
if(status!=Ok)
return false;
*pfDestWidth= rtDraw.GetLeft();
*pfDestHeight= rtDraw.GetTop();
bool b = GDIPath::MeasureGraphicsPath(pGraphics, &path, pfPixelsStartX, pfPixelsStartY, pfDestWidth, pfDestHeight);
if(false==b)
return false;
float pixelThick = 0.0f;
b = GDIPath::ConvertToPixels(pGraphics,m_nThickness1+m_nThickness2,0.0f,NULL,NULL,&pixelThick,NULL);
if(false==b)
return false;
*pfDestWidth += pixelThick;
*pfDestHeight += pixelThick;
return true;
}
示例13: Render
STDMETHODIMP CTextOverlay::Render(LONG hdc)
{
PointF zero(0.0, 0.0);
// Get the text we want to draw!
BSTR text;
IMeter *iMeter = 0;
get_meter(&iMeter);
if (!iMeter)
{
text = format.copy();
}
else
{
_bstr_t tmp("");
BSTR tCopy = tmp.copy();
text = tCopy;
iMeter->GetAsString(format, selector, &text);
if (text != tCopy)
::SysFreeString(tCopy);
}
// Create graphics object
Graphics graphics((HDC)hdc);
graphics.SetInterpolationMode(InterpolationModeHighQuality);
graphics.SetPixelOffsetMode(PixelOffsetModeHalf);
graphics.SetSmoothingMode(SmoothingModeAntiAlias);
graphics.SetTextRenderingHint(getDefaultRenderingHint(textRenderingHint));
graphics.SetCompositingMode(CompositingModeSourceOver);
graphics.SetTextContrast(textContrast);
// Calculate world transformation
REAL el[6];
CumulativeTransform(el);
Matrix matrix(el[0], el[1], el[2], el[3], el[4], el[5]);
// matrix.Invert();
graphics.SetTransform(&matrix);
// Create fontFamily for path-based font rendering
BSTR fName;
get_FontName(&fName);
FontFamily fontFamily(fName);
::SysFreeString(fName);
// Get some extra stuff for path-based rendering
int fStyle;
get_FontStyle(&fStyle);
float fSize;
get_FontSize(&fSize);
// Set font for alternate rendering
// Font font((HDC)hdc, &logFont);
Font font(&fontFamily, fSize, fStyle, UnitPixel);
// Set font color
SolidBrush fg(color);
// Set up string format
StringFormat format(vertical ? StringFormatFlagsDirectionVertical : 0, LANG_NEUTRAL);
if (!wrap)
format.SetFormatFlags(format.GetFormatFlags() | StringFormatFlagsNoWrap);
format.SetAlignment((StringAlignment)hAlign);
format.SetLineAlignment((StringAlignment)vAlign);
// Calculate clipping rectangle
RectF clipRect(0.0, 0.0, (float)width, (float)height);
if (hAlign == 1) // Center
clipRect.X = (float)-width/2;
else if (hAlign == 2) // Right
clipRect.X = (float)-width;
if (vAlign == 1) // Center
clipRect.Y = (float)-height/2;
else if (vAlign == 2) // Right
clipRect.Y = (float)-height;
// Draw blur
if (radius > 0)
{
GraphicsPath blurPath;
if (width > -1 && height > -1)
{
blurPath.AddString(text, -1, &fontFamily, fStyle, fSize, clipRect, &format);
}
else
{
blurPath.AddString(text, -1, &fontFamily, fStyle, fSize, zero, &format);
}
BYTE alpha;
get_Alpha(&alpha);
for (int i=radius; i>0; i--)
{
Color _blurColor((BYTE)(alpha/radius), (BYTE)(blurColor >> Color::BlueShift), (BYTE)(blurColor >> Color::GreenShift), (BYTE)(blurColor >> Color::RedShift));
if (blurColor == -1)
{
_blurColor = Color(alpha/radius, color.GetRed(), color.GetGreen(), color.GetBlue());
}
Pen blurPen(_blurColor, (float)2*i);
//.........这里部分代码省略.........
示例14: UpdateTexture
//.........这里部分代码省略.........
HDC hTempDC = CreateCompatibleDC(NULL);
BITMAPINFO bi;
zero(&bi, sizeof(bi));
void* lpBits;
BITMAPINFOHEADER &bih = bi.bmiHeader;
bih.biSize = sizeof(bih);
bih.biBitCount = 32;
bih.biWidth = textSize.cx;
bih.biHeight = textSize.cy;
bih.biPlanes = 1;
HBITMAP hBitmap = CreateDIBSection(hTempDC, &bi, DIB_RGB_COLORS, &lpBits, NULL, 0);
Bitmap bmp(textSize.cx, textSize.cy, 4 * textSize.cx, PixelFormat32bppARGB, (BYTE*)lpBits);
Graphics graphics(&bmp);
SolidBrush brush(Gdiplus::Color(GetAlphaVal(opacity) | (color & 0x00FFFFFF)));
DWORD bkColor;
bkColor = ((strCurrentText.IsValid()) ? GetAlphaVal(0) : GetAlphaVal(0));
if (textSize.cx > boundingBox.Width || textSize.cy > boundingBox.Height)
{
stat = graphics.Clear(Gdiplus::Color(0x00000000));
if (stat != Gdiplus::Ok)
Log::writeError(LOG_RTSPSERV, 1, "TextSource::UpdateTexture: Graphics::Clear failed: %u", (int)stat);
SolidBrush *bkBrush = new SolidBrush(Gdiplus::Color(bkColor));
graphics.FillRectangle(bkBrush, boundingBox);
delete bkBrush;
}
else
{
stat = graphics.Clear(Gdiplus::Color(bkColor));
if (stat != Ok)
Log::writeError(LOG_RTSPSERV, 1, "TextSource::UpdateTexture: Graphics::Clear failed: %u", (int)stat);
}
graphics.SetTextRenderingHint(Gdiplus::TextRenderingHintAntiAlias);
graphics.SetCompositingMode(Gdiplus::CompositingModeSourceOver);
graphics.SetSmoothingMode(Gdiplus::SmoothingModeAntiAlias);
if (strCurrentText.IsValid())
{
if (bUseOutline)
{
boundingBox.Offset(outlineSize / 2, outlineSize / 2);
FontFamily fontFamily;
GraphicsPath path;
font.GetFamily(&fontFamily);
path.AddString(strCurrentText, -1, &fontFamily, font.GetStyle(), font.GetSize(), boundingBox, &format);
DrawOutlineText(&graphics, font, path, format, &brush);
}
else
{
stat = graphics.DrawString(strCurrentText, -1, &font, boundingBox, &format, &brush);
if (stat != Gdiplus::Ok)
Log::writeError(LOG_RTSPSERV, 1, "TextSource::UpdateTexture: Graphics::DrawString failed: %u", (int)stat);
}
}
//----------------------------------------------------------------------
// upload texture
if (textureSize.cx != textSize.cx || textureSize.cy != textSize.cy)
{
if (texture)
{
delete texture;
texture = NULL;
}
mcpy(&textureSize, &textSize, sizeof(textureSize));
texture = CreateTexture(textSize.cx, textSize.cy, GS_BGRA, lpBits, FALSE, FALSE);
}
else if (texture)
SetImage(texture,lpBits, GS_IMAGEFORMAT_BGRA, 4 * textSize.cx);
if (!texture)
{
Log::writeError(LOG_RTSPSERV,1,"TextSource::UpdateTexture: could not create texture");
DeleteObject(hFont);
}
DeleteDC(hTempDC);
DeleteObject(hBitmap);
}
}
示例15: DrawBoardsText
BOOL GDIPluseExt::DrawBoardsText(Graphics& gp,PointF startpf,CString strText,CString strFont,INT nfontsize,Color textcolor,Color boardscolor)
{
gp.SetSmoothingMode(SmoothingModeAntiAlias);
gp.SetInterpolationMode(InterpolationModeHighQualityBicubic);
#ifdef _UNICODE
StringFormat strformat;
FontFamily fontFamily(strFont);
GraphicsPath path;
path.AddString(strText,strText.GetLength(), &fontFamily,
FontStyleRegular,
(REAL)nfontsize,
startpf,
&strformat );
for(int i=1; i < 4; ++i)
{
Pen pen(boardscolor, (REAL)i);
pen.SetLineJoin(LineJoinRound);
gp.DrawPath(&pen, &path);
}
SolidBrush textBrush(textcolor);
gp.FillPath(&textBrush, &path);
#else
//字符转换
int font_len = strFont.GetLength();
WCHAR* pfont_w = new WCHAR[font_len];
MultiByteToWideChar(CP_ACP,0,strFont.GetBuffer(),-1,pfont_w,font_len);
strFont.ReleaseBuffer();
//字符转换
int text_len = strText.GetLength();
WCHAR* ptext_w = new WCHAR[text_len];
MultiByteToWideChar(CP_ACP,0,strText.GetBuffer(),-1,ptext_w,text_len);
strText.ReleaseBuffer();
FontFamily fontFamily(pfont_w);
Font font(&fontFamily, (REAL)nfontsize, FontStyleRegular, UnitPixel);
GraphicsPath path;
StringFormat strformat;
path.AddString(ptext_w,wcsnlen_s(ptext_w,text_len), &fontFamily,
font.GetStyle(),
font.GetSize(),
startpf,
&strformat );
for(int i=1; i < 4; ++i)
{
Pen pen(boardscolor,(REAL)i);
pen.SetLineJoin(LineJoinRound);
gp.DrawPath(&pen, &path);
}
SolidBrush textBrush(textcolor);
gp.FillPath(&textBrush, &path);
DEL_P(ptext_w);
DEL_P(pfont_w);
#endif
return TRUE;
}