Hello,
Some of the WMF Metafile operand are not
implemented in the converter (v. 1.5 of Batik), for example META_PATBLT. I found that this operand is heavily
used in WMF files for filling rectangles (see example
attached).
I added this in my copy of Batik files, and it is
working correctly. If you are are interested by supporting this operand, here is
how to do it :
case
WMFConstants.META_PATBLT
:
{ mr.numPoints = recSize; mr.functionId = functionId;
int rop = readInt( is
);
int height = readShort( is ); int width = readShort( is ); int left = readShort( is ); int top = readShort( is ); mr.AddElement( new Integer( rop )); mr.AddElement( new Integer( height )); mr.AddElement( new Integer( width )); mr.AddElement( new Integer( top )); mr.AddElement( new Integer( left )); records.addElement( mr ); } break;
case
WMFConstants.META_PATBLT:
{ int rop = mr.ElementAt( 0 ).intValue(); int height = mr.ElementAt( 1 ).intValue(); int width = mr.ElementAt( 2 ).intValue(); int left = mr.ElementAt( 3 ).intValue(); int top = mr.ElementAt( 4 ).intValue(); Color clr = null; boolean ok = false; if (rop == WMFConstants.META_BLACKNESS) { clr = Color.BLACK; ok = true; } else if (rop == WMFConstants.META_WHITENESS) { clr = Color.WHITE; ok = true; } else if (rop == WMFConstants.META_PATCOPY) { if ( brushObject >= 0 ) { setBrushColor( currentStore, g, brushObject ); ok = true; } } if (ok) { if (clr != null) { g.setColor(clr); } else { setBrushColor( currentStore, g, brushObject ); } g.fillRect( left, top, width, height); } } break; |
META_PATBLT.wmf
Description: Binary data
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]