Question: How do I rasterize an SVG to a BitmapEx

Thorsten Behrens thb at
Mon Feb 27 01:30:49 PST 2012

Andrew Higginson wrote:
> I can see there are various classes (i.e. vcl::SVGReader and
> vcl::RenderGraphicRasterizer) which may do the job, however I need to
> rasterize it to a specific resolution (pretty much what
> vcl::RenderGraphicRasterizer::Rasterize does) however I don't want to
> duplicate any code.
Hi Andrew,

this should do:

 const ::vcl::RenderGraphicRasterizer aRaster( 
     aSvgData.getConstArray() );

 BitmapEx aBmpEx = aRaster.Rasterize( Size(200,300) );

(with your desired size filled in above, of course)


-- Thorsten
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <>

More information about the LibreOffice mailing list