This example shows what you can do with the new UpdateLayeredWindow API in windows XP. This version supports resizing and colorizing the skin at runtime.

Get it at my website: http://www20.brinkster.com/qweerdy

This is a picture of the program in action:
Posted on 2002-10-11 12:03:09 by Qweerdy
damn that really looks sweeet! :grin:

nice work Qweerdy :alright:
Posted on 2002-10-11 14:47:28 by savage
I agree with Savage, it is excellent ! :alright:
Posted on 2002-10-11 15:01:53 by JCP
Qweerdy, looks awesome! :alright:

I'm flattered that you used my HSL conversion routines. I'm very glad somebody got some use out of them.

Remember that RGB2HSL takes a 00bbggrr dword. (0 hue = red) so you'll have to convert if you want to get the true hue.
Or to make things easier change the first 3 lines of RGB2HSL to:

[size=12]

movzx esi, byte ptr [dwRGB+[color=red]0[/color]]
movzx edi, byte ptr [dwRGB+1]
movzx ebx, byte ptr [dwRGB+[color=red]2[/color]][/size]



Again, very good job. It looks great.
Posted on 2002-10-11 17:26:25 by iblis
Thanks everyone for the kind comments!

I'm currently working on encapsulating the scrollbar code in a custom control, to clean up the main WndProc and make control creation & handling as easy as with normal windows. I've got the hardest part done already, that is the painting mechanism of the control, but now I still have to get the mouse handling working again.

It's going to be very easy to use, just create a control like this:



invoke LoadPng,ResourceID,0
invoke LayeredScrollbar, hWnd, eax, x, y, width, height, ScrollMax, ControlID


And it will behave like a normal scrollbar... except it will be skinned with a PNG with a alpha channel :)

Iblis:
I've made the change, but the Hue values still don't match those in PSP (they're off by 128). However, I don't really care as you'll usually want to set it by looking at the resulting window anyway. I was very glad to find your code, without it it would have taken some time before I would have colorizing done. :alright:
Posted on 2002-10-12 07:03:10 by Qweerdy
Hmm, strange.

The reason I did it in reverse (00bbggrr) from the normal is because that's how I needed it, but it would seem more practical to use 00rrggbb.
I will modify the code to work with 00rrggbb and repost it.
Posted on 2002-10-12 10:44:21 by iblis
very impressive!



if the 42<HUE<128 you see a grid over the window
(try to move the window over a white window )
Posted on 2002-10-12 14:44:06 by eko
I figured out what's wrong.

I posted how to modify RGB2HSL but I neglected to reflect those changes in HSL2RGB.

Also change the last lines of HSL2RGB to:

[size=12]@done:  bswap         eax

shr eax, 8
ret[/size]


and it'll work. Here's the .exe if you want to see.
Posted on 2002-10-12 18:07:57 by iblis
iblis: Thanks, now it's perfect :alright:

eko: Aw... I though I fixed the grid problem. It's not a problem with the source however, it's just the skin image. The darker border from the bottom right tile partially got onto the center tile :( I'll just fire up Paint Shop Pro, see what I can do...
Posted on 2002-10-13 01:02:24 by Qweerdy
Here is the new png skin, just place it in the /res directory and recompile the resources and then the program.
Posted on 2002-10-13 01:37:10 by Qweerdy