精华内容
下载资源
问答
  • VB.NET 贪吃蛇 (画圆)

    千次阅读 2016-12-15 19:13:12
    VB.NET 贪吃蛇小游戏效果图如下 所有代码一共300行多一点,非常简单,下面依次介绍一下1.设计思路这个游戏(1)呢,得有个地图(2),有条蛇(3),有个蛋(4),所以一共设计了4个类,然后通过类之间的交互,在Form上的...

    VB.NET 贪吃蛇小游戏

    效果图如下
    这里写图片描述

    所有代码一共300行多一点,非常简单,下面依次介绍一下

    1.设计思路

    这个游戏(1)呢,得有个地图(2),有条蛇(3),有个蛋(4),所以一共设计了4个类,然后通过类之间的交互,在Form上的PictureBox上形成游戏效果。为什么还要弄个游戏类呢,因为这样新开一局游戏就非常简单了啊,直接new一个游戏类就可以了

    窗体设计图如下:
    这里写图片描述

    中间的是picturebox控件,起名为picshow

    2.地图类代码 Class Map

    Public Class Map
    
        Public width As Integer
        Public height As Integer
        Public cellWidth As Integer
        Public cellHeight As Integer
        Public Sub New(ByVal width As Integer, ByVal height As Integer, ByVal cellWidth As Integer, ByVal cellHeight As Integer)
            Me.width = width
            Me.height = height
            Me.cellWidth = cellWidth
            Me.cellHeight = cellHeight
        End Sub
    
    End Class
    

    地图的长宽,还有地图单位长宽,蛇每次移动一个单位的长或者宽

    3.蛇代码 Class Snake

    Public Class Snake
        Class SnakeBody
            Public x As Integer
            Public y As Integer
            Public r As Integer '半径
            Public c As Color   '颜色
            Public Sub New(ByVal x%, ByVal y%, ByVal r%, ByVal c As Color)
                Me.x = x
                Me.y = y
                Me.r = r
                Me.c = c
            End Sub
        End Class
    
        Public head As SnakeBody
        Public body() As SnakeBody
        Public bodyNum As Integer
        Public Sub New(ByVal x%, ByVal y%, ByVal r%, ByVal c As Color)
            head = New SnakeBody(x, y, r, c)
        End Sub
        Public Sub Move(ByVal Direction As Char, ByVal cellWidth As Integer, ByVal cellHeight As Integer)
            'body移动
            Dim i As Integer
            If bodyNum >= 2 Then
                For i = bodyNum - 1 To 1 Step -1
                    body(i).x = body(i - 1).x
                    body(i).y = body(i - 1).y
                Next
            End If
            If bodyNum >= 1 Then
                body(0).x = head.x
                body(0).y = head.y
            End If
    
            'head 移动
            Select Case Direction
                Case "w"c
                    head.y -= cellHeight
                Case "s"c
                    head.y += cellHeight
                Case "a"c
                    head.x -= cellWidth
                Case "d"c
                    head.x += cellWidth
            End Select
        End Sub
    
    
    End Class
    

    Snake类里面有一个Snakebody类,Snake分为一个head和不限量个body

    4蛋类,Class Egg

    Public Class Egg
    
        Public x As Integer
        Public y As Integer
        Public r As Integer '半径
        Public c As Color '颜色
        Public rand As Random
        Public Sub New()
            rand = New Random()
        End Sub
        Public Sub RandInfo(ByVal width As Integer, ByVal height As Integer)
            '将自己的坐标随机设定在地图内,随机一个半径和颜色
            r = rand.Next(5, 20)
            x = rand.Next(r, width - r)
            y = rand.Next(r, height - r)
            '随机10种颜色
            Dim cr As Integer
            cr = rand.Next(10)
            Select Case cr
                Case 0
                    c = Color.Red
                Case 1
                    c = Color.Orange
                Case 2
                    c = Color.Yellow
                Case 3
                    c = Color.Green
                Case 4
                    c = Color.Beige
                Case 5
                    c = Color.Blue
                Case 6
                    c = Color.Peru
                Case 7
                    c = Color.Pink
                Case 8
                    c = Color.SkyBlue
                Case 9
                    c = Color.Salmon
            End Select
        End Sub
    
    End Class
    

    蛋有坐标,颜色,半径等参数,还有一个RandInfo函数,当蛇吃到蛋以后会调用这个函数,重置这个蛋的参数。蛋的半径决定了吃了这个蛋会得多少分。

    5. Game类 Class Game

    一个游戏,应该包含一个地图、一条蛇、一个蛋,嗯

    还加了一个简单的保存游戏时间和分数的功能。

    通过Direction来控制方向,按w、a、s、d会改变Direction

    Public Class Game
        Public mySnake As Snake
        Public myMap As Map
        Public myEgg As Egg
        Public Score As Integer  
        Public Direction As Char = "w"c '一出来往上走
        Public lk As Integer = 10  '窗体周围留空大小
    
        Public Sub New(ByVal width As Integer, ByVal height As Integer, ByVal cellWidth As Integer, ByVal cellHeight As Integer)
            myMap = New Map(width, height, cellWidth, cellHeight)
            mySnake = New Snake(myMap.width \ 2, myMap.height \ 2, myMap.cellWidth, Color.Black)
            myEgg = New Egg()
            myEgg.RandInfo(myMap.width, myMap.height)
        End Sub
    
        Public Function JudgeDie() As Boolean
            '超出map范围返回True,没超出 检测是否撞了自己
            If mySnake.head.x - mySnake.head.r < 0 Or mySnake.head.x + mySnake.head.r > myMap.width Or
               mySnake.head.y - mySnake.head.r < 0 Or mySnake.head.y + mySnake.head.r > myMap.height Then
                Return True
            ElseIf mySnake.bodyNum > 2 Then '从body(2)开始检测是否与head撞了
                Dim i As Integer
                For i = 2 To mySnake.bodyNum - 1
                    Dim d As Single
                    d = (mySnake.head.x - mySnake.body(i).x) ^ 2 + (mySnake.head.y - mySnake.body(i).y) ^ 2
                    d = Math.Sqrt(d)
                    Dim r1, r2 As Integer
                    r1 = mySnake.head.r
                    r2 = mySnake.body(i).r
                    If (d < r1 + r2) Then 'head 与body 撞了
                        Return True
                    End If
                Next
                Return False
            Else
                Return False
            End If
        End Function
    
        Public Function JudgeScore() As Boolean '是否吃到蛋需要加分
            '检查蛇头和蛋的距离
            Dim d As Single
            d = (mySnake.head.x - myEgg.x) ^ 2 + (mySnake.head.y - myEgg.y) ^ 2
            d = Math.Sqrt(d)
            Dim r1, r2 As Integer
            r1 = mySnake.head.r
            r2 = myEgg.r
            If (d < r1 + r2) Then ' eat egg
                'inc score
                Score += myEgg.r
                'inc snakebody
                Dim x, y As Integer
                Select Case Direction
                    Case "w"
                        x = mySnake.head.x
                        y = mySnake.head.y - myEgg.r
                    Case "s"
                        x = mySnake.head.x
                        y = mySnake.head.y + myEgg.r
                    Case "a"
                        x = mySnake.head.x + myEgg.r
                        y = mySnake.head.y
                    Case "d"
                        x = mySnake.head.x - myEgg.r
                        y = mySnake.head.y
                End Select
                ReDim Preserve mySnake.body(mySnake.bodyNum + 1)
                mySnake.body(mySnake.bodyNum) = New Snake.SnakeBody(x, y, mySnake.head.r, myEgg.c)
                mySnake.bodyNum += 1
                'randinfo egg
                myGame.myEgg.RandInfo(myMap.width, myMap.height)
    
                Return True
            End If
            Return False
        End Function
    
        Public Sub WriteToFile()
            Dim path As String = Application.StartupPath & "\record.txt"
            If (Not IO.File.Exists(path)) Then
                Dim sw As IO.StreamWriter = IO.File.CreateText(path)
                Using (sw)
                    sw.WriteLine(Now() & " " & "Score= " & Score)
                End Using
                MessageBox.Show("创建记录文件")
                Exit Sub
            End If
            Dim sw1 = IO.File.AppendText(path)
            Using (sw1)
                sw1.WriteLine(Now() & " " & "Score= " & Score)
            End Using
        End Sub
    
        Public Sub ReadFile()
            Dim path As String = Application.StartupPath & "\record.txt"
            If (Not IO.File.Exists(path)) Then
                MessageBox.Show("记录文件不存在")
                Exit Sub
            End If
            Dim txt As String = IO.File.ReadAllText(path)
            MessageBox.Show(txt)
        End Sub
    End Class
    

    6.模块和窗体代码

    模块代码,给一个Game类就可以了

    Module Module1
        Public myGame As Game
    End Module
    

    窗体代码

    Option Explicit On
    
    Public Class Form1
        Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
            myGame = New Game(500, 500, 10, 10)
            PicShow.Width = myGame.myMap.width + 1
            PicShow.Height = myGame.myMap.height + 1 '为什么都+1,把+1去掉后运行一下看看就知道了
            PicShow.Left = myGame.lk
            PicShow.Top = 3 * myGame.lk
            Me.Width = PicShow.Width + 4 * myGame.lk
            Me.Height = PicShow.Height + 8 * myGame.lk
            Timer1.Enabled = False
        End Sub
        Private Sub PicShow_Paint(sender As Object, e As PaintEventArgs) Handles PicShow.Paint
    
            'Paint the grid
            Dim x, y, i As Integer
            Dim sw, sh, w, h As Integer
            sw = myGame.myMap.cellWidth
            sh = myGame.myMap.cellHeight
            w = myGame.myMap.width
            h = myGame.myMap.height
            x = w \ sw
            y = h \ sh
            Dim mygraphics As Graphics
            mygraphics = e.Graphics
            For i = 0 To x Step x 
                mygraphics.DrawLine(Pens.Black, i * sw, 0, i * sw, h)
            Next
            For i = 0 To y Step y
                mygraphics.DrawLine(Pens.Black, 0, i * sh, w, i * sh)
            Next
    
            'paint the snake head
            Dim mybrush As New SolidBrush(myGame.mySnake.head.c)
            Dim r As Integer
            x = myGame.mySnake.head.x
            y = myGame.mySnake.head.y
            r = myGame.mySnake.head.r
            Dim rect As Rectangle = New Rectangle(x - r, y - r, 2 * r, 2 * r)
            myGraphics.DrawEllipse(Pens.Black, rect)
            myGraphics.FillEllipse(mybrush, rect)
            mybrush = Nothing
            'paint the snake body
            If (myGame.mySnake.bodyNum > 0) Then
                For i = 0 To myGame.mySnake.bodyNum - 1
                    x = myGame.mySnake.body(i).x
                    y = myGame.mySnake.body(i).y
                    r = myGame.mySnake.body(i).r
                    Dim mybrush1 As New SolidBrush(myGame.mySnake.body(i).c)
                    Dim mypen As New Pen(myGame.mySnake.body(i).c)
                    myGraphics.DrawEllipse(mypen, x - r, y - r, 2 * r, 2 * r)
                    myGraphics.FillEllipse(mybrush1, x - r, y - r, 2 * r, 2 * r)
                Next
            End If
            'paint the egg
            x = myGame.myEgg.x
            y = myGame.myEgg.y
            r = myGame.myEgg.r
            Dim mybrush2 As New SolidBrush(myGame.myEgg.c)
            Dim mypen2 As New Pen(myGame.myEgg.c)
            myGraphics.DrawEllipse(mypen2, x - r, y - r, 2 * r, 2 * r)
            myGraphics.FillEllipse(mybrush2, x - r, y - r, 2 * r, 2 * r)
    
        End Sub
    
        Private Sub MnuStart_Click(sender As Object, e As EventArgs) Handles MnuStart.Click
            Select Case MnuStart.Text
                Case "开始游戏(Enter)"
                    myGame = New Game(500, 500, 10, 10)
                    Dim gr As Graphics
                    gr = PicShow.CreateGraphics()
                    Dim mybrush As New SolidBrush(myGame.mySnake.head.c)
                    Dim x, y, r As Integer
                    x = myGame.mySnake.head.x
                    y = myGame.mySnake.head.y
                    r = myGame.mySnake.head.r
                    Dim rect As Rectangle = New Rectangle(x - r, y - r, 2 * r, 2 * r)
                    gr.DrawEllipse(Pens.Black, rect)
                    gr.FillEllipse(mybrush, rect)
                    Timer1.Enabled = True
                    MnuStart.Text = "暂停游戏(Enter)"
                Case "暂停游戏(Enter)"
                    Timer1.Enabled = False
                    MnuStart.Text = "继续游戏(Enter)"
                Case "继续游戏(Enter)"
                    Timer1.Enabled = True
                    MnuStart.Text = "暂停游戏(Enter)"
            End Select
        End Sub
    
        Private Sub MnuQuit_Click(sender As Object, e As EventArgs) Handles MnuQuit.Click
            End
        End Sub
    
        Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick
            Dim sw, sh As Integer
            sw = myGame.myMap.cellWidth
            sh = myGame.myMap.cellHeight
            myGame.mySnake.Move(myGame.Direction, sw, sh)
            PicShow.Refresh()
            '撞墙死亡检测
            If myGame.JudgeDie Then
                Timer1.Enabled = False
                MessageBox.Show("撞死了!您的分数为: " & myGame.Score, "提示", MessageBoxButtons.OK, MessageBoxIcon.Information)
                myGame.WriteToFile()
                MnuStart.Text = "开始游戏(Enter)"
                MnuScore.Text = "分数: 0"
                Exit Sub
            End If
            '吃蛋检测
            If myGame.JudgeScore Then
                MnuScore.Text = "分数: " & myGame.Score
                Exit Sub
            End If
    
        End Sub
    
    
        Private Sub Form1_KeyDown(sender As Object, e As KeyEventArgs) Handles Me.KeyDown
            Select Case e.KeyCode
                Case Keys.W
                    If (myGame.Direction = "s"c) Then Exit Sub
                    myGame.Direction = "w"c
                Case Keys.S
                    If (myGame.Direction = "w"c) Then Exit Sub
                    myGame.Direction = "s"c
                Case Keys.A
                    If (myGame.Direction = "d"c) Then Exit Sub
                    myGame.Direction = "a"c
                Case Keys.D
                    If (myGame.Direction = "a"c) Then Exit Sub
                    myGame.Direction = "d"c
                Case Keys.Enter
                    MnuStart_Click(sender, e)
            End Select
        End Sub
    
        Private Sub MnuRecord_Click(sender As Object, e As EventArgs) Handles MnuRecord.Click
            myGame.ReadFile()
        End Sub
    
        Private Sub 帮助ToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles 帮助ToolStripMenuItem.Click
            Dim msg As String
            msg = "游戏方法:" & vbCrLf
            msg &= "使用w,a,s,d来控制方向" & vbCrLf
            msg &= "按回车键 开始/暂停"
            MessageBox.Show(msg, "帮助")
        End Sub
    End Class
    

    结束

    刚转入VB.NET几天,这是第一个VB.NET的小游戏!还是蛮开心的0 0

    展开全文
  • VB使用控件数组划直线,画矩形,画圆等,基于VB6.0开发的,代码简单,有参考性,对入门者比较友好,欢迎大家参考。
  • vb.net简单画图实现,画圆,画矩形,画直线,画笔,裁剪等基本画图功能
  • VB6围棋:窗体画线和画圆的应用

    千次阅读 2015-08-30 16:11:48
    Option Explicit Dim qipan(1 To 19, 1 To 19) As Integer '棋盘数组,0:无 1:黑子 2:白子Private Sub Form_Load() Me.AutoRedraw = True End SubPrivate Sub Form_MouseUp(Button As Integer, Shift As Integer,...
    Option Explicit
    Dim qipan(1 To 19, 1 To 19) As Integer '棋盘数组,0:无 1:黑子 2:白子
    
    Private Sub Form_Load()
    Me.AutoRedraw = True
    End Sub
    
    Private Sub Form_MouseUp(Button As Integer, Shift As Integer, x As Single, y As Single)
    
    Static c As Boolean '落子颜色
    Dim x0 As Integer, y0 As Integer '落子坐标
    
    x0 = Int(x + 0.5) '坐标四舍五入
    y0 = Int(y + 0.5)
    
    If x0 > 0 And x0 < 21 And y0 > 0 And y0 < 21 Then '是否在鼠标点在棋盘上?
    If qipan(x0, y0) = 0 Then '这一格是否已经有子?
    c = Not c '黑白转换
    FillStyle = 0
    If c Then '黑子还是白子
    FillColor = vbBlack
    qipan(x0, y0) = 1
    Else
    FillColor = vbWhite
    qipan(x0, y0) = 2
    End If
    Me.Circle (x0, y0), 0.25 '画棋子
    End If
    End If
    
    End Sub
    
    Private Sub Form_Resize()
    
    Dim i As Integer, j As Integer
    
    If Me.WindowState <> vbMinimized Then '不是最小化状态
    Me.Cls '清屏
    Me.Scale (0, 0)-(20, 20) '定义棋盘坐标系
    
    For i = 1 To 19
    Me.Line (i, 1)-(i, 19) '画19道竖线
    Me.Line (1, i)-(19, i) '画19道横线
    Next
    
    FillStyle = 0
    For i = 0 To 8 '画9个星位
    Me.Circle ((i Mod 3) * 6 + 4, (i \ 3) * 6 + 4), 0.1
    Next
    
    For i = 1 To 19 '重绘棋子
    For j = 1 To 19
    If qipan(i, j) = 1 Then
    FillColor = vbBlack
    Me.Circle (i, j), 0.25
    ElseIf qipan(i, j) = 2 Then
    FillColor = vbWhite
    Me.Circle (i, j), 0.25
    End If
    Next
    Next
    
    End If
    End Sub

    这里写图片描述
    窗体可随意拉伸,棋盘和棋子实时重绘。

    展开全文
  • vb.net二次开发AutoCAD中画圆示例

    千次阅读 2012-08-28 13:39:45
    Imports Autodesk Imports Autodesk.AutoCAD.Interop Imports Autodesk.AutoCAD.Interop.Common imports Autodesk.AutoCAD.ApplicationServices Imports Autodesk.AutoCAD.DatabaseServices Imports Autodesk.A

    Imports Autodesk
    Imports Autodesk.AutoCAD.Interop
    Imports Autodesk.AutoCAD.Interop.Common
    imports Autodesk.AutoCAD.ApplicationServices
    Imports Autodesk.AutoCAD.DatabaseServices
    Imports Autodesk.AutoCAD.Runtime
    Imports Autodesk.AutoCAD.Geometry

    Imports System

     Private Sub btnCircle_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCircle.Click
            '定义圆的圆心

            Dim center As Point3d = New Point3d(100, 100, 0)

            '定义圆的半径
            Dim radius As Double = 50

            '定义一个Circle对象来表示你要生成的圆,传入的第二个参数为圆的法向,
            '就是把圆生、//成在什么面上,因为AutoCAD程序一般都是平面问题,
            '因此你一般都把这个法向量定义成//z轴方向。
            Dim circle As Circle
            circle = New Circle(center, New Vector3d(0, 0, 1), radius)

            Dim bt As BlockTable
            Dim btr As BlockTableRecord

            Dim db As Database
            '获得当前活动AutoCAD文档所在的数据库
            db = Application.DocumentManager.MdiActiveDocument.Database

            '获得事务处理管理器
            Dim tm As Autodesk.AutoCAD.DatabaseServices.TransactionManager
            tm = db.TransactionManager

            '定义事务处理
            Dim trans As Transaction

            Try
                '开始事务处理,也就是往CAD中加入东西
                trans = tm.StartTransaction
                bt = tm.GetObject(db.BlockTableId, OpenMode.ForRead, False)

                '获得块表记录
                btr = tm.GetObject(bt(BlockTableRecord.ModelSpace), OpenMode.ForWrite, False)

                '向块表记录加入圆的相关信息
                btr.AppendEntity(Circle)

                '向AutoCAD加入圆
                tm.AddNewlyCreatedDBObject(Circle, True)

                trans.Commit()

            Catch ex As Exception
                Throw New ApplicationException(ex.Message)
            End Try

    end sub

    (参照了明经通道里的二次开发相关内容)

    展开全文
  • 画圆 圆心为(350,250)半径为200 Public Class Form1 Private Sub Form1_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles Me.Paint Dim gr As Graphics = Me.CreateG

    画圆 圆心为(350,250)半径为200

    Public Class Form1
        Private Sub Form1_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles Me.Paint
            Dim gr As Graphics = Me.CreateGraphics
            gr.DrawEllipse(Pens.Green, 350, 250, 50, 50)
            gr.Dispose()
        End Sub
    End Class


     

    画椭圆 和窗体相同大的椭圆

    Public Class Form1
        Private Sub Form1_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles Me.Paint
            Dim gr As Graphics = Me.CreateGraphics
            gr.DrawEllipse(Pens.Red, 0, 0, Me.ClientSize.Width, Me.ClientSize.Height)
            gr.Dispose()
        End Sub
    End Class


     

    画椭圆 改 (跟随窗体大小改变)

    Public Class Form1
        Private Sub Form1_Resize(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Resize
            Me.Refresh() '刷新
            Dim gr As Graphics = Me.CreateGraphics
            gr.DrawEllipse(Pens.Red, 0, 0, Me.ClientSize.Width, Me.ClientSize.Height)
            gr.Dispose()
        End Sub
    End Class


     

    画两点之间的线 例如 (100,30)到(500,300)之间的线

    Public Class Form1
        Private Sub Form1_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles Me.Paint
            Dim gr As Graphics = Me.CreateGraphics
            gr.DrawLine(Pens.Red, 100, 30, 500, 300)
            gr.Dispose()
        End Sub
    End Class
    


     

    图片的水平和垂直翻转

    Public Class Form1
        Private Sub Form1_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles Me.Paint
            Dim gr As Graphics = Me.CreateGraphics
            Dim img As Image = Image.FromFile("C:\Users\lenovo\Downloads\1.jpg")
            gr.DrawImage(img, 0, 0, 100, 100)
            gr.DrawImage(img, 0, 220, 100, -100) '垂直翻转
            gr.DrawImage(img, 230, 0, -100, 100) '水平翻转
            gr.Dispose()
        End Sub
    End Class

    绘制正方形

    Public Class Form1
        Private Sub Form1_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles Me.Paint
            Dim gr As Graphics = Me.CreateGraphics
            gr.DrawRectangle(Pens.Red, 130, 50, 300, 300)
            gr.Dispose()
        End Sub
    End Class
    



     

     

    展开全文
  • VB的picture控件里面画了1000来个圆,做颜色渐变,时间间隔30ms,是不是每次都要重新新画圆,如何才能不需要从新画圆,直接填充颜色,时间快点,有什么函数画圆速度更快的方法吗,谢谢 Private Sub Form_Load() ...
  • (本文适合VB初学者) 打开VB——新建标准EXE项目 完成这些最基本的之后点确定 ...VB里面承载绘图的控件主要有窗体和picturebox ...它们两个可以用line函数画直线/方块,Circle函数画圆 ...
  • VB 控件数组画图.rar

    2019-07-10 09:37:47
    VB 控件数组画图,每次输出新图形,前面的清除,可以画直线、矩形、圆。具体的代码操作,请看如下:  Private Sub Form_Load()  Picture1.Scale (0, 0)-(10, 10) '设置坐标系  End Sub  Private Sub Command1_...
  • vb生成饼图

    千次阅读 2006-12-27 11:05:00
    在做数据统计时往往要实现这一功能,在网上找了好几个例子,选定了两个,可是在VB6.0上运行都有些小错误,以下是修改后的代码,运行完全正确方法一:用画圆的方法Option Explicit Const PI As Double = 3.14159265359 ...
  • VB讲课笔记03:对象及其操作一、对象1、VB对象...如控件的移动、窗体画圆、窗体画线等动作。 对象的事件是外部作用在对象且能被对象识别的动作,如鼠标单击命令按钮、窗体上鼠标的移动,定时器的定时发生等。2、对...
  • 又一个VB.NET Draw绘图实例,可以画圆、直线、椭圆等图形,也可以直接在文字标签输出到图像上,演示了DrawLine、DrawEllipse、DrawRectangle、DrawCurve、DrawLines、DrawString、DrawsForm等。以下是简单的画圆、画...
  • skSegment = Part.SketchManager.CreateCircleByRadius(0, 0, 0, diameter / 2) '画圆 Part.ClearSelection2(True) skSegment = Part.SketchManager.CreateLine(0.0#, diameter / 2, 0.0#, 0.0#, -diameter / 2, ...
  • 21个绘图命令A:绘圆弧B:定义块C:画圆D:尺寸资源管理器E:删除F:倒圆角G:对象组合H:填充I:插入J:对接S:拉伸T:多行文本输入W:定义块并保存到硬盘中L:直线M:移动X:炸开V:设置当前坐标U:恢复上一次操做...
  • 聊天程序

    2006-02-23 09:05:59
    java,vc,vb,画圆,银行家算法
  • 由于利用 VBVB.NET 将CATIA 脚本转化为程序确实方便,不过利用C++来操作更适合于我这种开发者。 方法有好多种,这里以画圆作为一个简单例子。 1 利用 IDispatch 接口来编程 ...
  • teechart官网上我看到的怎么都是vc++和vb 的用法,vs2010的用法也只是网上千篇一律的。。 我想要控制图表上没有鼠标滚动的效果, ``` CScroll scroll=(CScroll)m_teeChart2.get_Scroll(); scroll.put_Enable...
  • vba编写kml圆思路

    2020-03-01 09:35:28
    工作原因要用vba编写一个批量生成kml圆的代码,在网上找了很久资料很少,好不容易找到一个还是一直在讲理论,看的晕头转向不说,最后的代码还不是用VB写的,更是看不懂,只能自己想办法了,写出解题过程和代码,供...
  • turtle——童年的记忆

    2017-10-26 17:24:27
    为什么以童年的记忆来命名这篇博文呢==,因为小学的微机课上我们学习的就是VB的小海龟,微机老师(校长)教我们用它作画,教我们一条条的语句,当时只把那些语句当作英语单词,当作对小海龟说的命令,殊不知,那就是...

空空如也

空空如也

1 2
收藏数 24
精华内容 9
关键字:

vb画圆