Share My Creation Swiss Railway Station Clock

alfcen

Well-Known Member
Licensed User
Longtime User
Hi copiloto

You are welcome. Glad to be of little help.

For a=0 to 360 step 0.5 (or less, depends of circle size)
canvas1.drawLine(centerx+radius*sin(a*cpi/180),centery+radius*cos(a*cpi/180,centerx+(radius+1)*sin(a*cpi/180),centery+(radius+1)*cos(a*cpi/180),...)
Next

What do you think of this:

B4X:
canvas1.DrawLine(centerX+radius*SinD(a),centerY+radius*CosD(a),centerX+(radius+1)*SinD(a),centerY+(radius+1)*CosD(a),...)

SinD(x), CosD(x), TanD(x) accept angles in degrees.
This is shorter and easier to maintain (I like short codes)
 

copiloto

Member
Licensed User
Longtime User
Ohh!

I must to review basic4android keywords again... Of course I like Goodbye radians... Thanks again Alfcen!

Best regards!
 

alfcen

Well-Known Member
Licensed User
Longtime User
Hi copiloto,
Please find attached the source for a simple clock. It employs agraham's lovely AnalogClock library for the hour and minute hands. The second hand is implemented with a canvas. The source is brief, yet leaving much room to play with.

Please appreciate that the analog clock cannot be drawn larger than as-is.

Cheers
Robert
 

Attachments

  • SimpleClock.zip
    237.1 KB · Views: 480
  • device.jpg
    15.5 KB · Views: 386

JesseW

Active Member
Licensed User
Longtime User
For anyone who is interested, an alternative to all these high horsepower graphics programs is Paint.Net. it can be freely downloaded from getpaint.net. I use it frequently for transparent layers and it works great.
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…