加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

vb.net 绘制sin函数

发布时间:2020-12-17 08:15:56 所属栏目:百科 来源:网络整理
导读:Public Class Form1 Private Sub Form1_Paint(ByVal sender As Object,ByVal e As System.Windows.Forms.PaintEventArgs) Handles Me.Paint Dim G As Graphics G = Me.CreateGraphics() Dim PS(1000) As Point Dim I For I = 0 To 1000 PS(I).X = I PS(I).Y
Public Class Form1

    Private Sub Form1_Paint(ByVal sender As Object,ByVal e As System.Windows.Forms.PaintEventArgs) Handles Me.Paint
        Dim G As Graphics
        G = Me.CreateGraphics()
        Dim PS(1000) As Point
        Dim I
        For I = 0 To 1000
            PS(I).X = I
            PS(I).Y = Me.Height / 2 - 10 * Math.Sin(I / 10)
        Next I
        Dim x As Integer = Me.ClientSize.Width / 2
        Dim y As Integer = Me.ClientSize.Height / 2 + 20
        G.DrawLine(Pens.Red,x,100,200)
        G.DrawLine(Pens.Red,y,300,y)
        G.DrawLines(Pens.Red,PS)
    End Sub
End Class

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读