在Access中存储图片用OLE数据,但是VC中对应为CLongBinary类型。
现在我想把图片从数据库中读出,并用Picture控件显示。
请问如何处理?
GetChunk()方法后
void CEmployeeDlg::OnPaint()
{
CPaintDC dc(this); // device context for painting
// TODO: Add your message handler code here
if (m_Bitmap.GetSafeHandle() != NULL)
{
CDC dcCompatible;
BITMAP bmp;
m_Bitmap.GetBitmap(&bmp);
dcCompatible.CreateCompatibleDC(&dc);
CBitmap *oldbitmap = dcCompatible.SelectObject(&m_Bitmap);
dc.StretchBlt(658,60,108,142,&dcCompatible,0,0,bmp.bmWidth,bmp.bmHeight,SRCCOPY);
dcCompatible.SelectObject(oldbitmap);
}
// Do not call CDialog::OnPaint() for painting messages
}