How to skin a window the NON-slow way?

Blitz3D Forums/Blitz3D Programming/How to skin a window the NON-slow way?

Guy Fawkes(Posted 2014) [#1]
Hi all. I found a code that can skin my window, but the problem is it is EXTREMELY slow. It takes 3 seconds to load which should only take half a second to a second to load.

Can someone please show an example of how to skin an "interface" PNG image to a regular window and the ability to use alpha# from 0 to 255 so that the window is not completely invisible but also not completely visible just like Windows Vista & up (Windows 7 preferably)?

Thanks alot guys & happy 4th of July!

Sincerely,

~GF


Guy Fawkes(Posted 2014) [#2]
Can someone please assist?

Thank You so kindly!

Have a GREAT day!

Sincerely,

~GF


wmaass(Posted 2014) [#3]
Notwithstanding other issues, 3 seconds to load seems reasonable IMHO. Are you trying to do a border-less, shaped window or something? What is this code you found?


Guy Fawkes(Posted 2014) [#4]
I'm basically trying to skin my own window you know like with a transparent title, the ability to make the window lose the whole title bar, and the ability to make the app look sleek & clean. =)


wmaass(Posted 2014) [#5]
I see. Can't really help there though I've done stuff with shaped/transparent windows with some C# WPF apps before. You might consider looking at AutoHotkey (http://www.autohotkey.com) which can manipulate windows in interesting ways.

Then again if you can live with 3 seconds to launch your app (I would) and it looks the way you want I would totally stick with that.


Rroff(Posted 2014) [#6]
Doing that with B3D is quite advanced and requires fairly extensive knowledge of Windows UI programming even to do it in a language that supports it better.

Some people might know how to improve the code you have for performance but there won't be many people who have the time to create sample code for something like that from scratch unless they have extensive knowledge of it.


Guy Fawkes(Posted 2014) [#7]
Ok, well here's the code:



Here's the example interface I drew quickly on paint:



When downloading the image, rename it to: interface.png

To run this demo, you will need the following user32.decls commands, your user32.decls file should look something like this:

user32.decls:



You will also need the following gdi32.decls file:

gdi32.decls:



That should be all of it.

If you can't be bothered to add these to your user32.decls file & your gdi32.decls file, just make a backup of both files then recreate user32.decls with the correct functions from above & gdi32.decls with the correct functions from above. Just copy and paste.

Thanks, and have a GREAT morning everyone!

Sincerely,

~GF


Guy Fawkes(Posted 2014) [#8]
Can someone please assist?

Thank you so kindly!

Have a GREAT evening! :)

Sincerely,

~GF


Yan(Posted 2014) [#9]
I was about to rebuke you for not searching the forum as I posted a slightly faster version of the above code years ago. However, I searched and couldn't find in myself. ;o)

It probably got annihilated by 'The Purge'. so...

skin.png




As for translucency...
http://msdn.microsoft.com/en-us/library/ms997507.aspx

A quick glance suggests that this may be a way to go for the whole thing.


Yan(Posted 2014) [#10]
If you just want a 'border-less' window, which is what I think you're *really* after, there's always this...

http://www.blitzbasic.com/Community/post.php?topic=62470&post=698005

Again, you can use the info I posted above to make it translucent.


Guy Fawkes(Posted 2014) [#11]
This is GREAT, thanks ALOT, Yan! :)

Sincerely,

~GF


Guy Fawkes(Posted 2014) [#12]
Hey Yan. Mind if I turn it into a DLL in Purebasic, so it's even FASTER?

Thanks again! :)

Sincerely,

~GF