Java 类com.lowagie.text.pdf.codec.wmf.InputMeta 实例源码

项目:itext2    文件:ImgWMF.java   
/**
* This method checks if the image is a valid WMF and processes some parameters.
* @throws BadElementException
* @throws IOException
*/

   private void processParameters() throws BadElementException, IOException {
       type = IMGTEMPLATE;
       originalType = ORIGINAL_WMF;
       InputStream is = null;
       try {
           String errorID;
           if (rawData == null){
               is = url.openStream();
               errorID = url.toString();
           }
           else{
               is = new java.io.ByteArrayInputStream(rawData);
               errorID = "Byte array";
           }
           InputMeta in = new InputMeta(is);
           if (in.readInt() != 0x9AC6CDD7)  {
               throw new BadElementException(errorID + " is not a valid placeable windows metafile.");
           }
           in.readWord();
           int left = in.readShort();
           int top = in.readShort();
           int right = in.readShort();
           int bottom = in.readShort();
           int inch = in.readWord();
           dpiX = 72;
           dpiY = 72;
           scaledHeight = (float)(bottom - top) / inch * 72f;
           setTop(scaledHeight);
           scaledWidth = (float)(right - left) / inch * 72f;
           setRight(scaledWidth);
       }
       finally {
           if (is != null) {
               is.close();
           }
           plainWidth = getWidth();
           plainHeight = getHeight();
       }
   }
项目:DroidText    文件:ImgWMF.java   
/**
* This method checks if the image is a valid WMF and processes some parameters.
* @throws BadElementException
* @throws IOException
*/

   private void processParameters() throws BadElementException, IOException {
       type = IMGTEMPLATE;
       originalType = ORIGINAL_WMF;
       InputStream is = null;
       try {
           String errorID;
           if (rawData == null){
               is = url.openStream();
               errorID = url.toString();
           }
           else{
               is = new java.io.ByteArrayInputStream(rawData);
               errorID = "Byte array";
           }
           InputMeta in = new InputMeta(is);
           if (in.readInt() != 0x9AC6CDD7)  {
               throw new BadElementException(errorID + " is not a valid placeable windows metafile.");
           }
           in.readWord();
           int left = in.readShort();
           int top = in.readShort();
           int right = in.readShort();
           int bottom = in.readShort();
           int inch = in.readWord();
           dpiX = 72;
           dpiY = 72;
           scaledHeight = (float)(bottom - top) / inch * 72f;
           setTop(scaledHeight);
           scaledWidth = (float)(right - left) / inch * 72f;
           setRight(scaledWidth);
       }
       finally {
           if (is != null) {
               is.close();
           }
           plainWidth = getWidth();
           plainHeight = getHeight();
       }
   }
项目:MesquiteArchive    文件:ImgWMF.java   
/**
* This method checks if the image is a valid WMF and processes some parameters.
* @throws BadElementException
* @throws IOException
*/

   private void processParameters() throws BadElementException, IOException {
       type = IMGTEMPLATE;
       originalType = ORIGINAL_WMF;
       InputStream is = null;
       try {
           String errorID;
           if (rawData == null){
               is = url.openStream();
               errorID = url.toString();
           }
           else{
               is = new java.io.ByteArrayInputStream(rawData);
               errorID = "Byte array";
           }
           InputMeta in = new InputMeta(is);
           if (in.readInt() != 0x9AC6CDD7)  {
               throw new BadElementException(errorID + " is not a valid placeable windows metafile.");
           }
           in.readWord();
           int left = in.readShort();
           int top = in.readShort();
           int right = in.readShort();
           int bottom = in.readShort();
           int inch = in.readWord();
           dpiX = 72;
           dpiY = 72;
           scaledHeight = (float)(bottom - top) / inch * 72f;
           setTop(scaledHeight);
           scaledWidth = (float)(right - left) / inch * 72f;
           setRight(scaledWidth);
       }
       finally {
           if (is != null) {
               is.close();
           }
           plainWidth = width();
           plainHeight = height();
       }
   }
