28 北京师范大学珠海分校信息技术学院
JLabel logoJla = new JLabel(\北京师范大学珠海分校远程监控服务端
\CENTER); logoJla.setBackground(Color.black); jpa.add(logoJla); jpa.setSize(new Dimension(this.getHeight(), iconsBnuzw.getIconHeight())); add(jpa);
add(screenService);
recive.setVisible(true);
new Thread(screenService).start(); }
public static void main(String[] args) { try {
new ScreenServer(\远程监控\ } catch (IOException e) {
System.out.println(\启动服务失败\ } } } UDP
MultiCastSever:
public class MultiCastSever extends Thread { public final static int WIDTH = 720; public final static int HEIGHT = 540;
private static int portTem = 9999;
private static String mutiAddr = \ private InetAddress inetAddress; private MulticastSocket multicastSocket;
private Robot robot;
public MultiCastSever() { try {
inetAddress = InetAddress.getByName(mutiAddr); multicastSocket = new MulticastSocket(); } catch (Exception e) { e.printStackTrace(); } }
public void run() {
Dimension size = Toolkit.getDefaultToolkit().getScreenSize(); Rectangle rec = new Rectangle(0, 0, (int) size.getWidth(), (int) size.getHeight()); try {
while (true) { robot = new Robot();
BufferedImage image = robot.createScreenCapture(rec);
第 28 页 共30页
29 北京师范大学珠海分校信息技术学院
Image cursor = ImageIO.read(new File(\
int x = MouseInfo.getPointerInfo().getLocation().x; int y = MouseInfo.getPointerInfo().getLocation().y; Graphics2D graphics2D = image.createGraphics(); graphics2D.drawImage(cursor, x, y, 16, 16, null);
BufferedImage littleimage = resize(image, WIDTH, HEIGHT); ByteArrayOutputStream bout = new ByteArrayOutputStream(); ImageIO.write(littleimage, \byte[] b = bout.toByteArray();
DatagramPacket dp = new DatagramPacket(b, b.length,inetAddress, portTem);
multicastSocket.send(dp);
Thread.sleep(1); }
} catch (Exception e) { e.printStackTrace(); } } public static BufferedImage resize(BufferedImage img, int newW, int newH) {
int w = img.getWidth(); int h = img.getHeight();
BufferedImage dimg = new BufferedImage(newW, newH, img.getType()); Graphics2D g = dimg.createGraphics();
g.setRenderingHint(RenderingHints.KEY_INTERPOLATION,RenderingHints.VALUE_INTERPOLATION_BILINEAR);
g.drawImage(img, 0, 0, newW, newH, 0, 0, w, h, null); return dimg; }
public static void main(String[] args) {
MultiCastSever ms = new MultiCastSever(); ms.start(); } }
ReveiveThread:
public class ReceiveThrea extends JFrame implements Runnable { private static int portTem = 9999;
private static String mutiAddr = \ private InetAddress inetAddress; private JLabel imageLab;
private ImageIcon iconsBnuzw = new ImageIcon(\public RecieveThread() throws Exception {
this.setLayout(new FlowLayout(1, 1, 1)); inetAddress = InetAddress.getByName(mutiAddr); imageLab = new JLabel();
第 29 页 共30页
30 北京师范大学珠海分校信息技术学院
JPanel logoJpa = new JPanel();
JLabel logoJla = new JLabel(\屏幕传送\iconsBnuzw, SwingConstants.CENTER);
logoJla.setBackground(Color.black); logoJpa.add(logoJla);
JPanel screenJpa = new JPanel(); screenJpa.add(imageLab); this.add(logoJpa); this.add(screenJpa);
this.setTitle(\毕业设计软件\
this.setSize(MultiCastSever.WIDTH,
MultiCastSever.HEIGHT+iconsBnuzw.getIconHeight());
this.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE); this.setVisible(true); this.setResizable(false); }
public void run() { try {
while (true) {
MulticastSocket recvSocket = new MulticastSocket(portTem); recvSocket.joinGroup(inetAddress); byte[] data = new byte[3000*10000];
DatagramPacket dp = new DatagramPacket(data, data.length); recvSocket.receive(dp);
ByteArrayInputStream bins = new ByteArrayInputStream(data); BufferedImage image = ImageIO.read(bins); ImageIcon icon = new ImageIcon(image); imageLab.setIcon(icon); imageLab.repaint(); Thread.sleep(1); }
} catch (Exception e) { e.printStackTrace(); } }
public static void main(String[] args) throws Exception { RecieveThread rt = new RecieveThread(); Thread tr = new Thread(rt); tr.start(); } }
第 30 页 共30页
1 北京师范大学珠海分校信息技术学院
北京师范大学珠海分校本科生毕业论文评定表
信息技术
学院(系)
级
专业 姓名
学号
题目 (论文评语及给出初步成绩) 指导教师意见 指导教师签章 (论文、答辩评语,成绩及是否推荐院级优秀论文) 201 年 月 日 答辩小组意见成绩(百分制)______ (四级分制)______; 推荐申报院级优秀论文投票:赞成 人,反对 人,弃权 人。 组长签章 (是否同意评为院级优秀论文及推荐校级优秀论文) 201 年 月 日 院级评优意见 推荐申报院级优秀论文投票:赞成 人,反对 人,弃权 人。 教学院长(主任)签章 院系章 201 年 月 日 校级评优意见
教务处长(签章) 201 年 月 日 注:(1)此表一式四份,一份存入学校档案,一份装入学生档案、一份装入论文封底,一份学院存档、长期保存。填写时务必字迹工整,签章俱全。(2)*如系两位教师合作指导,应同时签名。
1

