xxxx18一60岁hd中国/日韩女同互慰一区二区/西西人体扒开双腿无遮挡/日韩欧美黄色一级片 - 色护士精品影院www

  • 大小: 12KB
    文件類型: .java
    金幣: 1
    下載: 0 次
    發(fā)布日期: 2021-05-21
  • 語(yǔ)言: Java
  • 標(biāo)簽:

資源簡(jiǎn)介

可以按照調(diào)整比例大小實(shí)現(xiàn)圖片截取,類似于QQ的截圖效果

資源截圖

代碼片段和文件信息

import?java.applet.*;
import?java.awt.*;
import?java.awt.event.*;
import?java.util.*;
import?javax.swing.*;
import?java.awt.geom.*;
import?java.io.*;

class?Point?implements?Serializable//object?serialization?允許你將實(shí)現(xiàn)了Serializable接口

?????????????//?的對(duì)象轉(zhuǎn)換為字節(jié)序列,這些字節(jié)序列可以被完全存儲(chǔ)以備以后重新生成原來(lái)的對(duì)象。
{
?int?xy;
?Color?col;
?int?tool;
?int?boarder;

?Point(int?x?int?y?Color?col?int?tool?int?boarder)
?{
??this.x?=?x;?
??this.y?=?y;
??this.col?=?col;
??this.tool?=?tool;
??this.boarder?=?boarder;
??}
}


class?paintboard?extends?frame?implements?ActionListenerMouseMotionListenerMouseListenerItemListener
//Java中frame默認(rèn)的布局管理器為BorderLayout加一個(gè)TextField到BorderLayout.SOUTH用來(lái)查看

?//點(diǎn)擊菜單的getSource()和getCommand()信息接口?java.awt.event.MouseMotionListener?
?
??//public?interface?MouseMotionListener?extends?EventListener?
??
??//用于接收組件上的鼠標(biāo)移動(dòng)事件的監(jiān)聽(tīng)者接口。?


{
?int?x?=?-1?y?=?-1;
?int?con?=?1;//畫(huà)筆大小
?int?Econ?=?5;//橡皮大小

?int?toolFlag?=?0;//toolFlag:工具標(biāo)記
??????//toolFlag工具對(duì)應(yīng)表:
??????//(0--畫(huà)筆);(1--橡皮);(2--清除);
??????//(3--直線);(4--圓);(5--矩形);

?Color?c?=?new?Color(000);?//畫(huà)筆顏色
?BasicStroke?size?=?new?BasicStroke(conBasicStroke.CAP_BUTTBasicStroke.JOIN_BEVEL);//畫(huà)筆粗細(xì)
??//BasicStroke?類定義針對(duì)圖形圖元輪廓呈現(xiàn)屬性的一個(gè)基本集合,
??//描述了用畫(huà)筆沿?Shape?的輪廓繪制的某個(gè)標(biāo)記的形狀.
?Point?cutflag?=?new?Point(-1?-1?c?6?con);//截?cái)鄻?biāo)志

?Vector?paintInfo?=?null;//點(diǎn)信息向量組Vector為一個(gè)容器,一個(gè)可以放任何數(shù)據(jù),大小可以隨意擴(kuò)大的數(shù)組
?int?n?=?1;

?FileInputStream?picIn?=?null;//FileInputStream?類:提供了對(duì)文件讀取流的操作
?FileOutputStream?picOut?=?null;//FileOutputStream類:文件輸出流操作
?//objectOutputStream?和?objectInputStream?分別利用?FileOutputStream?和?FileInputStream?
??//能支持應(yīng)用程序?qū)崿F(xiàn)對(duì)象圖象的穩(wěn)定存儲(chǔ)。
?objectInputStream?VIn?=?null;//objectInputStream?可用于恢復(fù)以前序列化過(guò)的對(duì)象
?objectOutputStream?VOut?=?null;//objectOutputStream?將?Java?對(duì)象中的基本數(shù)據(jù)類型和圖元
????????????????????????????????//寫(xiě)入到一個(gè)?OutputStream?對(duì)象中


//?*工具面板--畫(huà)筆,直線,圓,矩形,多邊形橡皮,清除*/
?Panel?toolPanel;
?Button?eraser?drLinedrCircledrRect;
?Button?clear?pen;
?Choice?ColChoiceSizeChoiceEraserChoice;
?Button?colchooser;
?Label?顏色大小B大小E;
?//保存功能
?Button?openPicsavePic;
?FileDialog?openPicturesavePicture;
?

??paintboard(String?s)
?{?
??super(s);
??addMouseMotionListener(this);
??addMouseListener(this);

??paintInfo?=?new?Vector();

/*各工具按鈕及選擇項(xiàng)*/
??//顏色選擇
??ColChoice?=?new?Choice();
??ColChoice.add(“black“);
??ColChoice.add(“red“);
??ColChoice.add(“blue“);
??ColChoice.add(“green“);
??ColChoice.addItemListener(this);
??//畫(huà)筆大小選擇
??SizeChoice?=?new?Choice();
??SizeChoice.add(“1“);
??SizeChoice.add(“3“);??
??SizeChoice.add(“5“);
??SizeChoice.add(“7“);
??SizeChoice.add(“9“);
??SizeChoice.addItemListener(this);
??//橡皮大小選擇
??EraserChoice?=?new?Choice();
??EraserChoice.add(“5“);
??EraserChoice.add(“9“);
??EraserChoice.add(“13“);
??EraserChoice.add(“17“);
??EraserChoice.addItemListener(this);
??////////////////////////////////////////////////////
??toolPanel?=?new?Panel();

??clear?=?new?Button(“清除“);//Button類創(chuàng)建一個(gè)標(biāo)簽按鈕。當(dāng)按下該按鈕時(shí),應(yīng)用

評(píng)論

共有 條評(píng)論

相關(guān)資源