|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Announcements
Chapters
Services
Feature Zones
|
IntroductionThis is your basic analog clock using Cos, Sin, Theta, and the form's aspect ratio to draw the circles and gather the placement of the markers and hands. This is my first submission on here, and I hope it is useful to someone out there. The code is heavily documented, and there is also a demo download. BackgroundI first wrote the code for this way back in the QB 4.5 days, and later converted it to Flash MX. I was bored on one of my days off, and really didn't feel like working on the other projects I have going, so I did this for old time sakes. I hope you enjoy it. Using the codeI separated the main drawings into different The main sub that is called is the Private Sub Draw_Graphics()
'******************************************************************
'******** The drawing sub which has the individual ********
'******** subs in it for easier understand- ********
'******** ing. First we will draw the clock base, ********
'******** then the face, on to the markers, ********
'******** then the date and time on the face, ********
'******** and finally the hands of the clock. ********
'******************************************************************
Draw_Clock_Base()
Draw_Clock_Face()
Draw_Clock_Markers()
Draw_Clock_DateTime()
Draw_Clock_Hands()
End Sub
These objects and variables are used in the full scope of the form. Other variables are used within the Dim bm As Bitmap
Dim g As Graphics
Dim PI As Double = 3.14159
Dim XC, YC, X, Y, R, OldSec As Integer
Dim Theta, AspectRatio As Double
Points of InterestI don't do a lot of graphics programming, so when working with the
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||