Try the VistaClock - Major performance update!

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

Post by netmaestro »

Added a non-transparent option and removed the last bit of cpu usage. It sits at 0 now. (here) This thing is done for sure now as I don't plan on updating it further.
BERESHEIT
User avatar
Joakim Christiansen
Addict
Addict
Posts: 2452
Joined: Wed Dec 22, 2004 4:12 pm
Location: Norway
Contact:

Post by Joakim Christiansen »

netmaestro wrote:Added a non-transparent option and removed the last bit of cpu usage. It sits at 0 now. (here) This thing is done for sure now as I don't plan on updating it further.
Really nice, now give us the source code! :lol: (j/k)
It don't use any CPU here either but it use 15mb of memory! :shock: (But I don't care)
techjunkie
Addict
Addict
Posts: 1126
Joined: Wed Oct 15, 2003 12:40 am
Location: Sweden
Contact:

Post by techjunkie »

netmaestro wrote:A new version is ready, with some more features. Drop shadowing is rendered correctly, you can choose from several sizes from tiny to jumbo, there is a system tray icon for control, you can hide/show the clock, and cpu usage is down to nil as redrawing is arranged to take place only when a hand needs to move. Even at the jumbo size setting, cpu usage is 0. Get it while it's hot!
Really nice clock! :D

But where are the extra features?!? Size and hide? The version I download from http://www.networkmaestro.com/VistaClock.exe don't have these features. :cry:
Image
(\__/)
(='.'=) This is Bunny. Copy and paste Bunny into your
(")_(") signature to help him gain world domination.
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 »

I added the hide feature. I don't think I'm ever going to make it sizeable as it uses exclusively DrawAlphaImage() and the only way you can resize an Alpha image is to use the Raw flag. The result is "less than production quality" without any smoothing, so I'm at a bit of a loss for now unless I can find an API or resize algorithm that both smooths and preserves the alpha layer information. If I find something I'll update it, another thing I've considered is releasing 3 exe's, one at 90px, one at 128 (current) and one at 196, all of which I've created graphics for. But putting them all into one exe and offering 3 size options would mean the thing would be about 1.2 mb after upx'ing. That's kinda big but if plenty of people are interested in an exe that size with those size options, I can easily do it.
BERESHEIT
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 »

Added a brushed aluminum face. I'm going to add it to the VistaClockGadget() too.

Image
BERESHEIT
Intrigued
Enthusiast
Enthusiast
Posts: 501
Joined: Thu Jun 02, 2005 3:55 am
Location: U.S.A.

Post by Intrigued »

This version is working excellent on my Win XP Pro system.

Nice job!
Intrigued - Registered PureBasic, lifetime updates user
Barney
User
User
Posts: 54
Joined: Wed Apr 26, 2006 12:01 pm

Post by Barney »

Please, please, please, can we have a peek at the source code of this beauty...

Barney
Trond
Always Here
Always Here
Posts: 7446
Joined: Mon Sep 22, 2003 6:45 pm
Location: Norway

Post by Trond »

Barney wrote:Please, please, please, can we have a peek at the source code of this beauty...

Barney

Code: Select all

UseTIFFImageDecoder() 

OpenWindow(0, 0, 0, 512, 384, "", #PB_Window_ScreenCentered | #PB_Window_SystemMenu) 
SetWindowLong_(WindowID(0), #GWL_EXSTYLE, GetWindowLong_(WindowID(0), #GWL_EXSTYLE) | #WS_EX_LAYERED) 

LoadImage(0, "clock.tiff") 

hDC = StartDrawing(ImageOutput(0)) 
  GetObject_(ImageID(0), SizeOf(BITMAP), @BitmapInfo.BITMAP) 
  ContextOffset.POINT 
  BlendMode.BLENDFUNCTION 
  BlendMode\SourceConstantAlpha = 255 
  BlendMode\AlphaFormat = 1 
  UpdateLayeredWindow_(WindowID(0), 0, 0, @BitmapInfo+4, hDC, @ContextOffset, 0, @BlendMode, 2) 
StopDrawing() 

Repeat 
  Select WaitWindowEvent() 
    Case #PB_Event_CloseWindow 
      Break 
  EndSelect 
ForEver
Now you just create a few more windows which are child windows of this one using the same technique, three for the pointers and one for the glass reflection.
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 »

I'm sorry, I don't see a clock there. If you want to achieve a working clock you have to buckle down and actually program something, assuming one is able.
BERESHEIT
Berikco
Administrator
Administrator
Posts: 1326
Joined: Wed Apr 23, 2003 7:57 pm
Location: Belgium
Contact:

Post by Berikco »

Very nice 8)
Inf0Byt3
PureBasic Fanatic
PureBasic Fanatic
Posts: 2236
Joined: Fri Dec 09, 2005 12:15 pm
Location: Elbonia

Post by Inf0Byt3 »

@netmaestro, just a little question... How did you make the pointers move? You literally draw them on the background?
None are more hopelessly enslaved than those who falsely believe they are free. (Goethe)
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 »

Good question, I'll have to ask trond how I did that and get back to you.
BERESHEIT
Inf0Byt3
PureBasic Fanatic
PureBasic Fanatic
Posts: 2236
Joined: Fri Dec 09, 2005 12:15 pm
Location: Elbonia

Post by Inf0Byt3 »

:lol: It was right under my eyes! I think I must start wearing glasses :D.
None are more hopelessly enslaved than those who falsely believe they are free. (Goethe)
Post Reply