多線段沒畫過,
創(chuàng)新互聯(lián)專注為客戶提供全方位的互聯(lián)網(wǎng)綜合服務(wù),包含不限于網(wǎng)站制作、做網(wǎng)站、楚雄州網(wǎng)絡(luò)推廣、微信小程序、楚雄州網(wǎng)絡(luò)營(yíng)銷、楚雄州企業(yè)策劃、楚雄州品牌公關(guān)、搜索引擎seo、人物專訪、企業(yè)宣傳片、企業(yè)代運(yùn)營(yíng)等,從售前售中售后,我們都將竭誠(chéng)為您服務(wù),您的肯定,是我們最大的嘉獎(jiǎng);創(chuàng)新互聯(lián)為所有大學(xué)生創(chuàng)業(yè)者提供楚雄州建站搭建服務(wù),24小時(shí)服務(wù)熱線:18980820575,官方網(wǎng)址:www.cdcxhl.com
線倒是畫過,二話不說(shuō)直接上代碼你參考一下
繪制邊框
Private Sub Command4_Click()
Set acadDoc = acadApp.ActiveDocument
link2
acadDoc.ActiveLayer = acadlay(0)
With adoRes
While Not .EOF
pt1(0) = !X: pt1(1) = !Y: pt1(2) = !z: pt2(0) = !X1: pt2(1) = !Y1: pt2(2) = !z1
draw pt1, pt2
.MoveNext
Wend
End With
pt1(0) = 0: pt1(1) = 0: pt1(2) = 0
pt2(0) = 20: pt2(1) = 10: pt2(2) = 0
draw pt1, pt2
'在坡
pt1(0) = 0: pt1(1) = 0: pt1(2) = 0
pt2(0) = 20: pt2(1) = 10: pt2(2) = 0
draw pt1, pt2
For c = 0 To 50 Step 10
pt1(0) = 0: pt1(1) = c: pt1(2) = 0
pt2(0) = 270: pt2(1) = c: pt2(2) = 0
draw pt1, pt2
Next c
pt1(0) = 20: pt1(1) = 0: pt1(2) = 0
pt2(0) = 20: pt2(1) = 190: pt2(2) = 0
draw pt1, pt2
pt1(0) = 0: pt1(1) = 0: pt1(2) = 0
pt2(0) = 0: pt2(1) = -10: pt2(2) = 0
draw pt1, pt2
pt1(0) = 0: pt1(1) = -10: pt1(2) = 0
pt2(0) = 270: pt2(1) = -10: pt2(2) = 0
draw pt1, pt2
pt1(0) = 270: pt1(1) = -10: pt1(2) = 0
pt2(0) = 270: pt2(1) = 0: pt2(2) = 0
draw pt1, pt2
pt3(0) = 5: pt3(1) = -7
acadDoc.ModelSpace.AddText t, pt3, 4
pt3(0) = 55: pt3(1) = -7
acadDoc.ModelSpace.AddText t1, pt3, 4
a = 0
For c = 60 To 100 Step 10
pt1(0) = 20: pt1(1) = c: pt1(2) = 0
pt2(0) = 23: pt2(1) = c: pt2(2) = 0
draw pt1, pt2
pt1(0) = 10: pt1(1) = c - 1.6: pt1(2) = 0
acadDoc.ModelSpace.AddText a, pt1, 3.2
a = a + 2
Next c
'在圖中加入地面高程
acadDoc.ActiveTextStyle = acadDoc.TextStyles.Add("楷體")
pt1(0) = 1: pt1(1) = 13: pt1(2) = 0
Set acadtext = acadDoc.ModelSpace.AddText("地面高程", pt1, 3.2)
Call rote1(acadtext, pt1)
'在圖中加入設(shè)計(jì)高程
Call rote1(acadtext, pt1)
pt1(0) = 1: pt1(1) = 23: pt1(2) = 0
Set acadtext = acadDoc.ModelSpace.AddText("設(shè)計(jì)高程", pt1, 3.2)
Call rote1(acadtext, pt1)
'在圖中加入填挖高
pt1(0) = 1: pt1(1) = 33: pt1(2) = 0
Set acadtext = acadDoc.ModelSpace.AddText("填 挖 高", pt1, 3.2)
Call rote1(acadtext, pt1)
'在圖中加入坡度/坡長(zhǎng)
pt1(0) = 0: pt1(1) = 5.5: pt1(2) = 0
Set acadtext = acadDoc.ModelSpace.AddText("坡 度", pt1, 3.2)
Call rote1(acadtext, pt1)
pt1(0) = 9: pt1(1) = 1: pt1(2) = 0
Set acadtext = acadDoc.ModelSpace.AddText("坡 長(zhǎng)", pt1, 3.2)
Call rote1(acadtext, pt1)
'在圖中加入樁號(hào)
pt1(0) = 1: pt1(1) = 43: pt1(2) = 0
Set acadtext = acadDoc.ModelSpace.AddText("樁 號(hào)", pt1, 3.2)
Call rote1(acadtext, pt1)
Call Command5_Click
End Sub
Private Sub draw(pt1, pt2)
Set AcadLine = acadDoc.ModelSpace.AddLine(pt1, pt2)
acadDoc.Regen acActiveViewport
End Sub
線倒是畫過,二話不說(shuō)直接上代碼你參考一下
Dim b As New Bitmap(PictureBox1.Width, PictureBox1.Height)
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
。net ?其實(shí)還是很好繪制圖形的
你可以看下?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ù)說(shuō)明
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
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