查看单个帖子
旧 2009-05-05, 10:25 AM   #1
yang686526
高级会员
 
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
yang686526 向着好的方向发展
默认 【转帖】export of rasterimage

export of rasterimage
export of rasterimage
can i export a rasterimage, without knowing its size in pixels (i.e. only the file name and the size in drawing units are known)?

could you clarify what do you mean by "export" - what is the expected result?
rasterimage entity stores its world position, clipping info etc. it also stores a reference to rasterimagedef. rasterimagedef contains raster file path, size in pixels.
sergey slezkin

we use dwgdirect to convert from internal format in dxf/dwg.
for each bitmap the following data are available:
file path/name and size in drawing units.
dxf/dwg requires however also pixel size of the bitmap.
can dwgdirect self find the bitmap size in pixels from the bitmap file?

while creating imagedef object dwgdirect does not determine raster resolution itself (it requires loading of the raster file). but these parameters are optional - autocad reports no errors in this situation.
sample code from odwriteex example works if optional parameters setting is commented out like below:
pimagedef->setsourcefilename("sample.jpg");
// pimagedef->setsize(odgevector2d(1024.0, 384.0));
// pimagedef->setresolutionmmperpixel(odgevector2d(0.0009 77, 0.000977));
pimagedef->setloaded(true);
// pimagedef->setresolutionunits(oddbrasterimagedef::kinc h);
sergey slezkin
yang686526离线中   回复时引用此帖
GDT自动化论坛(仅游客可见)