数学上不是有斜二测画法,算好坐标即可画出
创新互联建站是由多位在大型网络公司、广告设计公司的优秀设计人员和策划人员组成的一个具有丰富经验的团队,其中包括网站策划、网页美工、网站程序员、网页设计师、平面广告设计师、网络营销人员及形象策划。承接:成都做网站、成都网站制作、网站改版、网页设计制作、网站建设与维护、网络推广、数据库开发,以高性价比制作企业网站、行业门户平台等全方位的服务。
或者用AnyCAD的.Net图形控件
也可以调用matlab 实现
可以直接显示的。你看下面的示例,使用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不同。
VB.net已经有专门绘图的类。
可以定义笔刷然后用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
不用PictureBoxTest.Image属性,直接把图形绘制到PictureBoxTest上面就可以了。
Dim button As Integer = 0
Private Sub Button1_Click(ByVal sender As Object, ByVal e As EventArgs) _
Handles Button1.Click
Using g As Graphics = Graphics.FromHwnd(PictureBoxTest.Handle)
Dim penRed As Pen = New Pen(Color.Red, 1) '定义红色画笔
Dim penblue As Pen = New Pen(Color.Blue, 1) '定义蓝色画笔
If button = 0 Then
g.DrawLine(penRed, 0, 0, 100, 100)
button = 1
ElseIf button = 1 Then
g.DrawLine(penblue, 100, 100, 200, 200)
button = 0
End If
End Using
End Sub
drawpanel是什么东东,自定义控件吗?如果类似于picturebox,使用
'自动重绘要设为True,如果有这个属性的话
DrawPanel.AutoRedraw = True
'保存到变量
Image img = DrawPanel.Image
'直接设置Image属性即可
PictureBox1.Image = img
在窗体上拉一个Timer控件,enabled设为true,Interval设为20。完整代码如下: Dim myPen As New System.Drawing.Pen(System.Drawing.Color.Red)
Dim formGraphics As System.Drawing.Graphics
Dim num As Integer = 1
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
Me.Refresh() '清屏
formGraphics = Me.CreateGraphics()
formGraphics.DrawEllipse(myPen, New Rectangle(100, 100, num, num)) '在坐标(100,100)的位置画圆
If num 200 Then '如果大于200则停止画圆
myPen.Dispose()
formGraphics.Dispose()
Timer1.Enabled = False
Else
num = num + 1
End If
End Sub
售后响应及时
7×24小时客服热线数据备份
更安全、更高效、更稳定价格公道精准
项目经理精准报价不弄虚作假合作无风险
重合同讲信誉,无效全额退款