同学们提问关于“成像设计_在窗体上画一直线,用vb把这条直线设计成象钟表的秒针...[数学]”的问题,52IJ师说平台通过网络上精心整理了以下关于“成像设计_在窗体上画一直线,用vb把这条直线设计成象钟表的秒针...[数学]”的一些有用参考答案。请注意:文中所谈及的内容不代表本站的真正观点,也请不要相信各种联系方式。下面是本网所整理的“成像设计_在窗体上画一直线,用vb把这条直线设计成象钟表的秒针...[数学]”的相关信息:
在窗体上画一直线,用vb把这条直线设计成象钟表的秒针...
科目:数学 关键词:成像设计Private Sub Form_Load()
Timer1.Interval = 500
Form1.Height = 8085
Form1.Width = 9225
End Sub
Private Sub Timer1_Timer()
Cls
Scale (-2000,2000)-(3000,-2200)
Line (0,0)-(1000 * Sin(Second(Time) / 60 * 6.28),1000 * Cos(Second(Time) / 60 * 6.28)),255
Line (0,0)-(800 * Sin(Minute(Time) / 60 * 6.28),800 * Cos(Minute(Time) / 60 * 6.28)),200
If Hour(Time) > 12 Then
Line (0,0)-(600 * Sin((Hour(Time) - 12) / 12 * 6.28),600 * Cos((Hour(Time) - 12) / 12 * 6.28)),0
Else
Line (0,0)-(600 * Sin(Hour(Time) / 12 * 6.28),600 * Cos(Hour(Time) / 12 * 6.28)),0
End If
Circle (0,0),1000
End Sub
其他类似问题
问题1:用VB编一个钟表,表针运动程序怎么编?我用VB编了一个钟表,可表针(不是数字!)1秒1秒在变动,怎么编写这段程序?
这个比较麻烦,我曾经写过这么个程序片段,现在贴上来,代码比较复杂
Shape1是时钟的一个框,是Shape控件,设置 Height 1455 Width 1575
LineHour,LineMinute,LineSecond分别为时,分,秒针,为Line控件
Label3,Label6,Label9,Label12为Label控件,分别为3.6.912点的显示数字
再画个Timer控件,Interval设置为1000
以上控件位置随便放,代码里调整
Form_Load事件里写
Shape1.Top = 100
Shape1.Left = Me.Width - 1800
LineHour.X1 = Shape1.Left + Shape1.Width / 2
LineHour.Y1 = Shape1.Top + Shape1.Height / 2
LineMinute.X1 = Shape1.Left + Shape1.Width / 2
LineMinute.Y1 = Shape1.Top + Shape1.Height / 2
LineSecond.X1 = Shape1.Left + Shape1.Width / 2
LineSecond.Y1 = Shape1.Top + Shape1.Height / 2
Label3.Left = Shape1.Left + Shape1.Width - Label3.Width - 200
Label3.Top = Shape1.Top + (Shape1.Height - Label3.Height) / 2
Label6.Left = Shape1.Left + (Shape1.Width - Label6.Width) / 2
Label6.Top = Shape1.Top + Shape1.Height - Label6.Height + 20
Label9.Left = Shape1.Left + 200
Label9.Top = Shape1.Top + (Shape1.Height - Label9.Height) / 2
Label12.Left = Shape1.Left + (Shape1.Width - Label12.Width) / 2
Label12.Top = Shape1.Top + 100
Timer事件里写
'利用Label显示数字
If Shape1.Visible True Then Shape1.Visible = True
If LineHour.Visible True Then LineHour.Visible = True
If LineMinute.Visible True Then LineMinute.Visible = True
If LineSecond.Visible True Then LineSecond.Visible = True
If Label3.Visible True Then Label3.Visible = True
If Label6.Visible True Then Label6.Visible = True
If Label9.Visible True Then Label9.Visible = True
If Label12.Visible True Then Label12.Visible = True
Dim cx As Single,cy As Single '圆心坐标
cx = Shape1.Left + Shape1.Width / 2
cy = Shape1.Top + Shape1.Height / 2
'利用Line控件绘制指针
LineSecond.X2 = LineSecond.X1 + Sin(CLng(Second(Now)) / 60 * 2 * pi) * 480
LineSecond.Y2 = LineSecond.Y1 - Cos(CLng(Second(Now)) / 60 * 2 * pi) * 480
LineMinute.X2 = LineMinute.X1 + Sin(CLng(Minute(Now)) / 60 * 2 * pi) * 360
LineMinute.Y2 = LineMinute.Y1 - Cos(CLng(Minute(Now)) / 60 * 2 * pi) * 360
LineHour.X2 = LineHour.X1 + Sin((CLng(Hour(Now)) + CLng(Minute(Now)) / 60) / 12 * 2 * pi) * 240
LineHour.Y2 = LineHour.Y1 - Cos((CLng(Hour(Now)) + CLng(Minute(Now)) / 60) / 12 * 2 * pi) * 240
'利用Line方法绘制刻度
Me.Line (cx + 250,cy - 433.012701892219)-(cx + 300,cy - 519.615242270663)
Me.Line (cx + 433.012701892219,cy - 250)-(cx + 519.615242270663,cy - 300)
Me.Line (cx + 433.012701892219,cy + 250)-(cx + 519.615242270663,cy + 300)
Me.Line (cx + 250,cy + 433.012701892219)-(cx + 300,cy + 519.615242270663)
Me.Line (cx - 250,cy + 433.012701892219)-(cx - 300,cy + 519.615242270663)
Me.Line (cx - 433.012701892219,cy + 250)-(cx - 519.615242270663,cy + 300)
Me.Line (cx - 433.012701892219,cy - 250)-(cx - 519.615242270663,cy - 300)
Me.Line (cx - 250,cy - 433.012701892219)-(cx - 300,cy - 519.615242270663)
问题2:钟表上的秒针在平移运动.______.[数学科目]
题中钟表秒针的运动特点是:指针围绕一点做圆周运动.
由平移的概念:将一个图形沿着一定的方向移动一定的距离,叫做平移.平移不改变图形的形状,大小,只改变图形的位置.可知,钟表上的秒针在平移运动的说法错误.
故答案为:错误.
- 雅思考试券_...the boxes and shade the number雅
- 正方体素描_求学素描的正方体的各各角度的图![数
- 心情不好的文章_你的朋友tim最近心情不好,几次考
- moto rokr e6_...因此,他爱上了Motorola ROKR E6
- 田子坊攻略_上海田子坊的英语怎么说啊[英语]
- ankle的意思_ankle是什么意思?
- 把爱深藏_把爱深藏心底翻译成英语怎么写?
- meqzone_It's kinda funny[英语]
- enjoi_I enjoied Chinese very much 指出句中的一
- feeling good 原唱_求大量的外国摇滚歌曲,什么类
- 评论列表(网友评论仅供网友表达个人看法,并不表明本站同意其观点或证实其描述)
-