项目:MesquiteArchive    文件:ImgWMF.java   
/**
* This method checks if the image is a valid WMF and processes some parameters.
* @throws BadElementException
* @throws IOException
*/

   private void processParameters() throws BadElementException, IOException {
       type = IMGTEMPLATE;
       originalType = ORIGINAL_WMF;
       InputStream is = null;
       try {
           String errorID;
           if (rawData == null){
               is = url.openStream();
               errorID = url.toString();
           }
           else{
               is = new java.io.ByteArrayInputStream(rawData);
               errorID = "Byte array";
           }
           InputMeta in = new InputMeta(is);
           if (in.readInt() != 0x9AC6CDD7)  {
               throw new BadElementException(errorID + " is not a valid placeable windows metafile.");
           }
           in.readWord();
           int left = in.readShort();
           int top = in.readShort();
           int right = in.readShort();
           int bottom = in.readShort();
           int inch = in.readWord();
           dpiX = 72;
           dpiY = 72;
           scaledHeight = (float)(bottom - top) / inch * 72f;
           setTop(scaledHeight);
           scaledWidth = (float)(right - left) / inch * 72f;
           setRight(scaledWidth);
       }
       finally {
           if (is != null) {
               is.close();
           }
           plainWidth = width();
           plainHeight = height();
       }
   }
项目:MesquiteArchive    文件:ImgWMF.java   
/**
* This method checks if the image is a valid WMF and processes some parameters.
* @throws BadElementException
* @throws IOException
*/

   private void processParameters() throws BadElementException, IOException {
       type = IMGTEMPLATE;
       originalType = ORIGINAL_WMF;
       InputStream is = null;
       try {
           String errorID;
           if (rawData == null){
               is = url.openStream();
               errorID = url.toString();
           }
           else{
               is = new java.io.ByteArrayInputStream(rawData);
               errorID = "Byte array";
           }
           InputMeta in = new InputMeta(is);
           if (in.readInt() != 0x9AC6CDD7)  {
               throw new BadElementException(errorID + " is not a valid placeable windows metafile.");
           }
           in.readWord();
           int left = in.readShort();
           int top = in.readShort();
           int right = in.readShort();
           int bottom = in.readShort();
           int inch = in.readWord();
           dpiX = 72;
           dpiY = 72;
           scaledHeight = (float)(bottom - top) / inch * 72f;
           setTop(scaledHeight);
           scaledWidth = (float)(right - left) / inch * 72f;
           setRight(scaledWidth);
       }
       finally {
           if (is != null) {
               is.close();
           }
           plainWidth = width();
           plainHeight = height();
       }
   }
项目:MesquiteArchive    文件:ImgWMF.java   
/**
* This method checks if the image is a valid WMF and processes some parameters.
* @throws BadElementException
* @throws IOException
*/

   private void processParameters() throws BadElementException, IOException {
       type = IMGTEMPLATE;
       originalType = ORIGINAL_WMF;
       InputStream is = null;
       try {
           String errorID;
           if (rawData == null){
               is = url.openStream();
               errorID = url.toString();
           }
           else{
               is = new java.io.ByteArrayInputStream(rawData);
               errorID = "Byte array";
           }
           InputMeta in = new InputMeta(is);
           if (in.readInt() != 0x9AC6CDD7)  {
               throw new BadElementException(errorID + " is not a valid placeable windows metafile.");
           }
           in.readWord();
           int left = in.readShort();
           int top = in.readShort();
           int right = in.readShort();
           int bottom = in.readShort();
           int inch = in.readWord();
           dpiX = 72;
           dpiY = 72;
           scaledHeight = (float)(bottom - top) / inch * 72f;
           setTop(scaledHeight);
           scaledWidth = (float)(right - left) / inch * 72f;
           setRight(scaledWidth);
       }
       finally {
           if (is != null) {
               is.close();
           }
           plainWidth = width();
           plainHeight = height();
       }
   }
