16位位图灰度化。跪求大神解答啊。
void CYY_Wince1Dlg::OnBnClickedFileOpen()
{
CFileDialog dlg(true,_T("*.bmp"),NULL,OFN_HIDEREADONLY|OFN_OVERWRITEPROMPT|OFN_ALLOWMULTISELECT,_T("image file(*.bmp;*.jpg)|*.bmp;*.jpg|All Files(*.*)|*.*||"),NULL);
if (dlg.DoModal()==IDOK)
{
CString path;
path=dlg.GetPathName();
DrawPicToHDC(path);
}
}
void CYY_Wince1Dlg::DrawPicToHDC(CString p)
{
CDC *pDC;
CRect rc;
GetDlgItem(IDC_EDIT1)->GetClientRect(rc);
pDC=GetDlgItem(IDC_EDIT1)->GetDC();
IImage *m_pImage[1];
IImagingFactory *m_pImagingFactory;
HRESULT hr;
hr=CoInitializeEx(NULL,COINIT_MULTITHREADED);
hr=CoCreateInstance(CLSID_ImagingFactory,NULL,CLSCTX_INPROC_SERVER,IID_IImagingFactory,(void**)&m_pImagingFactory);
hr=m_pImagingFactory->CreateImageFromFile(p,&m_pImage[1]);
hr=m_pImage->Draw(pDC->m_hDC,&rc,NULL);
?
?
?
}到这里我把图片显示出来了,图片是16位位图,想在?部分转换成灰度化然后输出。求指教啊 WinCE Bitmap 位图
[解决办法]
http://blog.csdn.net/likezhaobin/article/details/6915754
[解决办法]