Public Class Form1
来源:互联网 发布:一起来做淘宝 编辑:程序博客网 时间:2024/05/18 13:27
计算机图形学课程作业-----画圆
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim G As Graphics = PictureBox1.CreateGraphics()
Dim Br As SolidBrush = New SolidBrush(Color.Blue)
Dim x0, y0, r, x, y As Integer
Dim d As Integer
d = 3 - 2 * r
x0 = Val(TextBox1.Text) : y0 = Val(TextBox2.Text) : r = Val(TextBox3.Text)
x = 0 : y = r
Do While x <= y
G.FillRectangle(Br, x0 + x, y0 + y, 1, 1)
G.FillRectangle(Br, x0 + y, y0 + x, 1, 1)
G.FillRectangle(Br, x0 - x, y0 - y, 1, 1)
G.FillRectangle(Br, x0 - y, y0 - x, 1, 1)
G.FillRectangle(Br, x0 - x, y0 + y, 1, 1)
G.FillRectangle(Br, x0 - y, y0 + x, 1, 1)
G.FillRectangle(Br, x0 + x, y0 - y, 1, 1)
G.FillRectangle(Br, x0 + y, y0 - x, 1, 1)
If d < 0 Then
d = d + 4 * x + 6
Else
d = d + 4 * (x - y) + 10
y = y - 1
End If
x = x + 1
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Me.Refresh()
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
End
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
TextBox1.Text = 150 : TextBox2.Text = 200 : TextBox3.Text = 100
End Sub
End Class
- Public Class Form1
- Form1
- form1
- Form1
- 2016-05-09Load事件、public Form1()和 Paint事件
- public class与public partial class
- public class与public partial class 区别
- public class与public partial class
- public class Object
- C# public class Person
- class CrobotApp : public CWinApp
- class CSplitterWnd :public CSplitterWnd
- class IconEditor : public QWidget
- public class MyEclipseRegister{
- C++ public class
- public class staticInter
- public class Unname2
- public class CharToByte {
- Form1.Command1.Visible=True
- Android OpenGL ES 开发教程(3):OpenGL ES管道(Pipeline)
- inux僵尸进程产生及如何避免
- 学习敏捷开发,party_bid故事卡1---创建活动
- 【设计模式】命令模式
- Public Class Form1
- 单词数 (STL set集合)
- Intent调用系统拍照程序,返回图片太小的问题
- Android OpenGL ES 开发教程(4):OpenGL ES API 命名习惯
- popupWindow简单用法实例
- 写给新入职的毕业生们
- DSP芯片的定点运算
- Imports Microsoft.Office.Interop
- LeetCode-Word Search