void PngOutlineText::TextOutline( Gdiplus::Color clrText, Gdiplus::Color clrOutline, int nThickness) { TextOutlineStrategy* pStrat = new TextOutlineStrategy(); pStrat->Init(clrText,clrOutline,nThickness); if(m_pTextStrategy) delete m_pTextStrategy; m_pTextStrategy = pStrat; TextOutlineStrategy* pStrat2 = new TextOutlineStrategy(); pStrat2->Init( Gdiplus::Color(clrText.GetAlpha(),255,255,255), Gdiplus::Color(clrOutline.GetAlpha(),255,255,255), nThickness); if(m_pTextStrategyMask) delete m_pTextStrategyMask; m_pTextStrategyMask = pStrat2; }
void PngOutlineText::Shadow( Gdiplus::Color color, int nThickness, Gdiplus::Point ptOffset) { TextOutlineStrategy* pStrat = new TextOutlineStrategy(); pStrat->Init(Gdiplus::Color(0,0,0,0),color,nThickness); if(m_pShadowStrategy) delete m_pShadowStrategy; m_ptShadowOffset = ptOffset; m_pShadowStrategy = pStrat; TextOutlineStrategy* pStrat2 = new TextOutlineStrategy(); pStrat2->Init( Gdiplus::Color(0,0,0,0), Gdiplus::Color(color.GetAlpha(),255,255,255), nThickness); if(m_pShadowStrategyMask) delete m_pShadowStrategyMask; m_pShadowStrategyMask = pStrat2; m_clrShadow = color; if(m_pFontBodyShadow) delete m_pFontBodyShadow; TextOutlineStrategy* pFontBodyShadow = new TextOutlineStrategy(); pFontBodyShadow->Init(Gdiplus::Color(255,255,255),Gdiplus::Color(0,0,0,0),0); m_pFontBodyShadow = pFontBodyShadow; if(m_pFontBodyShadowMask) delete m_pFontBodyShadowMask; TextOutlineStrategy* pFontBodyShadowMask = new TextOutlineStrategy(); pFontBodyShadowMask->Init(Gdiplus::Color(color.GetAlpha(),255,255,255),Gdiplus::Color(0,0,0,0),0); m_pFontBodyShadowMask = pFontBodyShadowMask; m_bDiffuseShadow = false; }
void OutlineText::TextOutline( Gdiplus::Brush* pbrushText, Gdiplus::Color clrOutline, int nThickness) { TextOutlineStrategy* pStrat = new TextOutlineStrategy(); pStrat->Init(pbrushText,clrOutline,nThickness); if(m_pTextStrategy) delete m_pTextStrategy; m_pTextStrategy = pStrat; }