vb点虐 连续画线函数 vba连续区域表示

VB 如何在picture中用line方法连续画线

VB可用object.Line - (x2, y2)写法实现在对象上绘制连续折线。

创新互联专注于企业成都全网营销、网站重做改版、临澧网站定制设计、自适应品牌网站建设、H5建站购物商城网站建设、集团公司官网建设、成都外贸网站制作、高端网站制作、响应式网页设计等建站业务,价格优惠性价比高,为临澧等各大城市提供网站开发制作服务。

Line 方法,在对象上画直线和矩形。

以下是具体实现绘制曲线的代码:

Option Explicit

Const PI = 3.14159265432

Private Sub Command1_Click()

Picture1.Scale (-2 * PI, 1)-(2 * PI, -1) '建立坐标系

Dim I As Single

Picture1.CurrentX = -2 * PI '建立当前坐标

Picture1.CurrentY = 0

For I = -2 * PI To 2 * PI Step 0.01

Picture1.Line -(I, Cos(3 * I) * Sin(5 * I)), vbRed '绘制曲线

Next

End Sub

运行效果:

VB点虐 中如何在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

VB如何画连续线

直接这样写:

line(X1,Y1)-(X2,Y2)

line -(X3,Y3)

这样第二次画线就是和第二个点是连在一起的。

这个比例的问题,你可以先用控件line在窗体上画出一个大概的线,经调整之后取line1的

X1,X2,Y1,Y2属性值就可以了。这样画出来的线就比较协调了。

vb点虐 的picturebox画直线的函数是哪个?vb6.0是picture1.line就可以,但是vb点虐 没有啊

Dim PtStart As Point '记录绘制直线的起始点

Dim PtEnd As Point '记录绘制直线的终点

Dim ShouldDrawLine As Boolean '是否绘制直线

'记录鼠标左键点击的位置,第二次点击后开始绘制直线

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)

'下面两句根据需要进行取舍

'Call DrawLine(PtStart, PtEnd) '绘制一条直线

Call DrawLines(PtStart, PtEnd) '绘制多条直线

ShouldDrawLine = False

End If

End If

End Sub

'绘制鼠标两次点击位置之间的直线

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

'绘制多条直线,每两次鼠标点击确定一条线

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

'此句不可删除,用于清除鼠标点击前的轨迹

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

Pic1.CreateGraphics.DrawLine(Pens.Blue, mPoint1, mPoint2) '绘制两点间的直线

End Sub

当前文章:vb点虐 连续画线函数 vba连续区域表示
标题网址:https://www.cdcxhl.com/article10/ddieego.html

成都网站建设公司_创新互联,为您提供小程序开发微信小程序GoogleChatGPT网站内链网页设计公司

广告

声明:本网站发布的内容(图片、视频和文字)以用户投稿、用户转载内容为主,如果涉及侵权请尽快告知,我们将会在第一时间删除。文章观点不代表本网站立场,如需处理请联系客服。电话:028-86922220;邮箱:631063699@qq.com。内容未经允许不得转载,或转载时需注明来源: 创新互联

成都定制网站建设