项目:MesquiteArchive    文件:ImgWMF.java   
/**
* This method checks if the image is a valid WMF and processes some parameters.
* @throws BadElementException
* @throws IOException
*/

   private void processParameters() throws BadElementException, IOException {
       type = IMGTEMPLATE;
       originalType = ORIGINAL_WMF;
       InputStream is = null;
       try {
           String errorID;
           if (rawData == null){
               is = url.openStream();
               errorID = url.toString();
           }
           else{
               is = new java.io.ByteArrayInputStream(rawData);
               errorID = "Byte array";
           }
           InputMeta in = new InputMeta(is);
           if (in.readInt() != 0x9AC6CDD7)  {
               throw new BadElementException(errorID + " is not a valid placeable windows metafile.");
           }
           in.readWord();
           int left = in.readShort();
           int top = in.readShort();
           int right = in.readShort();
           int bottom = in.readShort();
           int inch = in.readWord();
           dpiX = 72;
           dpiY = 72;
           scaledHeight = (float)(bottom - top) / inch * 72f;
           setTop(scaledHeight);
           scaledWidth = (float)(right - left) / inch * 72f;
           setRight(scaledWidth);
       }
       finally {
           if (is != null) {
               is.close();
           }
           plainWidth = width();
           plainHeight = height();
       }
   }
项目:MesquiteArchive    文件:ImgWMF.java   
/**
* This method checks if the image is a valid WMF and processes some parameters.
* @throws BadElementException
* @throws IOException
*/

   private void processParameters() throws BadElementException, IOException {
       type = IMGTEMPLATE;
       originalType = ORIGINAL_WMF;
       InputStream is = null;
       try {
           String errorID;
           if (rawData == null){
               is = url.openStream();
               errorID = url.toString();
           }
           else{
               is = new java.io.ByteArrayInputStream(rawData);
               errorID = "Byte array";
           }
           InputMeta in = new InputMeta(is);
           if (in.readInt() != 0x9AC6CDD7)  {
               throw new BadElementException(errorID + " is not a valid placeable windows metafile.");
           }
           in.readWord();
           int left = in.readShort();
           int top = in.readShort();
           int right = in.readShort();
           int bottom = in.readShort();
           int inch = in.readWord();
           dpiX = 72;
           dpiY = 72;
           scaledHeight = (float)(bottom - top) / inch * 72f;
           setTop(scaledHeight);
           scaledWidth = (float)(right - left) / inch * 72f;
           setRight(scaledWidth);
       }
       finally {
           if (is != null) {
               is.close();
           }
           plainWidth = width();
           plainHeight = height();
       }
   }
项目:MesquiteArchive    文件:ImgWMF.java   
/**
* This method checks if the image is a valid WMF and processes some parameters.
* @throws BadElementException
* @throws IOException
*/

   private void processParameters() throws BadElementException, IOException {
       type = IMGTEMPLATE;
       originalType = ORIGINAL_WMF;
       InputStream is = null;
       try {
           String errorID;
           if (rawData == null){
               is = url.openStream();
               errorID = url.toString();
           }
           else{
               is = new java.io.ByteArrayInputStream(rawData);
               errorID = "Byte array";
           }
           InputMeta in = new InputMeta(is);
           if (in.readInt() != 0x9AC6CDD7)  {
               throw new BadElementException(errorID + " is not a valid placeable windows metafile.");
           }
           in.readWord();
           int left = in.readShort();
           int top = in.readShort();
           int right = in.readShort();
           int bottom = in.readShort();
           int inch = in.readWord();
           dpiX = 72;
           dpiY = 72;
           scaledHeight = (float)(bottom - top) / inch * 72f;
           setTop(scaledHeight);
           scaledWidth = (float)(right - left) / inch * 72f;
           setRight(scaledWidth);
       }
       finally {
           if (is != null) {
               is.close();
           }
           plainWidth = width();
           plainHeight = height();
       }
   }
