Re: Question: How do I rasterize an SVG to a BitmapEx

2012-02-29 Thread Thorsten Behrens
Andrew Higginson wrote:
> So if I am getting the SVG from the brand/ folder in the galaxy icon theme,
> what should I use to read it?
> 
Hi Andrew,

ok, some code pointers - look into vcl/source/app/brand.cxx,
Application::LoadBrandBitmap() on how to get to the brand dir - note
those $BRAND_BASE_DIR/program...  macros.

For actual reading, you'd probably want to use osl::File (in
osl/file.hxx), see e.g.
xmlhelp/source/cxxhelp/provider/inputstream.cxx for how to operate
it (open, read, getSize, close etc).

Create a local vector of the appropriate size to read the
svg into then.

HTH,

-- Thorsten


pgpJwyI4xCQKz.pgp
Description: PGP signature
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


Re: Question: How do I rasterize an SVG to a BitmapEx

2012-02-29 Thread Andrew Higginson
Hi,

On 28 February 2012 14:55, Thorsten Behrens wrote:

> Andrew Higginson wrote:
> > Sorry still don't understand, what class is the aSvgData? :/
> >
> Hi Andrew,
>
> ah, that was a somewhat made-up example - uno::Sequence
> for the methods I used there. But it really depends on how/where you
> get your data read.
>

Okay but this is also where I need help, I don't know how best to read it
(I am not familiar with the best class to use etc.)

So if I am getting the SVG from the brand/ folder in the galaxy icon theme,
what should I use to read it?


-- 
Andrew Higginson
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


Re: Question: How do I rasterize an SVG to a BitmapEx

2012-02-28 Thread Thorsten Behrens
Andrew Higginson wrote:
> Sorry still don't understand, what class is the aSvgData? :/
> 
Hi Andrew,

ah, that was a somewhat made-up example - uno::Sequence
for the methods I used there. But it really depends on how/where you
get your data read.

HTH,

-- Thorsten


pgpS75qAdVkhj.pgp
Description: PGP signature
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


Re: Question: How do I rasterize an SVG to a BitmapEx

2012-02-27 Thread Andrew Higginson
On 27 February 2012 15:04, Thorsten Behrens wrote:

> Andrew Higginson wrote:
> > Thanks, and finally, how do I get the aSvgData?
> >
> Just load your file into that - this RenderGraphic just wants a
> const sal_uInt8* ptr with the utf-8 encoded xml stream. ;)
>
> Cheers,
>
> -- Thorsten
>

Sorry still don't understand, what class is the aSvgData? :/

-- 
Andrew Higginson
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


Re: Question: How do I rasterize an SVG to a BitmapEx

2012-02-27 Thread Thorsten Behrens
Andrew Higginson wrote:
> Thanks, and finally, how do I get the aSvgData?
>
Just load your file into that - this RenderGraphic just wants a
const sal_uInt8* ptr with the utf-8 encoded xml stream. ;)
 
Cheers,

-- Thorsten


pgpMWjjjB12TW.pgp
Description: PGP signature
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


Re: Question: How do I rasterize an SVG to a BitmapEx

2012-02-27 Thread Andrew Higginson
 Hi,


>  const ::vcl::RenderGraphicRasterizer aRaster(
> "image/svg+xml",
> aSvgData.getLength(),
> aSvgData.getConstArray() );
>
>  BitmapEx aBmpEx = aRaster.Rasterize( Size(200,300) );
>
> Thanks, and finally, how do I get the aSvgData?

-- 
Andrew Higginson
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


Re: Question: How do I rasterize an SVG to a BitmapEx

2012-02-27 Thread Thorsten Behrens
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( 
 "image/svg+xml",
 aSvgData.getLength(),
 aSvgData.getConstArray() );

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

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

HTH,

-- Thorsten


pgpl7uRx4SUwu.pgp
Description: PGP signature
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


Question: How do I rasterize an SVG to a BitmapEx

2012-02-25 Thread Andrew Higginson
Hi,

I am trying to do some work on improving the About Dialog and I need to
be able to rasterize an SVG (which I guess I would have to pack in the
icon themes) to a vcl::BitmapEx

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.

So I would really appreciate it, if you could point me at the methods
needed, to get from the path of the SVG in the icon theme (i.e.
brand/shell/about.svg), to a BitmapEx.

Thanks

--
Andrew
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice