我有以下类,它在第0层刷新jpeg文件,第1层用于绘制/绘制/草绘与粉碎事物相关的任何内容.但是在我的绘画中,当我想做一条细线时,它就会断裂.因为鼠标光标移动需要较慢.
如何解决快速鼠标移动,线路仍然连接?
package test;
import java.awt.*;
import java.awt.event.*;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import javax.imageio.ImageIO;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JPanel;
public class Annotation {
// Image
private static Image backgroundImage;
private static BufferedImage _bufImage = null;
// Enum
public static enum Shape { RECTANGLE, OVAL, LINE }
private static enum State { IDLE, DRAGGING }
private static final Shape INIIIAL_SHAPE = Shape.RECTANGLE;
private static final Color INITIAL_COLOR = Color.RED;
private static Shape _shape = INIIIAL_SHAPE;
private static …
Run Code Online (Sandbox Code Playgroud)