vb.net屏幕上作圖 vb畫圖程序

在vbnet中,我在picturebox里面畫線,用滾動條拉動picturebox顯示最新畫出的圖

vb.net沒有自動重畫功能,要在Paint事件中寫代碼對圖形重畫。

公司主營業(yè)務(wù):網(wǎng)站制作、做網(wǎng)站、移動網(wǎng)站開發(fā)等業(yè)務(wù)。幫助企業(yè)客戶真正實現(xiàn)互聯(lián)網(wǎng)宣傳,提高企業(yè)的競爭能力。創(chuàng)新互聯(lián)公司是一支青春激揚、勤奮敬業(yè)、活力青春激揚、勤奮敬業(yè)、活力澎湃、和諧高效的團隊。公司秉承以“開放、自由、嚴(yán)謹(jǐn)、自律”為核心的企業(yè)文化,感謝他們對我們的高要求,感謝他們從不同領(lǐng)域給我們帶來的挑戰(zhàn),讓我們激情的團隊有機會用頭腦與智慧不斷的給客戶帶來驚喜。創(chuàng)新互聯(lián)公司推出畢節(jié)免費做網(wǎng)站回饋大家。

另外一種情況,如果在Image屬性設(shè)置了一幅圖像,圖像能夠保持完整性的。所以你可以把圖形繪在位圖上,把位圖綁定到Image屬性上。

先綁定一幅位圖:

Dim bm as New BitMap(800,600)

PictureBox1.Image=bm

作圖時不是對圖片框,而是在位圖上作圖。

dim gr As Grapthics=Graphics.FromImage(bm) '建立位圖的繪圖設(shè)備

接下來就可用gr 的繪圖方法作圖

作完圖,PictureBox1.Refresh 刷新一下。

VB.net中如何畫圖?

VB.net與VB不同。

VB.net已經(jīng)有專門繪圖的類。

可以定義筆刷然后用Drawing類中的方法繪制。

Private Sub DrawEllipse()

Dim myPen As New System.Drawing.Pen(System.Drawing.Color.Red)

Dim formGraphics as System.Drawing.Graphics

formGraphics = Me.CreateGraphics()

formGraphics.DrawEllipse(myPen, New Rectangle(0,0,200,300))

myPen.Dispose()

formGraphics.Dispose()

End Sub

Private Sub DrawRectangle()

Dim myPen As New System.Drawing.Pen(System.Drawing.Color.Red)

Dim formGraphics as System.Drawing.Graphics

formGraphics = Me.CreateGraphics()

formGraphics.DrawRectangle(myPen, New Rectangle(0,0,200,300))

myPen.Dispose()

formGraphics.Dispose()

End Sub

vb.net桌面中bitmap類如何直接繪制到屏幕?

可以直接顯示的。你看下面的示例,使用vb.net畫的齒輪:

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

b = New Bitmap(PictureBox1.Width, PictureBox1.Height)

g = Graphics.FromImage(b)

'g.RotateTransform(90)

g.Clear(Color.White)

g.TranslateTransform(PictureBox1.Width / 2, PictureBox1.Height / 2)

g.ScaleTransform(1, -1)

'g.SmoothingMode = Drawing2D.SmoothingMode.AntiAlias

g.SmoothingMode = Drawing2D.SmoothingMode.HighQuality

DrawCL(g, New PointF(Val(TextBox1.Text), Val(TextBox2.Text)), Val(TextBox3.Text), Val(TextBox4.Text), Val(TextBox5.Text), Val(TextBox6.Text), Val(TextBox7.Text), Val(TextBox8.Text), Val(TextBox9.Text))

DrawCL(g, New PointF(Val(TextBox18.Text), Val(TextBox17.Text)), Val(TextBox16.Text), Val(TextBox15.Text), Val(TextBox14.Text), Val(TextBox13.Text), Val(TextBox12.Text), Val(TextBox11.Text), Val(TextBox10.Text))

PictureBox1.Image = b

End Sub

本文名稱:vb.net屏幕上作圖 vb畫圖程序
網(wǎng)頁地址:http://muchs.cn/article4/dosdgoe.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供Google、網(wǎng)站營銷、關(guān)鍵詞優(yōu)化、虛擬主機、App設(shè)計、品牌網(wǎng)站制作

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)

成都seo排名網(wǎng)站優(yōu)化