项目:MesquiteArchive    文件:ImgWMF.java   
/**
* This method checks if the image is a valid WMF and processes some parameters.
* @throws BadElementException
* @throws IOException
*/

   private void processParameters() throws BadElementException, IOException {
       type = IMGTEMPLATE;
       originalType = ORIGINAL_WMF;
       InputStream is = null;
       try {
           String errorID;
           if (rawData == null){
               is = url.openStream();
               errorID = url.toString();
           }
           else{
               is = new java.io.ByteArrayInputStream(rawData);
               errorID = "Byte array";
           }
           InputMeta in = new InputMeta(is);
           if (in.readInt() != 0x9AC6CDD7)  {
               throw new BadElementException(errorID + " is not a valid placeable windows metafile.");
           }
           in.readWord();
           int left = in.readShort();
           int top = in.readShort();
           int right = in.readShort();
           int bottom = in.readShort();
           int inch = in.readWord();
           dpiX = 72;
           dpiY = 72;
           scaledHeight = (float)(bottom - top) / inch * 72f;
           setTop(scaledHeight);
           scaledWidth = (float)(right - left) / inch * 72f;
           setRight(scaledWidth);
       }
       finally {
           if (is != null) {
               is.close();
           }
           plainWidth = width();
           plainHeight = height();
       }
   }
项目:MesquiteArchive    文件:ImgWMF.java   
/**
* This method checks if the image is a valid WMF and processes some parameters.
* @throws BadElementException
* @throws IOException
*/

   private void processParameters() throws BadElementException, IOException {
       type = IMGTEMPLATE;
       originalType = ORIGINAL_WMF;
       InputStream is = null;
       try {
           String errorID;
           if (rawData == null){
               is = url.openStream();
               errorID = url.toString();
           }
           else{
               is = new java.io.ByteArrayInputStream(rawData);
               errorID = "Byte array";
           }
           InputMeta in = new InputMeta(is);
           if (in.readInt() != 0x9AC6CDD7)  {
               throw new BadElementException(errorID + " is not a valid placeable windows metafile.");
           }
           in.readWord();
           int left = in.readShort();
           int top = in.readShort();
           int right = in.readShort();
           int bottom = in.readShort();
           int inch = in.readWord();
           dpiX = 72;
           dpiY = 72;
           scaledHeight = (float)(bottom - top) / inch * 72f;
           setTop(scaledHeight);
           scaledWidth = (float)(right - left) / inch * 72f;
           setRight(scaledWidth);
       }
       finally {
           if (is != null) {
               is.close();
           }
           plainWidth = width();
           plainHeight = height();
       }
   }
项目:MesquiteArchive    文件:ImgWMF.java   
/**
* This method checks if the image is a valid WMF and processes some parameters.
* @throws BadElementException
* @throws IOException
*/

   private void processParameters() throws BadElementException, IOException {
       type = IMGTEMPLATE;
       originalType = ORIGINAL_WMF;
       InputStream is = null;
       try {
           String errorID;
           if (rawData == null){
               is = url.openStream();
               errorID = url.toString();
           }
           else{
               is = new java.io.ByteArrayInputStream(rawData);
               errorID = "Byte array";
           }
           InputMeta in = new InputMeta(is);
           if (in.readInt() != 0x9AC6CDD7)  {
               throw new BadElementException(errorID + " is not a valid placeable windows metafile.");
           }
           in.readWord();
           int left = in.readShort();
           int top = in.readShort();
           int right = in.readShort();
           int bottom = in.readShort();
           int inch = in.readWord();
           dpiX = 72;
           dpiY = 72;
           scaledHeight = (float)(bottom - top) / inch * 72f;
           setTop(scaledHeight);
           scaledWidth = (float)(right - left) / inch * 72f;
           setRight(scaledWidth);
       }
       finally {
           if (is != null) {
               is.close();
           }
           plainWidth = width();
           plainHeight = height();
       }
   }
