freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內(nèi)容

基于c多機(jī)聯(lián)合繪圖軟件的實(shí)現(xiàn)畢業(yè)論文(編輯修改稿)

2024-07-15 15:40 本頁(yè)面
 

【文章內(nèi)容簡(jiǎn)介】 tArgs e) { if (isNewObjectAdded == false) { return。 } Point point = new Point(, )。 int index = ()。 DrawMyCurve w = (DrawMyCurve)[index]。 if ( == ) { int dx = 。 int dy = 。 int distance = (int)(dx * dx + dy * dy)。 if (distance minDistance) { if ( 1) { (point, )。 } } else { (point)。 myLastPoint = point。 } } ()。 },當(dāng)用戶按下鼠標(biāo)左鍵時(shí),即可觸發(fā)OnMouseDown事件,在該事件中,捕獲鼠標(biāo)所在的點(diǎn),并以此點(diǎn)為曲線的終點(diǎn)myLastPoint,同時(shí)創(chuàng)建曲線對(duì)象w。(3)在主窗體的構(gòu)造函數(shù)內(nèi)添加代碼;tools[(int)] = new ToolCurve()。(4)在主窗體上雙擊曲線按鈕,在對(duì)應(yīng)的Click事件中添加如下代碼;ActiveTool = 。(5)運(yùn)行程序,觀察運(yùn)行結(jié)果 如圖所示;這里說(shuō)明下,這是DrawMyCurve從TrackCurve繼承表示繪制的是帶有箭頭的曲線。(1) 運(yùn)行以及基本構(gòu)思還是和前面講的矩形,曲線是如出一轍的。還有直線的繪制DrawMyLine是從 TrackCurve繼承的。(2) ,使其從ToolObjiect類(lèi)派生。主要代碼如下。 class ToolLine : ToolObject { private int minDistance = 20。 // private Point myLastPoint。 private Point myFirstPoint。 private Point myFirstPoint1。 public override void OnMouseDown(Palette palette, MouseEventArgs e) { (palette, e)。 = false。 Point p = new Point(, )。 // DrawMyLine w = new DrawMyLine(p, , 2, )。 //AddNewObject(palette, w)。 myFirstPoint = myFirstPoint1 = p。 isNewObjectAdded = true。 } public override void OnMouseMove(Palette palette, MouseEventArgs e) { if (isNewObjectAdded == false) { return。 } Point point = new Point(, )。 int index = ()。 DrawMyLine w = (DrawMyLine)[index]。 if ( == ) { int dx = 。 int dy = 。 int distance = (int)(dx * dx + dy * dy)。 if (distance minDistance) { if ( 1) { (point, )。 } } else { (point)。//這里有問(wèn)題 myFirstPoint1 = point。 } } ()。 }(3)在主窗體的構(gòu)造函數(shù)內(nèi)添加代碼;tools[(int)] = new ToolLine()。(4)在主窗體上雙擊曲線按鈕,在對(duì)應(yīng)的Click事件中添加如下代碼;ActiveTool = 。(5)運(yùn)行程序,觀察運(yùn)行結(jié)果 如圖所示;(1).這是在解決方案源管理中,使其從DrawObject類(lèi)中派生,該類(lèi)Draw方法的實(shí)現(xiàn)代碼如下;public override void Draw(Graphics g) { Brush b = new SolidBrush(penColor)。 if ( != null) { ()。 } = new Font(宋體, fontHeight, , )。 Matrix matrix = new Matrix()。 (angle, startPoint)。 = matrix。 (text, font, b, startPoint)。 ()。 ()。 ()。 }在這段代碼中,繪制文字前,首先創(chuàng)建一個(gè)名為matrix的Matrix類(lèi)型的對(duì)象,然后以文字的起點(diǎn)starPoint為中心旋轉(zhuǎn)angle角度即可繪制任意方向的文字。而繪制的文字的大小則是通過(guò)控制字體的高度來(lái)實(shí)現(xiàn)的。(2)在解決方案資源管理器中,使其從ToolObject類(lèi)派生,主要代碼如下;class ToolText : ToolObject { public override void OnMouseDown(Palette palette, MouseEventArgs e) { (palette, e)。 DrawMyText w = new DrawMyText(, , , , )。 AddNewObject(palette, w)。 isNewObjectAdded = true。 } public override void OnMouseMove(Palette palette, MouseEventArgs e) { if (isNewObjectAdded == false) { return。 } Point point = new Point(, )。 int index = ()。 if ( == ) { DrawObject w = [index]。 (point, 2)。 } ()。 } public override void OnMouseUp(Palette palette, MouseEventArgs e) { if (isNewObjectAdded == false) { return。 } (palette, e)。 if ( != ) { int index = ()。 DrawMyText w = (DrawMyText)[index]。 //x1,y1,x2,y2,旋轉(zhuǎn)角度,文字內(nèi)容,顏色,文字高,id ((DrawMyText,{0},{1},{2},{3},{4},{5},{6},{7},{8}, , , , , , , (), , ))。 ()。 }在OnMouseDown事件中,將鼠標(biāo)所在的點(diǎn)作為起點(diǎn),同時(shí)創(chuàng)建DrawText對(duì)象。在OnMouseMove事件中,捕獲鼠標(biāo)所在的點(diǎn),當(dāng)鼠標(biāo)當(dāng)前位置與起始點(diǎn)之間的距離能夠顯示文字時(shí),將該點(diǎn)作為文字的終點(diǎn),同時(shí)計(jì)算文字的角度。(3),提供文本輸入和顏色的選擇的功能,; TextDialog的設(shè)計(jì)界面,MyText屬性表示文本框內(nèi)的輸入的內(nèi)容,MyColor屬性表示文本框內(nèi)容的字體顏色。具體代碼如下;public partial class TextDialog : Form { private string text。 public string MyText { get { return text。 } set { text = value。 } } private Color _color。 public Color MyColor { get { return _color。 } set { _color = value。 } } public TextDialog() { InitializeComponent()。 = 。 = buttonOK。 = buttonCancel。 = false。 = false。 } private void TextForm_Load(object sender, EventArgs e) { _color = 。 = 南昌航空大學(xué)科技學(xué)院。 } private void buttonFont_Click(object sender, EventArgs e) { ColorDialog c = new ColorDialog()。 if (() == ) { _color = 。 = _color。 } } private void buttonOK_Click(object sender, EventArgs e) { text = 。 } }}(4)在主程序窗體MultiDraw2的構(gòu)造函數(shù)中,添加代碼:Tools[(int)]=new ToolText()。(5)在主窗體上,雙擊文字按鈕,在其Click事件中添加如下代碼;TextDialog td = new Text
點(diǎn)擊復(fù)制文檔內(nèi)容
環(huán)評(píng)公示相關(guān)推薦
文庫(kù)吧 www.dybbs8.com
備案圖片鄂ICP備17016276號(hào)-1