![]() |
【转帖】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 |
所有的时间均为北京时间。 现在的时间是 10:29 AM. |