项目:MesquiteArchive    文件:ImgWMF.java   
/**
* This method checks if the image is a valid WMF and processes some parameters.
* @throws BadElementException
* @throws IOException
*/

   private void processParameters() throws BadElementException, IOException {
       type = IMGTEMPLATE;
       originalType = ORIGINAL_WMF;
       InputStream is = null;
       try {
           String errorID;
           if (rawData == null){
               is = url.openStream();
               errorID = url.toString();
           }
           else{
               is = new java.io.ByteArrayInputStream(rawData);
               errorID = "Byte array";
           }
           InputMeta in = new InputMeta(is);
           if (in.readInt() != 0x9AC6CDD7)  {
               throw new BadElementException(errorID + " is not a valid placeable windows metafile.");
           }
           in.readWord();
           int left = in.readShort();
           int top = in.readShort();
           int right = in.readShort();
           int bottom = in.readShort();
           int inch = in.readWord();
           dpiX = 72;
           dpiY = 72;
           scaledHeight = (float)(bottom - top) / inch * 72f;
           setTop(scaledHeight);
           scaledWidth = (float)(right - left) / inch * 72f;
           setRight(scaledWidth);
       }
       finally {
           if (is != null) {
               is.close();
           }
           plainWidth = width();
           plainHeight = height();
       }
   }
项目:MesquiteArchive    文件:ImgWMF.java   
/**
* This method checks if the image is a valid WMF and processes some parameters.
* @throws BadElementException
* @throws IOException
*/

   private void processParameters() throws BadElementException, IOException {
       type = IMGTEMPLATE;
       originalType = ORIGINAL_WMF;
       InputStream is = null;
       try {
           String errorID;
           if (rawData == null){
               is = url.openStream();
               errorID = url.toString();
           }
           else{
               is = new java.io.ByteArrayInputStream(rawData);
               errorID = "Byte array";
           }
           InputMeta in = new InputMeta(is);
           if (in.readInt() != 0x9AC6CDD7)  {
               throw new BadElementException(errorID + " is not a valid placeable windows metafile.");
           }
           in.readWord();
           int left = in.readShort();
           int top = in.readShort();
           int right = in.readShort();
           int bottom = in.readShort();
           int inch = in.readWord();
           dpiX = 72;
           dpiY = 72;
           scaledHeight = (float)(bottom - top) / inch * 72f;
           setTop(scaledHeight);
           scaledWidth = (float)(right - left) / inch * 72f;
           setRight(scaledWidth);
       }
       finally {
           if (is != null) {
               is.close();
           }
           plainWidth = width();
           plainHeight = height();
       }
   }
项目:MesquiteArchive    文件:ImgWMF.java   
/**
* This method checks if the image is a valid WMF and processes some parameters.
* @throws BadElementException
* @throws IOException
*/

   private void processParameters() throws BadElementException, IOException {
       type = IMGTEMPLATE;
       originalType = ORIGINAL_WMF;
       InputStream is = null;
       try {
           String errorID;
           if (rawData == null){
               is = url.openStream();
               errorID = url.toString();
           }
           else{
               is = new java.io.ByteArrayInputStream(rawData);
               errorID = "Byte array";
           }
           InputMeta in = new InputMeta(is);
           if (in.readInt() != 0x9AC6CDD7)  {
               throw new BadElementException(errorID + " is not a valid placeable windows metafile.");
           }
           in.readWord();
           int left = in.readShort();
           int top = in.readShort();
           int right = in.readShort();
           int bottom = in.readShort();
           int inch = in.readWord();
           dpiX = 72;
           dpiY = 72;
           scaledHeight = (float)(bottom - top) / inch * 72f;
           setTop(scaledHeight);
           scaledWidth = (float)(right - left) / inch * 72f;
           setRight(scaledWidth);
       }
       finally {
           if (is != null) {
               is.close();
           }
           plainWidth = width();
           plainHeight = height();
       }
   }
