Share My Creation Swiss Railway Station Clock

Having played with some graphics I have programed the
Swiss Railway Station Clock just for fun.

Best regards.

EDIT: New version, program starts at following runs.

EDIT;
This example is a 'prototype'.
You find a much more professional version made by alfcen here Helvetia.

EDIT: 2012.12.05
Due to the fact that the Swiss Federal Railways own all rights in design etc. Robert Brenner was asked to remove his Helvetia program from Google Play that uses the basic code shared here.
So to not violate these rights I removed the program.
Apple has used the design of this clock in their last OS and the Swiss Federal Railways asked Apple for a license agreement which was signed a few months ago.
 
Last edited:

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) :cool:
 

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
    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.
 
Top