真实的国产乱ⅩXXX66竹夫人,五月香六月婷婷激情综合,亚洲日本VA一区二区三区,亚洲精品一区二区三区麻豆

成都創(chuàng)新互聯(lián)網(wǎng)站制作重慶分公司

vb.net圖形函數(shù)庫 vbnet chart

VB.net中如何在picturebox畫線,有什么函數(shù)?

Dim b As New Bitmap(PictureBox1.Width, PictureBox1.Height)

創(chuàng)新互聯(lián)自成立以來,一直致力于為企業(yè)提供從網(wǎng)站策劃、網(wǎng)站設(shè)計、網(wǎng)站設(shè)計制作、成都網(wǎng)站建設(shè)、電子商務(wù)、網(wǎng)站推廣、網(wǎng)站優(yōu)化到為企業(yè)提供個性化軟件開發(fā)等基于互聯(lián)網(wǎng)的全面整合營銷服務(wù)。公司擁有豐富的網(wǎng)站建設(shè)和互聯(lián)網(wǎng)應(yīng)用系統(tǒng)開發(fā)管理經(jīng)驗、成熟的應(yīng)用系統(tǒng)解決方案、優(yōu)秀的網(wǎng)站開發(fā)工程師團隊及專業(yè)的網(wǎng)站設(shè)計師團隊。

Dim g As Graphics = Graphics.FromImage(b)

g.Clear(Color.White)

Dim p As New Pen(Color.Black)

p.EndCap = Drawing2D.LineCap.ArrowAnchor

g.DrawLine(p, 30, PictureBox1.Height - 30, 30, 30)

g.DrawLine(p, 30, PictureBox1.Height - 30, PictureBox1.Width - 30, PictureBox1.Height - 30)

Dim i As Integer

Dim bs As New SolidBrush(Color.Green)

Dim po As New Point

po.X = 0

po.Y = PictureBox1.Height - 35

For i = 700 To 1000 Step 50

g.DrawString(i, Me.Font, bs, po.X, po.Y)

g.DrawLine(p, po.X + 28, po.Y + 5, po.X + 30, po.Y + 5)

po.Y -= (PictureBox1.Height - 100) / 6

Next

po.X = 30

po.Y = PictureBox1.Height - 30

For i = 0 To 40 Step 5

g.DrawString(i, Me.Font, bs, po.X, po.Y + 5)

g.DrawLine(p, po.X, po.Y + 2, po.X, po.Y)

po.X += (PictureBox1.Width - 100) / 8

Next

PictureBox1.Image = b

大佬們~VisualStudio中vb.net如何畫三角函數(shù)圖像?

VB系統(tǒng)的坐標(biāo)原點在左上角,X軸的正方向是水平向右,而Y軸的正方向是垂直向下。所以,要繪制三角函數(shù)的曲線,自己可以通過改變點坐標(biāo)的方法來實現(xiàn),當(dāng)然,VB.NET提供了相應(yīng)的方法可以來實現(xiàn)坐標(biāo)變換,也可以通過VB.Net的Graphics類提供的平移、旋轉(zhuǎn)等轉(zhuǎn)換來實現(xiàn)。

下面是我通過自己變換實現(xiàn)的示例,提供參考;我的環(huán)境是VB.NET 2010

Imports System.Math

Public Class Form1

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

? '1,獲得一個Graphics對象

? Dim MyGraphics As Graphics

? MyGraphics = PictureBox1.CreateGraphics

? '2,定義一個Pen對象,用于繪制圖形(輪廓線)

? Dim MyPen As New Pen(Color.Black, 1)

? '3,定義一個Brush對象,用于填充圖形(如果需要填充的話)

? Dim MyBrush As New SolidBrush(Color.Orange)

? MyGraphics.DrawLine(MyPen, 0, 200, 700, 200)

End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click

? '1,獲得一個Graphics對象

? Dim MyGraphics As Graphics

? MyGraphics = PictureBox1.CreateGraphics

? '2,定義一個Pen對象,用于繪制圖形(輪廓線)

? Dim MyPen As New Pen(Color.Black, 1)

? '3,定義一個Brush對象,用于填充圖形(如果需要填充的話)

? Dim MyBrush As New SolidBrush(Color.Orange)

? '聲明橫向和縱向比例變量

? Dim Heng As Integer = 20

? Dim Zong As Integer = 50

? '先獲得正弦值,保存到點坐標(biāo)數(shù)組

? Dim MyPoints(700) As Point

? Dim i As Integer

? For i = 0 To 700

? ? ? MyPoints(i) = New Point(i * Heng, 200 + Sin(i) * Zong)

? Next

? '采用繪制光滑線連接點的方式繪制曲線

? MyGraphics.DrawCurve(MyPen, MyPoints)

End Sub

End Class

顯示的效果圖:

vb.net的picturebox畫直線的函數(shù)是哪個?vb6.0是picture1.line就可以,但是vb.net沒有啊

Dim PtStart As Point '記錄繪制直線的起始點

Dim PtEnd As Point '記錄繪制直線的終點

Dim ShouldDrawLine As Boolean '是否繪制直線

'記錄鼠標(biāo)左鍵點擊的位置,第二次點擊后開始繪制直線

Private Sub Pic1_MouseDown()Sub Pic1_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Pic1.MouseDown

If e.Button = Windows.Forms.MouseButtons.Left Then

If Not ShouldDrawLine Then

PtStart = New Point(e.X, e.Y)

ShouldDrawLine = True

Else

PtEnd = New Point(e.X, e.Y)

'下面兩句根據(jù)需要進行取舍

'Call DrawLine(PtStart, PtEnd) '繪制一條直線

Call DrawLines(PtStart, PtEnd) '繪制多條直線

ShouldDrawLine = False

End If

End If

End Sub

'繪制鼠標(biāo)兩次點擊位置之間的直線

Private Sub DrawLine()Sub DrawLine(ByVal mPoint1 As Point, ByVal mPoint2 As Point)

Pic1.Refresh() '用于刷新Picturebox表面

Pic1.CreateGraphics.DrawLine(Pens.Blue, mPoint1, mPoint2) '繪制兩點間的直線

End Sub

'繪制多條直線,每兩次鼠標(biāo)點擊確定一條線

Private Sub DrawLines()Sub DrawLines(ByVal mPoint1 As Point, ByVal mPoint2 As Point)

'此句不可刪除,用于清除鼠標(biāo)點擊前的軌跡

ControlPaint.DrawReversibleLine(Pic1.PointToScreen(mPoint1), Pic1.PointToScreen(mPoint2), Color.Red)

Pic1.CreateGraphics.DrawLine(Pens.Blue, mPoint1, mPoint2) '繪制兩點間的直線

End Sub


分享標(biāo)題:vb.net圖形函數(shù)庫 vbnet chart
網(wǎng)頁路徑:http://weahome.cn/article/dohdsdd.html

其他資訊

在線咨詢

微信咨詢

電話咨詢

028-86922220(工作日)

18980820575(7×24)

提交需求

返回頂部