• 大小: 843KB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2021-06-03
  • 语言: Java
  • 标签: java  

资源简介

可以很好的集成到你的项目中,用java写的,里面还有用到的类的api的路径,可以参考进行修改,美化,DIY。图片处理引用了ps中对图片处理的一些效果,功能很给力。集成性强。

资源截图

代码片段和文件信息


package PictureDrawer;

import javax.swing.JInternalframe;
import javax.swing.event.InternalframeEvent;
import javax.swing.JLabel;
import javax.swing.JScrollPane;
import javax.swing.ImageIcon;
import javax.swing.JDialog;
import javax.swing.JSlider;
import javax.swing.event.ChangeListener;
import javax.swing.SwingConstants;

import javax.imageio.ImageIO;

import java.awt.image.BufferedImage;
import java.awt.Graphics2D;
import java.awt.image.LookupOp;
import java.awt.image.ConvolveOp;
import java.awt.image.RescaleOp;
import java.awt.image.Kernel;
import java.awt.image.ByteLookupTable;
import java.awt.RenderingHints;
import java.awt.image.AffineTransformOp;
import java.awt.geom.AffineTransform;
import java.awt.image.DataBuffer;
import java.awt.image.Raster;

import java.io.File;


/** 
 * 本类继承了JInternalframe类,用于完成大部分的图像操作。
 */
public class Imageframe extends JInternalframe 
                    implements ChangeListener{
   //常量定义
                                     
   /**
    * 缩放图像的比例因子,控制图像放大的的最大倍数
    */
    private static final int ZOOM_FACTOR = 200;
                                     
   /**
    * 保留对主窗口的引用
    */
   private PictureDrawer pd;
   
   /**
    * 放大镜
    */
   private JLabel jlblMagnifier;
   
   /**
    * 用于调整黑色的阈值
    */
   private JSlider sliderBlack;

   /**
    * 用于调整黑色的阈值的对话框,sliderBlack
    */
   private JDialog jdBlack;
   
   /**
    * 用于调整白色的阈值
    */
   private JSlider sliderWhite;

   /**
    * 用于调整白色的阈值的对话框,里面包含sliderWhite
    */
   private JDialog jdWhite;
   
   /**
    * 用于调节图像明暗
    */
   private JSlider sliderRescale;
   
   /**
    * 用于调整图像明暗的对话框,里面包含sliderRescale
    */
   private JDialog jdrescale;

   /**
    * 用于放大或者缩小图像
    */
   private JSlider sliderZoom;

   /**
    * 用于放大或者缩小图像的对话框,sliderZoom
    */
   private JDialog jdZoom;
   
   /**
    * 保存原始的图像
    */
    private BufferedImage biOriginal;
   
    private JAdvLabel jlblImage;
    private JScrollPane jScrollPane1;

   /**
    * 当前的操作标志
    */
   private int current_tool = PictureDrawer.TOOL_MOUSE;
   
    /** 
     * Imageframe的构造函数,它创建了一个内部的子窗口,
     * 在窗口中装载并显示指定的图像。
     * @param pd 主窗口的引用
     * @param imageName 要打开显示的图像文件名。
     */
    public Imageframe(PictureDrawer pd String imageName ) {
        this.pd = pd;
        initComponents();
        settitle(imageName);
        jlblImage.filename = imageName;
        jlblImage.setImageIcon(new ImageIcon(imageName) );

        //根据图像大小调整窗口大小
        setSize(400300); 
        biOriginal = jlblImage.abuffered_image;
    }

    /** 
     * 初始化窗口中的组件
     */
    private void initComponents() {
        jScrollPane1 = new JScrollPane();
        //jlblImage = new javax.swing.JLabel();
        jlblImage = new JAdvLabel();

        setClosable(true);
        setIconifiable(true);
        setResizable(true);
        getAccessibleContext().setAccessibleName(
            java.util.ResourceBundle.getBundle(“PictureDrawer/default“).
                getString(“Image_Internal_frame“));
        getAccessibleCo

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件       1487  2004-12-19 16:59  PictureDrawer\.nbattrs

     文件        902  2004-12-19 18:52  PictureDrawer\default.properties

     文件       1224  2004-12-19 18:52  PictureDrawer\default_zh_CN.properties

     文件        929  2004-12-19 22:08  PictureDrawer\docs\allclasses-frame.html

     文件        869  2004-12-19 22:08  PictureDrawer\docs\allclasses-noframe.html

     文件      11137  2004-12-19 22:08  PictureDrawer\docs\constant-values.html

     文件       4508  2004-12-19 22:08  PictureDrawer\docs\deprecated-list.html

     文件       7742  2004-12-19 22:08  PictureDrawer\docs\help-doc.html

     文件      17286  2004-12-19 22:08  PictureDrawer\docs\index-all.html

     文件        828  2004-12-19 22:08  PictureDrawer\docs\index.html

     文件       6174  2004-12-19 22:08  PictureDrawer\docs\overview-tree.html

     文件         15  2004-12-19 22:08  PictureDrawer\docs\package-list

     文件        709  2004-12-19 22:08  PictureDrawer\docs\packages.html

     文件      26798  2004-12-19 22:08  PictureDrawer\docs\PictureDrawer\Imageframe.html

     文件      29909  2004-12-19 22:08  PictureDrawer\docs\PictureDrawer\JAdvLabel.html

     文件       1072  2004-12-19 22:08  PictureDrawer\docs\PictureDrawer\package-frame.html

     文件       5589  2004-12-19 22:08  PictureDrawer\docs\PictureDrawer\package-summary.html

     文件       6230  2004-12-19 22:08  PictureDrawer\docs\PictureDrawer\package-tree.html

     文件      36265  2004-12-19 22:08  PictureDrawer\docs\PictureDrawer\PictureDrawer.html

     文件         57  2004-12-19 22:08  PictureDrawer\docs\resources\inherit.gif

     文件      14017  2004-12-19 22:08  PictureDrawer\docs\serialized-form.html

     文件       1231  2004-12-19 22:08  PictureDrawer\docs\stylesheet.css

     文件      13104  2004-12-19 18:33  PictureDrawer\Imageframe.class

     文件       1789  2004-12-19 18:33  PictureDrawer\Imageframe.form

     文件      22461  2004-12-20 19:15  PictureDrawer\Imageframe.java

     文件       2846  2004-12-19 18:04  PictureDrawer\JAdvLabel.class

     文件       4325  2004-12-20 02:16  PictureDrawer\JAdvLabel.java

     文件        754  2004-12-19 18:52  PictureDrawer\PictureDrawer$1.class

     文件        781  2004-12-19 18:52  PictureDrawer\PictureDrawer$2.class

     文件        626  2004-12-19 15:13  PictureDrawer\PictureDrawer$3.class

............此处省略46个文件信息

评论

共有 条评论