高级会员
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
|
【转帖】why Cant I Get The Preview Bitmap
why can't i get the preview bitmap?
why can't i get the preview bitmap?
the following is my code :
////////////////////////////////////////////////////////////////////////////
void cpreviewdib::setpreviewfile(lpctstr lpfilename)
{
cstring csfilename(lpfilename);
m_odimage.bmp.clear();
m_odimage.header.clear();
m_odimage.wmf.clear();
if ( ! csfilename.getlength() )
return;
cstring ext = csfilename.right(4);
ext.makelower();
if ( ext == ".dwg" || ext == ".dxf" )
{
odstreambufptr pfile;
odstaticrxobject<myservices> svcs;
svcs.disableoutput(false);//true or false?//1
odinitialize(&svcs);
pfile =svcs.createfile(lpfilename);
try
{
oddbgetpreviewbitmap(pfile, &m_odimage);
}
catch(...)
{
return;
}
}
}
//////////////////////////////////////////////////////////////////////////////////fff">undefined
the result is that m_odimage.hasbmp() ==false.
this function will return the preview only if it exists in the file. but saving preview to dwg or dxf is optional.
sergey slezkin
|