piet.jonas.com

WMFWriter

Home News Example Features Download Usage


 WMFViewer 

 WMF2Viewer 


 JSF FormBuilder 

Example

The example is a small demo JDK 1.2 application WMFWriterDemo (source, class files) which uses the WMFWriter2D package to create a WMF. Here is a screenshot:

WMFWriterDemo screenshot

It demonstrates all methods to write to a Windows Metafile:

  • 1.Row, 1.Column: Standard drawing methods of the java.awt.Graphics object - WMFGraphics

  • 2.Row, 1.Column: Standard drawing methods of the java.awt.Graphics object - WMFGraphics2D

  • 1.Row, 2.Column: Special drawing methods in WMFGraphics for drawing lines with different styles and thickness, filling shapes with patterns and drawing with rotated fonts.

  • 2.Row, 2.Column: Standard drawing methods of the java.awt.Graphics2D object (Java 2D) with WMFGraphics2D

  • 1.Row, 3.Column (see WMFWriterDemo.wmf): GDI routines of the WMF class directly

  • 2.Row, 3.Column: Demonstration of GDI text drawing for fonts which are uniformly scaled, not clipped and not sheared (New in 2.1).


This is the Windows Metafile created by WMFWriterDemo:

WMFWriterDemo.wmf

and it looks like:

GIF-Image of WMFWriterDemo.wmf

As you can see, all AWT Graphics and Java 2D commands have been written correctly. In addition Windows Metafile features like line thickness, pattern fills etc. can be used as well. This is what you get by the demo version of the WMF package which can be downloaded from here:

Demo version of the WMFWriter package

 





Piet Jonas