在运行时在netbeans中裁剪图像

如何允许我的Web用户裁剪图像,然后将其上传到数据库(在运行时也在netbeans中)?     
已邀请:
要裁剪图像,请尝试以下操作:
ImageIcon icon = new ImageIcon(\"java.PNG\");
Image image = icon.getImage();
image = createImage(new FilteredImageSource(image.getSource(),
            new CropImageFilter(73, 63, 141, 131)));
要存储在数据库中,请先将该图像另存为文件,然后使用type = BLOB [可能会在其他数据库中延迟]的列,然后将此图像保存在该列中。 我已经尝试过此代码及其正常工作:-
      Image image;

      Insets insets;

      JLabel label = new JLabel(\"asd\");

      public TestCls() {
        super();
        setLayout(new FlowLayout());

        ImageIcon icon = new ImageIcon(TestCls.class.getClassLoader().getResource(\"user_images/smile/smile.png\"));
        image = icon.getImage();
        image = createImage(new FilteredImageSource(image.getSource(),
            new CropImageFilter(1, 1, 15, 15)));

        label.setIcon(new ImageIcon(image));
        add(label);
      }

      public static void main(String args[]) {
        JFrame f = new TestCls();
        f.setSize(200, 200);
        f.show();
      }
    

要回复问题请先登录注册