zgh26782000 zgh26782000
关注数: 45 粉丝数: 108 发帖数: 8,155 关注贴吧数: 18
抓图1_2 package screen; import java.awt.AWTException; import java.awt.BorderLayout; import java.awt.Color; import java.awt.Graphics; import java.awt.Rectangle; import java.awt.Robot; import java.awt.Toolkit; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.KeyAdapter; import java.awt.event.KeyEvent; import java.awt.event.KeyListener; import java.awt.event.MouseEvent; import java.awt.event.MouseListener; import java.awt.event.MouseMotionListener; import java.awt.image.BufferedImage; import javax.swing.JButton; import javax.swing.JFrame; import javax.swing.JWindow; public class MouseCatch extends JWindow implements MouseListener,MouseMotionListener{      Robot r=null;      BufferedImage bi=null;      Graphics g=null;      MouseEvent me=null;      int temx1=0;      int temy1=0;      int temx2=0;      int temy2=0;      int countn=1;      int x=0;      int y=0;      int width=0;      int height=0;      Screen scr=null;      void init()      {          try {              r=new Robot();              bi=r.createScreenCapture(new Rectangle(Toolkit.getDefaultToolkit().getScreenSize()));          } catch (AWTException e) {              e.printStackTrace();          }      }      public MouseCatch(Screen scr)      {          this.scr=scr;          this.addMouseListener(this);          this.addMouseMotionListener(this);          this.setAlwaysOnTop(true);          init();          g=bi.getGraphics();          this.setBounds(new Rectangle(Toolkit.getDefaultToolkit().getScreenSize()));               }      public void paint(Graphics g)      {          g.drawImage(bi,0,0,null);          Color c=g.getColor();          g.setColor(Color.WHITE);         
抓图 package screen; import java.awt.BorderLayout; import java.awt.Color; import java.awt.GridLayout; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.ButtonGroup; import javax.swing.JButton; import javax.swing.JCheckBox; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JPanel; import javax.swing.JRadioButton; import javax.swing.JTextField; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; public class AutoSet extends JFrame implements ActionListener{      boolean CatchMod=false;      boolean Fuzhu=true;      JRadioButton jr1=null;      JRadioButton jr2=null;      Screen scr=null;      JCheckBox checkb=null;      JTextField[] jtext=new JTextField[3];      String[]str={"抓取前延时 "," 秒","抓取间隔时间 "," 秒","抓取辅助选项","按抓取时间","按抓取张数",              "次(秒)","确定","取消","确定后,点击开始进行自动捕捉","抓取数量"};      JLabel[]jlabel=new JLabel[str.length];      public AutoSet(Screen scr)      {          CatchMod=scr.cfg.isCatchMod();          this.scr=scr;          Fuzhu=scr.cfg.isFuzhu();          JPanel[]jpanel=new JPanel[11];          for(int i=0;i<jpanel.length;i++)          {              JPanel panel=new JPanel();                           panel.setBackground(Color.black);              if(i>3)              {                  panel.setBackground(Color.cyan);              }              jpanel[i]=panel;          }          JPanel mainp=new JPanel();          mainp.setLayout(new GridLayout(7,1));          for(int i=4;i<jpanel.length;i++)          {              mainp.add(jpanel[i]);          }
首页 1 2 3 4 5 下一页