Hi jianlizhao, On 24.05.2012 16:07, jianlizhao wrote: > Hi Armin: > I am very glad to receipt your letter, > > I see the following content in your blog: > There were also ODF-compatible File Format adaptions needed, more concrete > the in ODF already contained and described multi-image support. In ODF, the > original SVG is now embedded to the 'Pictures' folder inside the ODF file as > one would expect from such a feature and can be easily extracted (unzip the > ODF file and there you are). There is also a Png file written as replacement > image. The draw:frame is now multi-image capable (as the spec allows). In > the case of a SVG it writes a good quality Png and the original SVG as > draw:image elements. Since older (and other) office versions are only > capable of loading a single (and thus the first) image, the Png is written > first. This allows file exchange with other and older offices without > breaking backward compatibility and/or ODF file exchange. > > I have two questions : > 1) I would also like to use this method to insert the picture, so that in > document will retain the original file, the original file is there are > other useful.
To achieve this you have to add the needed code to the core (similar as jpeg and png are added). This includes import code to get the data into a Bitmap/BitmapEx. This is uniquely held (using a unique ID calculated based on the bitmap data, there is one calculation defined for each format) at the GraphicManager and can be accessed using Graphic/GraphicObject. AFAIK it is also possible to hold the original raw data at the entry in the GraphicManager (to be able to write the original again in unchanged form without needing to export it to it's format). The feature you mentioned above is needed for file formats which differ in content, in Your case this is not needed since a e.g. reduced data BitmapEx can be recreated without data loss from your raw data. It makes no sense to write both, so no need for this feature. > 2) How do I access the original file. The Graphic holding it (and the contact with the GraphicManager) may have it as raw data, but also has a link to a temporary storage (using the temp on your system) where it is swapped out. To Access, use Graphic/GraphicObject. I repeat here: It is no easy task to add a graphic format to the core. I'm also not the specialist for that, maybe someone else knows in more details about exactly what steps have to be done to implement it. HTH! > Thanks... > Best Regards! > > > -----邮件原件----- > 发件人: Armin Le Grand [mailto:[email protected]] > 发送时间: 2012年5月24日 18:10 > 收件人: [email protected] > 主题: Re: how Get Bitmap file from SVG module? > > Hi jianlizhao, > [..] Sincerely, Armin -- ALG
