idaimagecreator.java

来自「著名IDAutomation公司的JAVA条码控件源码」· Java 代码 · 共 49 行

JAVA
49
字号
//*****************************************************************
// 
//  JAVA Source for com.idautomation.pdf417; 3.1
//  
//  Copyright, IDAutomation.com, Inc. 2000-2004. 
//  All rights reserved.
//  
//  http://www.IDAutomation.com/java/
//  
//  NOTICE:
//  You may incorporate our Source Code in your application
//  only if you own a valid Java Developer License
//  from IDAutomation.com, Inc. and the copyright notices 
//  are not removed from the source code.
//  
//*****************************************************************

package com.idautomation.barcode.pdf417;

import java.awt.*;

/** This class enables the paint() method in the main BarCode class to 
rotate a barcode when it is not visable. */

public class IDAImageCreator {

  private java.awt.Image im;
  public Graphics g;

  public IDAImageCreator() {
  }
  public Image getImage(  int w,int h) {
        int s=w;
        if (h>w) s=h;
        // create square image
	im=new java.awt.image.BufferedImage(s,s,java.awt.image.BufferedImage.TYPE_BYTE_INDEXED);
        g = ((java.awt.image.BufferedImage) im).createGraphics();
        return im;
  }

  public Graphics getGraphics() {

    return g;

  }


}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?