Since WMF is a a vector-based image format, converting it to a Java image is intensive indeed. First you create a BufferedImage object. Next, we obtain athe Image's graphic instance. Then we draw on the Graphics, executing the various WMF operations.
The good news is that our friends Batik at http://xml.apache.org/ have already written the code to do this. For instance, look at org.apache.batik.transcoder.wmf.tosvg.WMFPainter.java. I think this means, I can return a WMF byte stream as a convenience method. I'll add appropriate query methods to determine if the Clipboard structure contains WMF data, CF_DIB, custom format, or non-Windows formats. It has no ties to X. This seems to meet everyone's lightweight requirements. I can write demo code that uses Batik libraries to rasterize the WMF file if anyone is interested, or simply mention it as an option. Can someone send me a PPT file create on a Mac? I'd like to look at the thumbnail format in it. I may also write up convenience code to extract CF_DIB (Cliboard Format - Device Independent Bitmap) files, but that is going to be a TODO since WMF is the recommended way to go. - Drew Quoting "Andrew C. Oliver" <[EMAIL PROTECTED]>: > At some point we need to combine org.apache.poi.util.LittleEndian and > org.apache.poi.hspsf.littleendian to one general purpose thing. > Eventually this should migrate to Jakarta commons. I'll look around > for docs on WMF. you might check chicago.sourceforge.net. > > Drew Varner wrote: > > >Hey Folks, > > > >I hacked out some code to extract a WMF file from the byte array > returned by > > > >getThumbnail() > > > >I saved the WMF file to disk and imported it into Word so I think I am > good. I > >don't know that I can convert WMF to something meaningful in Java > though. > > > >Some of the parameters in the headers are SHORTs. > > > >Should we add the method Word.shortValue() or implement numeric types > per the > >FIXME in the Javadocs. > >___________________ > >Drew Varner > >[EMAIL PROTECTED] > > > > > > ___________________ Drew Varner [EMAIL PROTECTED]
