void CView::OnDraw(SURFACE* psurfTarget)
{
//简略片段 希望大家能够看懂
m_ImageCenter.Load("center.psd");
m_ImageCenter.DrawImage(m_ImagePanal,(width-m_ImageCenter.GetWidth())/2,(height- m_ImageCenter.GetHeight())/2);
}
class XXX:
void Load(char* szPath ,SURFACE_STYLE dwStyle=PSD_SURFACE, bool bIsCommonSurface = false, bool bIsFromFile = false)
{
m_pImage = AfxGetViewManager()->CreateSurface(szPath, dwStyle,bIsCommonSurface,bIsFromFile);
}
void DrawImage(SURFACE* dest,int x,int y)
{
if(m_pImage)
m_pImage->Blit(dest,x,y);
};
我遇到两个疑问:
1.不能显示png图片, 只能支持psd图片(原项目中都使用该格式)? 怎样才能显示png的。
2.显示一些颜色比较单一的图片没问题,但一让显示颜色比较复杂的图片就显示不出来了,比如:一个表格:有文字,表格的线颜色不一样的。该怎么做呢。