Transparent Clock

Developed or developing a new product in PureBasic? Tell the world about it.
User avatar
netmaestro
PureBasic Bullfrog
PureBasic Bullfrog
Posts: 8451
Joined: Wed Jul 06, 2005 5:42 am
Location: Fort Nelson, BC, Canada

Transparent Clock

Post by netmaestro »

What, another transparent clock? Hasn't it been done? Yes, it has. By me and others. But - I've never been particularly pleased with a few of the features of my earlier VistaClock, in particular:

- Won't run on 16-bit desktop
- Stops while being moved
- Second hand jumps rather than moving smoothly
- Filesize is 547k upx'd
- Uses 16mb system memory when running
- Many programming tricks employed to reduce cpu usage

I felt that this clock would make a good testbed for some of the new commands in my upcoming GdiPlus library, so I revisited the project with a view to testing out my lib. The result is:

- Will run fine on a 16-bit or 32-bit desktop
- Keeps running while being moved
- Second hand sweeps smoothly
- Filesize is 61k upx'd, one-ninth the size of VistaClock
- Uses 4.7 mb system memory
- No CPU conservation tricks are necessary - uses no cpu at all (here)

Wanna try it out?

http://www.networkmaestro.com/TransparentClock.exe

*new* Screensaver http://www.networkmaestro.com/TransparentClock.scr



For those using Windows 2000: TransparentClock.exe will now work in your OS, no need for a separate version.

Hope you like it! The lib is still in development, but when it's ready I believe almost any reasonably experienced PB programmer will be able to write something similar with little effort.
Last edited by netmaestro on Fri Nov 10, 2006 2:42 am, edited 4 times in total.
thamarok
Enthusiast
Enthusiast
Posts: 282
Joined: Wed Sep 06, 2006 1:37 pm

Post by thamarok »

Can you give a not-upx'ed version? I am having problems installing UPX on my machine. Thanks!
EDIT: I want the not-upx version to make some tests like trying to run it in WINE, etc..
User avatar
netmaestro
PureBasic Bullfrog
PureBasic Bullfrog
Posts: 8451
Joined: Wed Jul 06, 2005 5:42 am
Location: Fort Nelson, BC, Canada

Post by netmaestro »

No problem - done.
PB
PureBasic Expert
PureBasic Expert
Posts: 7581
Joined: Fri Apr 25, 2003 5:24 pm

Post by PB »

UPX is just an unpacker, it doesn't need to be installed to run the exe.
I compile using 5.31 (x86) on Win 7 Ultimate (64-bit).
"PureBasic won't be object oriented, period" - Fred.
thamarok
Enthusiast
Enthusiast
Posts: 282
Joined: Wed Sep 06, 2006 1:37 pm

Post by thamarok »

netmaestro wrote:No problem - done.
Where is the exe? Is it the same link?
UPX is just an unpacker, it doesn't need to be installed to run the exe.
Read my post carefully. This time using the glasses I bought you with the hasselhoff sticker in the lens :wink:
User avatar
netmaestro
PureBasic Bullfrog
PureBasic Bullfrog
Posts: 8451
Joined: Wed Jul 06, 2005 5:42 am
Location: Fort Nelson, BC, Canada

Post by netmaestro »

Same link, same filename.
Trond
Always Here
Always Here
Posts: 7446
Joined: Mon Sep 22, 2003 6:45 pm
Location: Norway

Post by Trond »

Wow - only 50% usage.
User avatar
netmaestro
PureBasic Bullfrog
PureBasic Bullfrog
Posts: 8451
Joined: Wed Jul 06, 2005 5:42 am
Location: Fort Nelson, BC, Canada

Post by netmaestro »

Sorry - one of my pngs was bad. Should be OK now.
jack
Addict
Addict
Posts: 1358
Joined: Fri Apr 25, 2003 11:10 pm

Post by jack »

looks very nice, but on my system it uses 19% CPU.

my system:
AMD Athlon XP 3200, Windows XP with latest updates.
[edit] that fixed the CPU usage, near 0% [/edit]
Last edited by jack on Sun Oct 29, 2006 10:25 pm, edited 1 time in total.
User avatar
netmaestro
PureBasic Bullfrog
PureBasic Bullfrog
Posts: 8451
Joined: Wed Jul 06, 2005 5:42 am
Location: Fort Nelson, BC, Canada

Post by netmaestro »

Yes, it should be fixed. Could you redownload and try it again?
mskuma
Enthusiast
Enthusiast
Posts: 573
Joined: Sat Dec 03, 2005 1:31 am
Location: Australia

Post by mskuma »

On my system, hovers around 2-3% usage. Nice!
User avatar
netmaestro
PureBasic Bullfrog
PureBasic Bullfrog
Posts: 8451
Joined: Wed Jul 06, 2005 5:42 am
Location: Fort Nelson, BC, Canada

Post by netmaestro »

It actually is drawing everything on every pulsation, which is kind of unheard of when making something like this. I thought I could get away with it based on not using any DrawAlphaImage, but I guess I'll have to start drawing the base once a minute. Then it won't use any.
User avatar
netmaestro
PureBasic Bullfrog
PureBasic Bullfrog
Posts: 8451
Joined: Wed Jul 06, 2005 5:42 am
Location: Fort Nelson, BC, Canada

Post by netmaestro »

Thanks jack!
User avatar
netmaestro
PureBasic Bullfrog
PureBasic Bullfrog
Posts: 8451
Joined: Wed Jul 06, 2005 5:42 am
Location: Fort Nelson, BC, Canada

Post by netmaestro »

Switched the base png for a tiff, dropped the cpu usage on my wife's celeron 1.5 from 5% down to 0. So it should be zero everywhere now. Latest version is 113k not upx'd. Still drawing everything every pulse.

Please re-download for 0% CPU usage.
rsts
Addict
Addict
Posts: 2736
Joined: Wed Aug 24, 2005 8:39 am
Location: Southwest OH - USA

Post by rsts »

0 % cpu here. Very impressive.

cheers

whoops - spoke too soon. holding just around 8% now. Still impressive.
Post Reply