[wx-dev] Using SVG in wxWidgets Apps.

Brian Vanderburg II BrianVanderburg2 at aim.com
Thu Jul 3 14:13:07 PDT 2008


I checked it out.  It only writes SVG from DC commands.  I'm looking for 
reading an SVG.  I'm found librsvg and am checking out librsvg 2.22 for 
now since it only depends on libxml and libart and see if I can get what 
I need out of it.

Brian Vanderburg II

Chris Elliott wrote:
> there is a wxSVGFileDC class, which allows you to write SVG, including 
> creating PNG bitmaps inside the SVG wrapper.
>
> http://docs.wxwidgets.org/trunk/classwx_s_v_g_file_d_c.html
>
> in 2.8 and earlier, it was in the contrib section.
>
> Let me know of any bugs
> chris
>
> On 3 Jul 2008, at 17:10, Brian Vanderburg II wrote:
>
>> Is there any library or any code samples that could be used to use 
>> SVG documents in a wxWidgets application.  Particularly, creating a 
>> region from a group and a bitmap from a group, perhaps with a similar 
>> syntax.
>>
>> SVGDocument doc("myfile.svg"); // Perhaps also support svgz
>> if(doc.IsOk())
>> {
>>   wxRegion region(doc.RegionFromObject('group1'); // Load a region 
>> from a group, where 1 svg unit = 1 pixel
>>
>>   // Load bitmaps
>>   wxBitmap up(doc.BitmapFromObject('button1up')); // Load a bitmap
>>   wxBitmap down(doc.BitmapFromObject('button1down'), wxSize(64, 32)); 
>> // Load a bitmap but scale before rasterizing
>>
>>   // Perhaps support an alpha channel instead of monochome mask
>>   wxBitmap bmp(doc.AlphaBitmapFromObject(...));
>> }
>>
>> Brian Vanderburg II
>> _______________________________________________
>> wx-dev mailing list
>> wx-dev at lists.wxwidgets.org
>> http://lists.wxwidgets.org/mailman/listinfo/wx-dev
>
> _______________________________________________
> wx-dev mailing list
> wx-dev at lists.wxwidgets.org
> http://lists.wxwidgets.org/mailman/listinfo/wx-dev



More information about the wx-dev mailing list