vbnet画坐标刻度,vb坐标系刻度怎么标
如何用vb画坐标系?
坐标原点默认是左上角,可以改变的,FORM1.SCALE
成都创新互联公司主要从事成都做网站、成都网站建设、网页设计、企业做网站、公司建网站等业务。立足成都服务白银,十年网站建设经验,价格优惠、服务专业,欢迎来电咨询建站服务:028-86922220
(X1,Y1)-(X2,Y2)横坐标范围是从X1到X2,纵坐标是从Y1到Y2,若坐标设在窗体中间,则FORM1.SCALE
(-ME.WIDTH/2,-ME.HEIGTH/2)-(ME.WIDTH/2,ME.HEIGTH/2),画横坐标ME.LINE
(-ME.WIDTH/2,0)-(ME.WIDTH/2,0)
画纵坐标FORM1.LINE
(0,-ME.HEIGTH/2,0,ME.HEIGTH/2)
在vb里怎么给坐标轴标刻度
Sub Draw(Form As PictureBox, x As Integer, y As Integer)
Const Offset AsSingle = 0.5
Dim i As Long
Form.AutoRedraw= True
Form.Scale (-x,y)-(x, -y) '定义坐标系
Form.Line (-x,0)-(x, 0) 'X轴
Form.Line (0,-y)-(0, y) 'Y轴
For i = -x To x- 1
Form.Line(i, 0)-(i, 0.2) 'X轴点
Next i
For i = -y To y- 1
Form.Line(0, i)-(0.2, i) 'Y轴点
Next i
Form.Line (x,0)-(x - Offset, Offset) 'X箭头
Form.Line (x,0)-(x - Offset, -Offset)
Form.Line (0,y)-(-Offset, y - Offset) 'Y箭头
Form.Line (0,y)-(Offset, y - Offset)
End Sub
Private Sub Command2_Click()
Picture1.Cls
Draw Picture1,10, 10
End Sub
vb.net怎么自定义坐标系
scale(x1,y1)-(x2,y2)
你只要记住,这里的x1,y1是左上角的坐标,x2,y2是右下角的坐标,通过这两个点的坐标设定,就可以决定坐标原点的位置以及坐标轴的方向了,比如
Scale (-300,200)-(300,-200)
以上是把坐标原点设在窗体中心,x轴长600,方向从左到右,y轴长400,方向从下向上。
Scale (800,0)-(0,600)
以上是把坐标原点设在窗体右上角,x轴长800,方向从右到左,y轴长600,方向从上向下。
下面说坐标轴和原点的标示法:
假定自定义坐标设为:
Scale (-300, 200)-(300, -200)
则
Line (-300, 0)-(300, 0) '画x轴
Line (0, 200)-(0, -200) '画y轴
CurrentX = 290
CurrentY = -5
Print "x" '标示x轴
CurrentX = 5
CurrentY = 200
Print "y" '标示y轴
CurrentX = 5
CurrentY = -5
Print "0" '标示原点
怎样在vb.net的picturebox里画出坐标啊?
自己用GDI+画的 无论什么什么尺寸的picturebox都行
不过别太小了o(∩_∩)o
代码放在哪里自己决定啊
最好是放在 picturebox的resize时间里
每次picturebox大小改变都重画一次坐标
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
分享标题:vbnet画坐标刻度,vb坐标系刻度怎么标
标题链接:http://pwwzsj.com/article/hopihj.html