pictruebox上畫線,打點

2021-05-27 20:19:03 字數 1742 閱讀 2186

這兩天學習gdi,做了一些在pictruebox上面畫線,打點的操作。這裡的pictruebox的image的賦值只是把位址賦給imagelocation屬性this.picturebox1.imagelocation = openfiledialog.filename;,這樣是不是不可以儲存對的操作?難道只有先申明乙個bitmap,再把此bitmap賦值給pictruebox的image,還有待考究。這裡的**有點亂啊。

using system;

using system.collections.generic;

using system.componentmodel;

using system.data;

using system.drawing;

using system.drawing.imaging;

using system.drawing.drawing2d;

using system.linq;

using system.text;

using system.windows.forms;

using system.runtime.interopservices;

public form4()

private void button1_click(object sender, eventargs e)

}catch (exception ex)

}private void picturebox1_mousedown(object sender, mouseeventargs e)

if (e.button == mousebuttons.left)

line.add(new point(e.x, e.y));}}

private void picturebox1_mousemove(object sender, mouseeventargs e)

}}private void form4_load(object sender, eventargs e)

if(g==null)

}private void picturebox1_paint(object sender, painteventargs e)

else

if (pointcount != 0)}}

public void drawpoints(listpline, int nun, painteventargs e)

}else

if (i == pline.count() - 1 || i == 0)

}else if (len >= step)

len = 0;}}

}}public void drawpoint(point pl, painteventargs e)

else

}private void button2_click(object sender, eventargs e)

float zhi = 100;

private void button3_click(object sender, eventargs e)

}public void showresult(point p,float testvar)

else if (testvar >= 30 && testvar < 60)

else if (testvar >= 60 && testvar < 90)

else

}private void button4_click(object sender, eventargs e)}}

Android 複製螢幕上畫面內容

方法一 getviewtreeobserver addonpredrawlistener srcview.draw canvas dstview.invalidate 兩者公用乙個canvas 使用下來發現無法複製sufaceview上面的畫面 原因可能是應為他是用opengl渲染的 這個部落格感覺...

在osgEarth上畫同心圓

二.樣式表建立部分 申明樣式 osgearth style style 海拔符號設定,即貼地設定 style.getorcreate clamping osgearth symbology altitudesymbol clamp absolute style.getorcreate techniq...

C 在picturebox上 畫roi區域

思路 設變數bdraw 按下時滑鼠的相對座標 rect為roi的矩形大小 滑鼠按下時,bdraw true 滑鼠移動時計算rect 滑鼠抬起時 bdraw false,然後再paint中畫矩形就ok 繪圖 private void dispwnd picbox paint object sender...