sventon subversion web client - http://www.sventon.org
[show recent changes]
 
  Help
HEAD
Rev: 10305 - svn://svn.freehep.org/svn / freehep / branches / vectorgraphics-emfplus / freehep-graphicsio-emf / src / main / java / org / freehep / graphicsio / emf / gdiplus / Header.java
Unified Diff View - Header.java
Search for Help
/freehep/branches/vectorgraphics-emfplus/freehep-graphicsio-emf/src/main/java/org/freehep/graphicsio/emf/gdiplus/Header.java @ revision 10304
/freehep/branches/vectorgraphics-emfplus/freehep-graphicsio-emf/src/main/java/org/freehep/graphicsio/emf/gdiplus/Header.java @ revision 10305
@@ -5,7 +5,6 @@ import org.freehep.graphicsio.emf.EMFInputStream; import org.freehep.graphicsio.emf.EMFOutputStream; -import org.freehep.graphicsio.emf.EMFTag; /**  * The Header metafile record marks the beginning of EMF+ data within the @@ -16,30 +15,44 @@  */ public class Header extends EMFPlusTag { - private int hDpi = 72; - private int vDpi = 72; +    public final static int EMF_PLUS_ONLY = 0x00; +    public final static int EMF_PLUS_DUAL = 0x01; + + private int hDpi = 120; + private int vDpi = 120;  public Header() {   super(1,1);  } + +    public Header(int type) { +        this(); +        this.flags = type; +    } - @Override  public EMFPlusTag read(int tagID, int flags, EMFInputStream emf, int len)    throws IOException {   Header tag = new Header();   tag.flags = flags; +        emf.readUINT();   emf.readUINT();   tag.hDpi = emf.readUINT();   tag.vDpi = emf.readUINT();   return tag;  } - @Override - public void write(int tagID, EMFOutputStream emf) throws IOException { -  emf.writeUINT(0x0110C0DB); + public void write(int tagID, int flags, EMFOutputStream emf) throws IOException { +  emf.writeUINT(0xDBC01001);   emf.writeUINT(0x00000001);   emf.writeUINT(hDpi);   emf.writeUINT(vDpi);  } +    public String toString() { +        StringBuffer sb = new StringBuffer(super.toString()); +        sb.append("\n"); +        sb.append(" hDPI: "+hDpi+"\n"); +        sb.append(" vDPI: "+vDpi); +        return sb.toString(); +    } }


feed icon

sventon 2.5.1