⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 getimagesize.java

📁 it s j2me code to view image in mobile.
💻 JAVA
字号:
import java.awt.*;import java.awt.event.*;import java.util.Locale;public class GetImageSize extends Frame {    Image image;    String imageName = "holi.jpg";        int width,height;    public GetImageSize() {        addWindowListener(new WindowAdapter() {            public void windowClosing(WindowEvent we) {                System.exit(0);            }        });    }    public void paint(Graphics g) {        Toolkit tool = Toolkit.getDefaultToolkit();        image = tool.getImage(imageName);        width=image.getWidth(this);        height=image.getHeight(this);                this.setSize(width+20,height+80 );                g.drawImage(image, 10, 30, this);                g.setColor(new Color(180,0,0));        g.setFont(new Font("Times New Roman",1, 40));                g.drawString(imageName.toUpperCase(Locale.ENGLISH), width/2-50, 70);                g.setFont(new Font("Times New Roman",1, 16));                g.drawString("Image Size : "+width+                "*"+height,10,height+60);   }    public static void main(String args[]) throws Exception {        GetImageSize image = new GetImageSize();        image.setVisible(true);        image.setLocation(200, 100);    }}

⌨️ 快捷键说明

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