项目:MesquiteArchive    文件:ImgWMF.java   
/**
* This method checks if the image is a valid WMF and processes some parameters.
* @throws BadElementException
* @throws IOException
*/

   private void processParameters() throws BadElementException, IOException {
       type = IMGTEMPLATE;
       originalType = ORIGINAL_WMF;
       InputStream is = null;
       try {
           String errorID;
           if (rawData == null){
               is = url.openStream();
               errorID = url.toString();
           }
           else{
               is = new java.io.ByteArrayInputStream(rawData);
               errorID = "Byte array";
           }
           InputMeta in = new InputMeta(is);
           if (in.readInt() != 0x9AC6CDD7)  {
               throw new BadElementException(errorID + " is not a valid placeable windows metafile.");
           }
           in.readWord();
           int left = in.readShort();
           int top = in.readShort();
           int right = in.readShort();
           int bottom = in.readShort();
           int inch = in.readWord();
           dpiX = 72;
           dpiY = 72;
           scaledHeight = (float)(bottom - top) / inch * 72f;
           setTop(scaledHeight);
           scaledWidth = (float)(right - left) / inch * 72f;
           setRight(scaledWidth);
       }
       finally {
           if (is != null) {
               is.close();
           }
           plainWidth = width();
           plainHeight = height();
       }
   }
项目:MesquiteArchive    文件:ImgWMF.java   
/**
* This method checks if the image is a valid WMF and processes some parameters.
* @throws BadElementException
* @throws IOException
*/

   private void processParameters() throws BadElementException, IOException {
       type = IMGTEMPLATE;
       originalType = ORIGINAL_WMF;
       InputStream is = null;
       try {
           String errorID;
           if (rawData == null){
               is = url.openStream();
               errorID = url.toString();
           }
           else{
               is = new java.io.ByteArrayInputStream(rawData);
               errorID = "Byte array";
           }
           InputMeta in = new InputMeta(is);
           if (in.readInt() != 0x9AC6CDD7)  {
               throw new BadElementException(errorID + " is not a valid placeable windows metafile.");
           }
           in.readWord();
           int left = in.readShort();
           int top = in.readShort();
           int right = in.readShort();
           int bottom = in.readShort();
           int inch = in.readWord();
           dpiX = 72;
           dpiY = 72;
           scaledHeight = (float)(bottom - top) / inch * 72f;
           setTop(scaledHeight);
           scaledWidth = (float)(right - left) / inch * 72f;
           setRight(scaledWidth);
       }
       finally {
           if (is != null) {
               is.close();
           }
           plainWidth = width();
           plainHeight = height();
       }
   }
项目:MesquiteArchive    文件:ImgWMF.java   
/**
* This method checks if the image is a valid WMF and processes some parameters.
* @throws BadElementException
* @throws IOException
*/

   private void processParameters() throws BadElementException, IOException {
       type = IMGTEMPLATE;
       originalType = ORIGINAL_WMF;
       InputStream is = null;
       try {
           String errorID;
           if (rawData == null){
               is = url.openStream();
               errorID = url.toString();
           }
           else{
               is = new java.io.ByteArrayInputStream(rawData);
               errorID = "Byte array";
           }
           InputMeta in = new InputMeta(is);
           if (in.readInt() != 0x9AC6CDD7)  {
               throw new BadElementException(errorID + " is not a valid placeable windows metafile.");
           }
           in.readWord();
           int left = in.readShort();
           int top = in.readShort();
           int right = in.readShort();
           int bottom = in.readShort();
           int inch = in.readWord();
           dpiX = 72;
           dpiY = 72;
           scaledHeight = (float)(bottom - top) / inch * 72f;
           setTop(scaledHeight);
           scaledWidth = (float)(right - left) / inch * 72f;
           setRight(scaledWidth);
       }
       finally {
           if (is != null) {
               is.close();
           }
           plainWidth = width();
           plainHeight = height();
       }
   }
