查看单个帖子
旧 2009-05-07, 04:22 PM   #1
yang686526
高级会员
 
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
yang686526 向着好的方向发展
默认 【转帖】static Implementation Of Svgexport V1.13

static implementation of svgexport v1.13
static implementation of svgexport v1.13
the createsvgdevice() function previous place in the svgexport.h is no longer present. what do i do to create a odgsdeviceptr for svg exporting ??
do you have a simpel example of svgexport like dwg...
regards
soeren
// create output file
odstreambufptr file = odsystemservices()->createfile( bfullpathname, oda::kfilewrite );
if ( !file.isnull() )
{
odgsdeviceptr dev = createsvgdevice()->create();
// odgsdeviceptr dev = odsvgdevice::createobject();
if ( !dev.isnull() )
{
// setup output stream
dev->properties()->putat( "output", file.get() );
// size of pixel in device units
dev->properties()->putat( "lineweightscale", odrxvariantvalue( m_svglineweightscale ) );
// number of digits in float values (6 by default)
dev->properties()->putat( "precision", odrxvariantvalue( 6l ) );
// where copy images
cstring bbasepath;
bbasepath.format("%s%s",m_filedrive,m_filepath);
dev->properties()->putat( "imagebase", odrxvariantvalue( odstring( bbasepath ) ) );
// prefix to prepend to image name
dev->properties()->putat( "imageurl", odrxvariantvalue( odstring("./") ) );
// default image format
dev->properties()->putat( "defaultimageext", odrxvariantvalue( odstring(".png") ) );
// generic font family
dev->properties()->putat( "genericfontfamily", odrxvariantvalue( odstring( "sans-serif" ) ) );
// set active palette
dev->setlogicalpalette( odcmacadlightpalette(), 256 );
// prepare database context for device
odgicontextfordbdatabaseptr pdwgcontext = odgicontextfordbdatabase::createobject();
pdwgcontext->setdatabase( m_pdb );
// do not render paper
pdwgcontext->setplotgeneration( true );
// prepare the device to render the active layout in this database.
odgsdeviceptr wrapper = oddbgsmanager::setupactivelayoutviews( dev, pdwgcontext );
// setup device coordinate space
wrapper->onsize( odgsdcrect( 0, 768, 1024, 0 ) );
// initiate rendering.
wrapper->update( 0 );
}
else
{
oda_fail();
}
}
svg export is now a separate module that must be registered for a static library usage, e.g.
odgsmoduleptr pmodule = :drxdynamiclinker()->loadmodule("dd_svgexport.drx");
if ( !pmodule.isnull() )
odgsdeviceptr dev = pmodule->createdevice();
this device can then be used as in 1.12.
i think that example is in odamfcapp.
regards,
anita
yang686526离线中   回复时引用此帖
GDT自动化论坛(仅游客可见)