畫點(diǎn):

創(chuàng)新互聯(lián)是一家專注于網(wǎng)站設(shè)計(jì)、成都網(wǎng)站設(shè)計(jì)與策劃設(shè)計(jì),文圣網(wǎng)站建設(shè)哪家好?創(chuàng)新互聯(lián)做網(wǎng)站,專注于網(wǎng)站建設(shè)十多年,網(wǎng)設(shè)計(jì)領(lǐng)域的專業(yè)建站公司;建站業(yè)務(wù)涵蓋:文圣等地區(qū)。文圣做網(wǎng)站價(jià)格咨詢:028-86922220
在PictureBox的Paint事件里面:
dim myGraphics=e.Graphics
Dim myPointArray As Point() = {New Point(0, 0), New Point(50, 30), New Point(30, 60)}
myGraphics.DrawPolygon(myPen, myPointArray)
畫圓:
Dim g As Graphics
g = PictureBox1.CreateGraphics
g.FillEllipse(Brushes.Red, x, y, 10, 10)
Dim b As New Bitmap(320, 200)'定義圖像寬高
Dim clrs As Color=Color.Black
for y as int32=1 to 199
for x as int32=1 to 319
if x=y then
clrs = Color.White'假設(shè)是對(duì)角線,x=y時(shí)使用白色
else
clrs = Color.Black'平時(shí)使用黑色
endif
b.SetPixel(x, y, clrs)'畫點(diǎn)
next
next
b.Save("test.tif", System.Drawing.Imaging.ImageFormat.Tiff)'保存到圖片文件
==================
原創(chuàng)例子,祝進(jìn)步!!
Call Pset(x,y,RGB(Red,Green,Blue))
x,y是坐標(biāo)
RGB是顏色
可以隨時(shí)調(diào)用!!!
哦,對(duì)不起,沒看清。
我沒用過VB.Net,代碼是沒辦法給你了
但我有辦法:
用API函數(shù)SetPixel,SetPixelv(后者快一點(diǎn))
語法參見
.NET確實(shí)沒有提供畫一個(gè)像素點(diǎn)得方法
你可以試一下用FillEllipse填充一個(gè)寬1像素,高2像素的橢圓
原理就是FillEllipse的時(shí)候,最左邊那一列一般都會(huì)多出一個(gè)一像素的點(diǎn);高至少要2,少了就什么都畫不出來
畫點(diǎn):
在PictureBox的Paint事件里面:
dim myGraphics=e.Graphics
Dim myPointArray As Point() = {New Point(0, 0), New Point(50, 30), New Point(30, 60)}
myGraphics.DrawPolygon(myPen, myPointArray)
畫圓:
Dim g As Graphics
g = PictureBox1.CreateGraphics
g.FillEllipse(Brushes.Red, x, y, 10, 10)
先在桌面新建一個(gè)文本文檔,輸入20個(gè)點(diǎn)坐標(biāo)
Dim x As Integer
Dim y As Integer
Dim z As Single
Dim i As Integer
Private Sub Command1_Click()
Form1.Picture1.Scale (0, 0)-(100, 100)
Open "c:\1.txt" For Input As #1
i = 0
Do While Not EOF(1)
i = i + 1
Input #1, x(i), y(i), z(i)
Form1.Picture1.PSet (x(i), y(i))
Loop
Close #1
End Sub
Private Sub Command2_Click()
For n = 1 To i - 1
For j = n + 1 To i - 1
If x(n) x(j) Then
t = x(n)
x(n) = x(j)
x(j) = t
k = y(n)
y(n) = y(j)
y(j) = k
End If
Next j
Next n
For n = 1 To i - 2
Form1.Picture1.Line (x(n), y(n))-(x(n + 1), y(n + 1))
Next n
End Sub
Private Sub Command3_Click()
Form1.Picture2.Scale (0, 0)-(100, 100)
Open "c:\1.txt" For Input As #1
i = 1
Do While Not EOF(1)
Input #1, x(i), y(i), z(i)
Form1.Picture2.PSet (x(i), y(i))
i = i + 1
Loop
Close #1
End Sub
Private Sub Command4_Click()
For n = 1 To i - 1
Form1.Picture2.Line (x(n) - z(n), y(n))-(x(n) + z(n), y(n))
Form1.Picture2.Line (x(n), y(n) + z(n))-(x(n), y(n) - z(n))
Next n
End Sub
文章名稱:vb.net怎么畫點(diǎn),vb畫點(diǎn)用什么方法
文章分享:http://chinadenli.net/article31/dsidhpd.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供全網(wǎng)營銷推廣、定制開發(fā)、網(wǎng)站維護(hù)、網(wǎng)站策劃、定制網(wǎng)站、App開發(fā)
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來源: 創(chuàng)新互聯(lián)