com.pietjonas.wmfwriter2d
Class ClipboardCopy

java.lang.Object
  extended bycom.pietjonas.wmfwriter2d.ClipboardCopy

public class ClipboardCopy
extends java.lang.Object

Uses JNI and the JavaClipboard DLL to copy a WMF or EMF to the Windows clipboard. Expects the WMF and EMF on the file system.


Constructor Summary
ClipboardCopy()
          Loads the JavaClipboard.dll
 
Method Summary
 int copy(java.lang.String wmfname, int width, int height, boolean isEmf)
          Copies a WMF (with standard header) or an EMF into the Windows clipboard.
 int copyWithPixelSize(java.lang.String wmfname, int width, int height, boolean isEmf)
          Copies a WMF (with standard header) or an EMF into the Windows clipboard.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClipboardCopy

public ClipboardCopy()
              throws java.lang.Exception
Loads the JavaClipboard.dll

Throws:
java.lang.Exception - if the dll load fails
Method Detail

copy

public int copy(java.lang.String wmfname,
                int width,
                int height,
                boolean isEmf)
Copies a WMF (with standard header) or an EMF into the Windows clipboard. Make sure the WMF does not contain the placeable header. Use WMF.writeHeader to create the proper WMF.

Parameters:
wmfname - The file name of the WMF
width - width of the WMF in units of 0.01 mm, can be 0
height - height of the WMF in units of 0.01 mm, can be 0
isEmf - if true file contains a EMF
Returns:
0 - OK, 1 - No memory, 2 - Can't open clipboard, 3 - Can't load WMF, 4 - Can't load EMF
See Also:
WMF

copyWithPixelSize

public int copyWithPixelSize(java.lang.String wmfname,
                             int width,
                             int height,
                             boolean isEmf)
Copies a WMF (with standard header) or an EMF into the Windows clipboard. Expects size of WMF in pixels units, using the screen resolution for translation into metric system. Make sure the WMF does not contain the placeable header. Use WMF.writeHeader to create the proper WMF.

Parameters:
wmfname - The file name of the WMF
width - width of the WMF in pixel units, can be 0
height - height of the WMF in pixel units, can be 0
isEmf - if true file contains a EMF
Returns:
0 - OK, 1 - No memory, 2 - Can't open clipboard, 3 - Can't load WMF, 4 - Can't load EMF
See Also:
copy(java.lang.String, int, int, boolean)