incubator-ooo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Armin Le Grand <>
Subject Re: how Get Bitmap file from SVG module?
Date Thu, 24 May 2012 10:10:12 GMT
	Hi jianlizhao,

On 24.05.2012 10:57, jianlizhao wrote:
> Hi Armin:
> Read your letter, I know my idea is stupid.
> I would like to achieve an ADDON expansion in openoffice's write,
> The extension function is plug a new type of picture into openoffice's
> write, need following requirements
> 1) There were also ODF-compatible File Format adaptions needed.That is to
> say,
>     That is not installed the extended  on the openoffice's write  can open
> the saved file.
> 2) If the extension is installed, can use the extended functionality to deal
> with the inserted picture.
> This function is very similar to  your SVGIO, so I need to look deeper

Sorry, it is not similar and I would not suggest svgio as an example to
extend for picture formats. The way to extend picture formats is to look
at how e.g. png, jpeg and others are handled in the office and to extend
these by a filter. Be warned, this is a complex (and fragile) system
which will need a lot of care.

Your raw format is pixel data, so this will fit much better than svgio.
Svgio needed an exception to be hold at Graphic/GraphicObject at all,
this will not be needed for another pixel-based format and thus is a
very bad example for your case.

All this would need to be done in the core, there are deep vcl- and
tools-based mechanisms behind this, including the GraphicManager who
will automatically buffer the picture data and import/export it on
demand to rduce mem footprint. I think it cannot be done as an extension.

What you could do in an extension is to implement the loader (raw data
to Bitmap/BitmapEx) and insert that pixel data using API to the writer
somehow. It will then not be embedded as the original raw bitmap data,
but it will be in the system in a compatible way.


> Then modeled this idea, realization my needs.
> I have installed openoffice's SDK.Debugging through a simple C++ example of
> the addon.
> Do you have any good suggestions.
> Thanks...
> Best Regards!
> -----邮件原件-----
> 发件人: Armin Le Grand []
> 发送时间: 2012年5月23日 20:51
> 收件人:
> 主题: Re: how Get Bitmap file from SVG module?
> 	Hi jianlizhao,
> On 23.05.2012 11:06, jianlizhao wrote:
>> Hi Armin:
>> I ask you some question as below:
>> In  module svg, have two Interfaces, one is  XSVGPrinter, the other is
>> XSVGWriter.
> Both are interfaces, XSVGPrinter is not used at all and XSVGWriter is
> the current SVG export which has nothing to do with the new import.
> There also is no module svg, the module I added for the new SVG import
> is svgio.
>> 1) Can I use these interfaces, output Bitmap file?
> No.
>> 2) under the module svg, in the file of svgimagenode.cxx,
>> void extractFromGraphic (
>>               const Graphic&   rGraphic
>>               drawinglayer :: primitive2d :: Primitive2DSequence&
> rEmbedded,
>>               basegfx :: B2DRange&   rViewBox,
>>               BitmapEx&   rBitmapEx)
>> is the  parameters rBitmapEx get Bitmap file?
> I am not sure what you want to do. To work with imported SVGs you need a
> Graphic (see vcl and GraphicObject, too) where it is loaded. From
> Graphic you may try
>       const SvgDataPtr&  getSvgData() const;
> If getSvgData().is() there is a SVG graphic. At the contained SvgData
> you can use
>       const BitmapEx&  getReplacement() const;
> to get the BitmapEx of the SVG. There is no need to work with stuff from
> svgio directly. All usages work with it are using the service XSvgParser
> and do the work for you, where XSvgParser is implemented in svgio.
> I still do not understand what you want to do, please explain this, else
> I cannot really help you.
>> Thanks...
>> Best Regards!
> Sincerely,
> 	Armin
> --

View raw message