B4A Library Clocks library

alfcen

Well-Known Member
Licensed User
Longtime User
Offset for Clocks

Quick'n sweet question, Andrew, could the Clocks Lib be modified so as to accept a time offset? Currently Clocks reads system time. If it could be offset, say, with zone times (in units of TicksPerHour), then, for instance, a world time clock could be implemented in no time. Please sleep it over.
 

susu

Well-Known Member
Licensed User
Longtime User
How to set background image? I tried but not work.

Aclock.SetBackgroundImage(LoadBitmap(File.DirAssets, "clock1.png"))
 

susu

Well-Known Member
Licensed User
Longtime User
My bad, I got "Aclock.Color = Colors.Black" also so that it doesn't work, sorry Agraham :D
Is there a way to change color of the clock hands?
 

Shay

Well-Known Member
Licensed User
Longtime User
stopper

Hi

I am using the stopper (Chrono) from the example
but when I issue Chrono.Stop, the display is stopping, but when I resume it again Chrono.Start, the display is jumping to the future
meaning if I stopped it on 00:10 waited 10 sec, and start it again, it will continue from 00:20 and not 00:10
what is the problem?
and how can I reset the counter again? (start from 0)

thanks
Shay
 

danen4u

New Member
Licensed User
Longtime User
Chron Countdown

Could someone please help with a chrono coundown timer.I have been trying this for some hours .
 

alfcen

Well-Known Member
Licensed User
Longtime User
Hello Andrew,
Just a quick note to thank you very much, indeed, for the clocks library you created.
I am using the analog clock frequently for applications in full screen mode.
Cheers
Robert
 

alfcen

Well-Known Member
Licensed User
Longtime User
Analog Clock Scale

Hello Andrew,

Is there a maximum value for clock width/height?

B4X:
Panel1.Initialize("")
Activity.AddView(Panel1,10dip,10dip,Activity.Width-20dip,Activity.Width-20dip)
Clock.Initialize("")
Panel1.AddView(Clock,0,0,Panel1.Width,Panel1.Height)

won't draw the analog clock larger than Panel1.Width / 2.
 

agraham

Expert
Licensed User
Longtime User
There is no limit to the size of the actual view as you can see if you colour the background. However there does seem to be a limit to the size of the dial that seem to maximise at a size of 240 pixels. It looks like the view can scale the dial down for a smaller view but does not scale it up.
 

alfcen

Well-Known Member
Licensed User
Longtime User
Thanks a lot for your quick response. 240 pixels...that ties it.
No problem whatsoever, the clock is a great gadget for multi-purpose use.
 

kl3inh3nz

Member
Licensed User
Longtime User
Is it possible to hide the "small blocks for the hours"? And also to replace the stock pointer with own graphics?
 

kawawong

Member
Licensed User
Longtime User
I wish to display the Hour in the Chronometer and try the following code.

B4X:
Sub Activity_Create(FirstTime As Boolean)
  ...
  Chrono.Initialize("Chrono")
  Activity.AddView(Chrono, 20dip, 60dip, 200dip, 60dip)
  Chrono.Color = Colors.RGB(255,102,0)
  Chrono.TextSize = 40dip
  Chrono.TextColor = Colors.RGB(250,235,215)
  Chrono.Gravity = Gravity.CENTER
  Chrono.Format = "H:MM:SS"
  ...
End Sub

Before the Chrono Start, it displays 00:00. After the Chrono Start, it displays H:MM:SS as attached images.

It works fine if we remove the line Chrono.Format = "H:MM:SS".

Please helps. Thanks.
 

Attachments

  • chrono-format-01.png
    chrono-format-01.png
    2.9 KB · Views: 405
  • chrono-format-02.png
    chrono-format-02.png
    3.7 KB · Views: 383

kawawong

Member
Licensed User
Longtime User
Thanks.

Have further tested and it can show in the format of H:MM:SS when the time elapsed for more than an hour. There is no need to set the format.
 

Attachments

  • chrono-format-03.png
    chrono-format-03.png
    3.6 KB · Views: 288

tonycmac

Member
Licensed User
Longtime User
Miliseconds?

Maybe I'm missing something but I can't figure out how to get 1/10th of seconds in the chrono. :sign0104:

Is this not possible? I'd prefer to only have MM:SS.X where X is 1/10th fractions of the second value.

Hopefully i'm just missing something here...
 
Top