项目:MesquiteArchive    文件:ImgWMF.java   
/**
* This method checks if the image is a valid WMF and processes some parameters.
* @throws BadElementException
* @throws IOException
*/

   private void processParameters() throws BadElementException, IOException {
       type = IMGTEMPLATE;
       originalType = ORIGINAL_WMF;
       InputStream is = null;
       try {
           String errorID;
           if (rawData == null){
               is = url.openStream();
               errorID = url.toString();
           }
           else{
               is = new java.io.ByteArrayInputStream(rawData);
               errorID = "Byte array";
           }
           InputMeta in = new InputMeta(is);
           if (in.readInt() != 0x9AC6CDD7)  {
               throw new BadElementException(errorID + " is not a valid placeable windows metafile.");
           }
           in.readWord();
           int left = in.readShort();
           int top = in.readShort();
           int right = in.readShort();
           int bottom = in.readShort();
           int inch = in.readWord();
           dpiX = 72;
           dpiY = 72;
           scaledHeight = (float)(bottom - top) / inch * 72f;
           setTop(scaledHeight);
           scaledWidth = (float)(right - left) / inch * 72f;
           setRight(scaledWidth);
       }
       finally {
           if (is != null) {
               is.close();
           }
           plainWidth = width();
           plainHeight = height();
       }
   }
项目:MesquiteArchive    文件:ImgWMF.java   
/**
* This method checks if the image is a valid WMF and processes some parameters.
* @throws BadElementException
* @throws IOException
*/

   private void processParameters() throws BadElementException, IOException {
       type = IMGTEMPLATE;
       originalType = ORIGINAL_WMF;
       InputStream is = null;
       try {
           String errorID;
           if (rawData == null){
               is = url.openStream();
               errorID = url.toString();
           }
           else{
               is = new java.io.ByteArrayInputStream(rawData);
               errorID = "Byte array";
           }
           InputMeta in = new InputMeta(is);
           if (in.readInt() != 0x9AC6CDD7)  {
               throw new BadElementException(errorID + " is not a valid placeable windows metafile.");
           }
           in.readWord();
           int left = in.readShort();
           int top = in.readShort();
           int right = in.readShort();
           int bottom = in.readShort();
           int inch = in.readWord();
           dpiX = 72;
           dpiY = 72;
           scaledHeight = (float)(bottom - top) / inch * 72f;
           setTop(scaledHeight);
           scaledWidth = (float)(right - left) / inch * 72f;
           setRight(scaledWidth);
       }
       finally {
           if (is != null) {
               is.close();
           }
           plainWidth = width();
           plainHeight = height();
       }
   }
项目:MesquiteCore    文件:ImgWMF.java   
/**
* This method checks if the image is a valid WMF and processes some parameters.
* @throws BadElementException
* @throws IOException
*/

   private void processParameters() throws BadElementException, IOException {
       type = IMGTEMPLATE;
       originalType = ORIGINAL_WMF;
       InputStream is = null;
       try {
           String errorID;
           if (rawData == null){
               is = url.openStream();
               errorID = url.toString();
           }
           else{
               is = new java.io.ByteArrayInputStream(rawData);
               errorID = "Byte array";
           }
           InputMeta in = new InputMeta(is);
           if (in.readInt() != 0x9AC6CDD7)  {
               throw new BadElementException(errorID + " is not a valid placeable windows metafile.");
           }
           in.readWord();
           int left = in.readShort();
           int top = in.readShort();
           int right = in.readShort();
           int bottom = in.readShort();
           int inch = in.readWord();
           dpiX = 72;
           dpiY = 72;
           scaledHeight = (float)(bottom - top) / inch * 72f;
           setTop(scaledHeight);
           scaledWidth = (float)(right - left) / inch * 72f;
           setRight(scaledWidth);
       }
       finally {
           if (is != null) {
               is.close();
           }
           plainWidth = width();
           plainHeight = height();
       }
   }