请问怎样用LINE方法怎样编写一个在屏幕上随机产生2条长度宽度和颜色各异的直线段吗?具体程序编码
来源:学生作业帮 编辑:大师作文网作业帮 分类:综合作业 时间:2024/11/11 01:55:38
请问怎样用LINE方法怎样编写一个在屏幕上随机产生2条长度宽度和颜色各异的直线段吗?具体程序编码
Private Sub Form_Click()
Dim X1 As Long,Y1 As Long,X2 As Long,Y2 As Long
Dim M1 As Long,N1 As Long,M2 As Long,N2 As Long
Dim L1 As Long,L2 As Long
Dim R1 As Integer,G1 As Integer,B1 As Integer
Dim R2 As Integer,G2 As Integer,B2 As Integer
Dim P As Boolean
Cls
Randomize
'Do
X1 = Int(Rnd * Me.Width):Y1 = Int(Rnd * Me.Height)
X2 = Int(Rnd * Me.Width):Y2 = Int(Rnd * Me.Height)
M1 = Int(Rnd * Me.Width):N1 = Int(Rnd * Me.Height)
M2 = Int(Rnd * Me.Width):N2 = Int(Rnd * Me.Height)
' If (X1 M1 Or Y1 N1) And (X2 M2 Or Y2 N2) Then P = True
'Loop While P = True
P = False
Do
L1 = Int(Rnd * 1000) + 4000:L2 = Int(Rnd * 1000) + 4000 '此处的1000和4000可以根据需要去调整,这儿只是为了一种效果,能让你看出来
If L1 L2 Then P = True
Loop Until P = True
P = False
Do
R1 = Int(Rnd * 255):G1 = Int(Rnd * 255):B1 = Int(Rnd * 255)
R2 = Int(Rnd * 255):G2 = Int(Rnd * 255):B2 = Int(Rnd * 255)
If (R1 R2) Or (G1 G2) Or (B1 B2) Then P = True
Loop Until P = True
Me.DrawWidth = 4
Line (X1,Y1)-(X2,Y2),RGB(R1,G1,B1)
Line (M1,N1)-(M2,N2),RGB(R2,G2,B2)
End Su
Dim X1 As Long,Y1 As Long,X2 As Long,Y2 As Long
Dim M1 As Long,N1 As Long,M2 As Long,N2 As Long
Dim L1 As Long,L2 As Long
Dim R1 As Integer,G1 As Integer,B1 As Integer
Dim R2 As Integer,G2 As Integer,B2 As Integer
Dim P As Boolean
Cls
Randomize
'Do
X1 = Int(Rnd * Me.Width):Y1 = Int(Rnd * Me.Height)
X2 = Int(Rnd * Me.Width):Y2 = Int(Rnd * Me.Height)
M1 = Int(Rnd * Me.Width):N1 = Int(Rnd * Me.Height)
M2 = Int(Rnd * Me.Width):N2 = Int(Rnd * Me.Height)
' If (X1 M1 Or Y1 N1) And (X2 M2 Or Y2 N2) Then P = True
'Loop While P = True
P = False
Do
L1 = Int(Rnd * 1000) + 4000:L2 = Int(Rnd * 1000) + 4000 '此处的1000和4000可以根据需要去调整,这儿只是为了一种效果,能让你看出来
If L1 L2 Then P = True
Loop Until P = True
P = False
Do
R1 = Int(Rnd * 255):G1 = Int(Rnd * 255):B1 = Int(Rnd * 255)
R2 = Int(Rnd * 255):G2 = Int(Rnd * 255):B2 = Int(Rnd * 255)
If (R1 R2) Or (G1 G2) Or (B1 B2) Then P = True
Loop Until P = True
Me.DrawWidth = 4
Line (X1,Y1)-(X2,Y2),RGB(R1,G1,B1)
Line (M1,N1)-(M2,N2),RGB(R2,G2,B2)
End Su
请问怎样用LINE方法怎样编写一个在屏幕上随机产生2条长度宽度和颜色各异的直线段吗?具体程序编码
编写一个VB循环程序用line方法或line控件对象在屏幕上随机产生20条长度、颜色、宽度各异的直线段
请问如何编写一个程序,在屏幕上打印出一个用"*"构成的菱形?
用类似下面的方法编写C语言程序,使得在屏幕上能够打出一个等腰三角形.
编写一个程序,在屏幕上打印出一个用“★”构成的菱形
编写一个程序,输入一个三位数整数,正确分离出它的个位、十位和百位数字,并分别在屏幕上输出.
pascal程序怎样随机产生一个三位数?并解释为什么要这样编写?
编写程序,要求输入一个三位整数,正确分离出它的个位、十位和百位数字,并在屏幕上显示出来.
编写一个C语言程序:用来实现在屏幕上显示一句话:Hello World!.
JAVA编写程序,在屏幕上输出200以内不能被3整除的数和(1+2+4+5+7+…+200)
用Java编写一个小应用程序.程序随机生成1,2,3三个随机数,如果生成1,则绘制10条直线
我想编写一个wp上的背单词软件,每次随机抽取几个单词显示在屏幕上,单词词库应该写在txt立马?