Try the VistaClock - Major performance update!
- netmaestro
- PureBasic Bullfrog
- Posts: 8451
- Joined: Wed Jul 06, 2005 5:42 am
- Location: Fort Nelson, BC, Canada
- Joakim Christiansen
- Addict
- Posts: 2452
- Joined: Wed Dec 22, 2004 4:12 pm
- Location: Norway
- Contact:
Really nice, now give us the source code!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.

It don't use any CPU here either but it use 15mb of memory!

-
- Addict
- Posts: 1126
- Joined: Wed Oct 15, 2003 12:40 am
- Location: Sweden
- Contact:
Really nice clock!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!

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.


(\__/)
(='.'=) This is Bunny. Copy and paste Bunny into your
(")_(") signature to help him gain world domination.
- netmaestro
- PureBasic Bullfrog
- Posts: 8451
- Joined: Wed Jul 06, 2005 5:42 am
- Location: Fort Nelson, BC, Canada
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
- netmaestro
- PureBasic Bullfrog
- Posts: 8451
- Joined: Wed Jul 06, 2005 5:42 am
- Location: Fort Nelson, BC, Canada
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
- netmaestro
- PureBasic Bullfrog
- Posts: 8451
- Joined: Wed Jul 06, 2005 5:42 am
- Location: Fort Nelson, BC, Canada
- netmaestro
- PureBasic Bullfrog
- Posts: 8451
- Joined: Wed Jul 06, 2005 5:42 am
- Location: Fort Nelson, BC, Canada