如题,使用GDI+对路径作纹理填充时,GDI对象狂增。
代码如下
//纹理填充,从DLL中读取纹理位图数据,生成一个Pattern画刷
#ifdef _DEBUG
static CDllResource ResDll("GraphResD.dll");
#else
static CDllResource ResDll("GraphRes.dll");
#endif
HBITMAP hBitmap = ResDll.LoadBitmap(TxtStyle.FillStyle.pattern_style);
if( hBitmap == NULL )
return ;
Bitmap* pBmp = NULL;
pBmp = Bitmap::FromHBITMAP(hBitmap,NULL);
ASSERT(pBmp);
//Image* pImage = Gdiplus::Image::
TextureBrush tb(pBmp);
GraphicsPath path;
SetFontPath(pszTxt,TxtStyle,path);
Graphics graph(pDC->GetSafeHdc());
graph.SetSmoothingMode(SmoothingModeAntiAlias); //抗锯齿
//graph.SetCompositingMode(CompositingModeSourceCopy);
graph.FillPath(&tb, &path);
SAFEDELETE(pBmp);
大伙帮忙看看问题出在了哪儿