。net ?其實(shí)還是很好繪制圖形的
羅源網(wǎng)站制作公司哪家好,找創(chuàng)新互聯(lián)!從網(wǎng)頁設(shè)計(jì)、網(wǎng)站建設(shè)、微信開發(fā)、APP開發(fā)、成都響應(yīng)式網(wǎng)站建設(shè)公司等網(wǎng)站項(xiàng)目制作,到程序開發(fā),運(yùn)營(yíng)維護(hù)。創(chuàng)新互聯(lián)成立于2013年到現(xiàn)在10年的時(shí)間,我們擁有了豐富的建站經(jīng)驗(yàn)和運(yùn)維經(jīng)驗(yàn),來保證我們的工作的順利進(jìn)行。專注于網(wǎng)站建設(shè)就選創(chuàng)新互聯(lián)。
你可以看下?Graphics ?類
Dim d As New Bitmap(Me.Width, Me.Height) ?‘一個(gè)圖片吧
? Dim g As Graphics = Graphics.FromImage(d)’繪制 ?準(zhǔn)備在這個(gè)圖片是進(jìn)行
然后 ?就是你繪制的東西了
線 就是 ??g.DrawLine()
圓 弧度 ?就用 ?g.DrawArc(Pens.Black, New Rectangle(0, 0, 400, 200), 0, 360)
復(fù)雜的就是 ? ? ?g.DrawBezier()
等 ?如果你用的是 VS的 ?編譯 ?上面都有詳細(xì)的參數(shù)說明
Dim?d?As?New?Bitmap(Me.Width,?Me.Height)
Dim?g?As?Graphics?=?Graphics.FromImage(d)
g.DrawArc(Pens.Black,?New?Rectangle(0,?0,?200,?200),?0,?360)
g.DrawLine(Pens.Red,?New?Point(0,?0),?New?Point(200,?200))
g.DrawLines(Pens.Green,?New?Point()?{New?Point(0,?0),?New?Point(50,?40),?New?Point(50,?80),?New?Point(90,?70),?New?Point(100,?400)})
g.DrawBezier(Pens.Yellow,?New?Point(0,?100),?New?Point(0,?0),?New?Point(200,?0),?New?Point(200,?200))
g.Dispose()
Me.BackgroundImage?=?d
拖一個(gè)PictureBox1控件 創(chuàng)建一個(gè)Paint事件。在事件中加入 Private Sub PictureBox1_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles PictureBox1.Paint ' Create pens. Dim redPen As New Pen(Color.Red, 3) Dim greenPen As New Pen(Color.Green, 3) ' Create points that define curve. Dim point1 As New Point(50, 50) Dim point2 As New Point(100, 25) Dim point3 As New Point(200, 5) Dim point4 As New Point(250, 50) Dim point5 As New Point(300, 100) Dim point6 As New Point(350, 200) Dim point7 As New Point(250, 250) Dim curvePoints As Point() = {point1, point2, point3, point4, _ point5, point6, point7} ' Draw lines between original points to screen. e.Graphics.DrawLines(redPen, curvePoints) ' Draw curve to screen. e.Graphics.DrawCurve(greenPen, curvePoints) End Sub 得到數(shù)據(jù)后,改point的數(shù)據(jù)。然后PictureBox1.Refresh()就行了
構(gòu)造Pen的時(shí)候可以指定粗細(xì),如果你指定為1,并且放大了10倍,最后就成10了,所以你指定小點(diǎn)就行了,比如 Dim p As New Pen(Color.Black, 0.01) 最終繪制的線的粗細(xì)不會(huì)小于1
Private?Sub?Form_Load()
MSChart1.chartType?=?VtChChartType2dLine
Dim?arrValues()
ReDim?arrValues(1?To?5,?1?To?6)
Dim?i?As?Integer
For?i?=?1?To?5
arrValues(i,?1)?=?"t"??i?'x軸
arrValues(i,?2)?=?0?+?Rnd?*?100?'第一條線
arrValues(i,?3)?=?0?+?Rnd?*?100?'第二條線
arrValues(i,?4)?=?0?+?Rnd?*?100?'第三條線
arrValues(i,?5)?=?0?+?Rnd?*?100?'第四條線
arrValues(i,?6)?=?0?+?Rnd?*?100?'第五條線
Next?i
MSChart1.ChartData?=?arrValues
您好,您是想問vb.net連續(xù)繪制曲線圖不消失怎么辦?b.net連續(xù)繪制曲線圖不消失的解決辦法如下:
1、首先必須創(chuàng)建bitmap,關(guān)聯(lián)到picturebox1.image上。
2、再在picturebox1.image上創(chuàng)建Graphics,再進(jìn)行作圖。即可顯示線圖。