显示问题(过早结贴了,重贴600分不变) 从CStatic派生重载OnPaint(),用IPicture接口,把picture画(Render)上去就ok! 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 jazzrabbit:please tell me how to use IPicture //全局变量LPPICTURE gpPicture;-------------CPicture fromthe;fromthe=this->m_picclip.GetGraphicCell(10);fromthe.m_lpDispatch->QueryInterface(IID_IPicture,(void **)&(gpPicture));-----------重载OnPaint():if(gpPicture){CPaintDC dc(this); long hmWidth;long hmHeight;gpPicture->get_Width(&hmWidth);gpPicture->get_Height(&hmHeight);// convert himetric to pixelsint nWidth= MulDiv(hmWidth,GetDeviceCaps(dc.m_hDC, LOGPIXELSX), HIMETRIC_INCH);int nHeight= MulDiv(hmHeight, GetDeviceCaps(dc.m_hDC, LOGPIXELSY), HIMETRIC_INCH);RECT rc;this->GetClientRect(&rc);// display picture using IPicture::RendergpPicture->Render(dc.m_hDC, 0, 0, nWidth, nHeight, 0, hmHeight, hmWidth, -hmHeight, &rc);} 改变richedit某行的背景色 怎样响应CSplitterWnd 子窗口中的按钮点击事件??高手请进~~ 如何监控本机端口发出和接收的数据 Unicode环境,怎样用strcmp,strcpy? 编程实现系统登陆验证问题。求助 关于AfxGetMainWnd()->m_hWnd 我想让程序窗口一执行就最大化? 那位有电子称资料。谢谢了 在MDI的菜单“窗口”中会自动产生以打开的子窗口的标题!怎样把它隐藏掉! 如何在下拉菜单中的文字前添加一个图标? 如何用右键点击树控件时,获得当前选中项的文本? 一定给分!!! 用 FTP 下载与 普通的下载(如蚂蚁)有什么不同
please tell me how to use IPicture
LPPICTURE gpPicture;-------------
CPicture fromthe;
fromthe=this->m_picclip.GetGraphicCell(10);
fromthe.m_lpDispatch->QueryInterface(IID_IPicture,(void **)&(gpPicture));-----------
重载OnPaint():
if(gpPicture)
{
CPaintDC dc(this);
long hmWidth;
long hmHeight;
gpPicture->get_Width(&hmWidth);
gpPicture->get_Height(&hmHeight);
// convert himetric to pixels
int nWidth= MulDiv(hmWidth,GetDeviceCaps(dc.m_hDC, LOGPIXELSX), HIMETRIC_INCH);
int nHeight= MulDiv(hmHeight, GetDeviceCaps(dc.m_hDC, LOGPIXELSY), HIMETRIC_INCH);
RECT rc;
this->GetClientRect(&rc);
// display picture using IPicture::Render
gpPicture->Render(dc.m_hDC, 0, 0, nWidth, nHeight, 0, hmHeight, hmWidth, -hmHeight, &rc);
}