[Home] [Downloads] [Search] [Help/forum]


Register forum user name Search FAQ

Gammon Forum

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  Suggestions
. . -> [Subject]  Skins or Transparency

Skins or Transparency

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page


Pages: 1 2  

Posted by Tricuspa   USA  (13 posts)  [Biography] bio
Date Mon 20 Aug 2001 05:27 AM (UTC)
Message
What is the possibility of setting Muschclient as skinnable or at the very least transaprent? This came up when I found out that I tend to like to watch DVD's while running Mush Client and that's about it. With a transparent setting this would give more of the screen available?
[Go to top] top

Posted by Nick Gammon   Australia  (22,982 posts)  [Biography] bio   Forum Administrator
Date Reply #1 on Mon 20 Aug 2001 09:38 PM (UTC)
Message
Interesting idea. I have added that as suggestedion #402.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Darren Hill   (4 posts)  [Biography] bio
Date Reply #2 on Wed 22 Aug 2001 06:18 AM (UTC)
Message
Hmmmm - seeing this suggestion got me deciding to try out a bunch of my programs (since I run with a lot of transparent stuff on my Win2k box). I don't know if you've tried any third party programs or not Tricuspa - but like I said, I went ahead and did.

WindowFX...er - it doesn't like MUSHclient a whole lot - it sets the transparency of the main window okay, but then all of the dialogs display... weirdly to say the least. There is a little utility out there though (I'll see if I can dig up the URL in a moment) which sets transparency by individual window IDs, and so would ignore things like the config dialog. There's a few problems though: 1. If I remember correctly, it determines the window ID from the title bar caption - so you'd have to set it for each world you open. 2. You need to change your window backgrounds from black - black isn't transparent. ^_^ 3. The little utility (naturally) requires 2K or XP - and if your video driver doesn't support hardware level alpha blending it's going to be SLOW. If you want to try it though, the URL is: http://vitiy.boom.ru/progs.htm

[Go to top] top

Posted by Nick Gammon   Australia  (22,982 posts)  [Biography] bio   Forum Administrator
Date Reply #3 on Wed 22 Aug 2001 07:00 AM (UTC)
Message
I'm not using Win2K if that is what you are referring to, so that will have to wait. :)

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Celestin   (4 posts)  [Biography] bio
Date Reply #4 on Wed 10 Mar 2004 05:03 AM (UTC)
Message
Hmm... I would really like to see a Windows client with transparent windows as well. Especially if only the background is clear, but the text is still solid ( like on a Macintosh or Linux ). Hopefully, a response to this post like 2 years later will revitalize the effort or something.
[Go to top] top

Posted by Shadowfyr   USA  (1,786 posts)  [Biography] bio
Date Reply #5 on Wed 10 Mar 2004 05:30 AM (UTC)
Message
Well Darren. Guess what! Mushclient provides a GetFrame command that lets you pass the window handle for the main window to any program you can call from a script. Using GetChildWindow or the like to step through and enumerate each Mushclient window, you could use a simple program you make yourself to set the background of any or all windows to be transparent. The only control/window type this doesn't 100% work with is the VB Tab/Property Sheet, but from in C++ you can tell the primary container to become transparent, even if the control doesn't provide the attribute. The only real anoyance is that anything below XP has no *native* support for alpha channel, so you are stuck with full transparency on parts/all of the background or a solid background and image. :(

To handle Alpha channel Nick would have to literally rewrite all the Draw functions built into the stardard MFC libraries to capture and blend the stuff behind the window using the alpha channel information in the image. And since PNG is the only decent format supporting Alpha channel, he would also have to add libpng.dll to the client. Would be so much cooler though... Sigh!
[Go to top] top

Posted by Nick Gammon   Australia  (22,982 posts)  [Biography] bio   Forum Administrator
Date Reply #6 on Wed 10 Mar 2004 05:45 AM (UTC)
Message
I don't have XP and don't intend to install it for the forseeable future. You have heard of the definition of an "upgrade" ...

"Swap your existing bugs for new ones".

However I would qualify that a bit, based on my experience with Windows:

"Swap your existing bugs for new ones, and watch your PC run much more slowly.".


Shadowfyr, do you want to do an example of the transparent window thing, if you can make it work?

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Shadowfyr   USA  (1,786 posts)  [Biography] bio
Date Reply #7 on Wed 10 Mar 2004 11:24 PM (UTC)
Message
Hmm. Not really.. I don't know C++ very well. I would know how to make something skinnable in VB, but not C++.

In general... You are going to be dealing with Device Contexts. Basically something like:

temp = GetCompatibleDC(self.DC);
...do blending/transparency masking here...
self.DC = temp;

Or something more or less like that. There may be some special command you actually need use to copy one DC to another. The brief attempt I made to try to use this resulted in my simply turning the "Auto-redraw" option off and using a Firework.Refresh command instead after everything was redrawn. :(

So, in the blending/masking step you either draw the image into the DC completely, mask out one color (say 255) as 'transparent' and not copy it at all. I think Windows can and will do this automatically, just not sure how. To blend things though, you would need to get the stuff 'under' your window somehow from Windows then average 'your' background onto that based on the percent of transparency you want. This obviously is more complicated. Unfortunately I would have to go hunting for examples of how this works the same as you.

One possibility though is OpenGL, which may already supply functions that can do some of this automatically and even properly support alpha channel. It would have the advantage of being a free library (unlike Direct3D) and compatible with Linux when ever you port the client over. The draw back is that if the card says it can do alpha channel or bitmap scaling, etc., but doesn't impliment it properly, there is no way to force OpenGL to use its own software emulation instead of the defective implimentation on the card. Direct3D would have the same problems. Coding it yourself is 100% certain to work, but far more complicated.

I may nose around a bit and see if I can find some usable example of doing any of this in C++, but most people are bound to take the simple way out and use stuff like OpenGL, even if it doesn't work 100% of the time on every system.
[Go to top] top

Posted by Shadowfyr   USA  (1,786 posts)  [Biography] bio
Date Reply #8 on Thu 11 Mar 2004 12:08 AM (UTC)
Message
Hmm. Ok.. A preliminary search reveals:

http://msdn.microsoft.com/library/en-us/vclib/html/vcrefCImageDraw.asp

Which may or may not be .NET related. If so, then there is:

http://www.bridgespublishing.com/articles/issues/0109/Drawing_transparent_images.htm

Which basically explains how to do it without necessarilly having CImage.Draw to work with. However, BMP is only able to store a single transparency mask color, so you still have to have support of GIF (which only allows 256 colors) or libpng.dll, which will allow you to load 32-bit PNG files.

Neither solution works under Windows 95, if you are even worried about that and it may be necessary to get the Windows version and use Tranparentblt or a normal draw under 95, instead of AlphaBlend. Not really that complicated. ;)

In case you want them, the search terms I used where:

alpha channel transparency Windows +98 "C++" -directdraw -XP
[Go to top] top

Posted by Poromenos   Greece  (1,037 posts)  [Biography] bio
Date Reply #9 on Fri 12 Mar 2004 02:22 AM (UTC)
Message
I don't think it's that complicated to do in XP, since it has native support for alpha blending, but I don't think it would be easily (if at all) done in other OSes... Oh and by the way, you can't watch DVDs under transparent windows because of the overlay, it just becomes a blackish colour :P Hm, look at these articles:
http://www.codeguru.com/Cpp/W-D/dislog/miscellaneous/article.php/c5065/
and
http://www.codeguru.com/Cpp/W-D/dislog/miscellaneous/article.php/c5019/
The second one seems to work on Win98 etc as well, but may be shareware... Or probably not.

Vidi, Vici, Veni.
http://porocrom.poromenos.org/ Read it!
[Go to top] top

Posted by Shadowfyr   USA  (1,786 posts)  [Biography] bio
Date Reply #10 on Fri 12 Mar 2004 03:09 AM (UTC)
Message
Hmm. So basically Windows 2000 and XP provide an API to automatically employ an alpha value, where in 98, NT and ME you have to adjust the alphachannel of your image and use the AlphaBlend API call to draw it.

This just means you have to either ignore the API in 2000 and XP, then use your own implimentation that employs the AlphaBlend functions that 98, NT, ME, 2000 and XP all have and ignore the setting if in 95 *or* alternatively implement code to use the 2000/XP functions if running on that, the 98/NT/ME version if running there or ignore it under 95.... I think we would be better off and less bloated to go the first route and impliment something based on the code from my second link, which will work in everything except 95.
[Go to top] top

Posted by Shadowfyr   USA  (1,786 posts)  [Biography] bio
Date Reply #11 on Sat 13 Mar 2004 03:20 AM (UTC)
Message
Having talked with Magnum about this.. It is possible, depending on how it works under pre-2000/XP system to have settings to define the 'level' of transparency support and to use the full 2000/XP code when running on that for speed reasons. The levels would be:

1. No skin.
2. Solid skins.
3. Skinning with full transparent areas.
4. Alpha-skins 98/NT/ME. - dimmed out in settings and defaults to option 3 if on 95.
5. Alpha-skins 2000/XP. - dimmed out in settings and defaults to option 4 if on an earlier OS.

Depending on how/if alphablend() slows things down on 98, it may be slightly slower than doing skins with solid colors or patches that are completely transparent. This also means that it *may* be slower than the method in 2000/XP, so option 4 should automatically upgrade to 5 internally if on an XP system. Maybe only 4 options are needed in that case.

However, this is of course based on the assumption that a solid image will be handled differently than a full 32-bit by the OS or any real difference exists between them in speed. Some experiments are in order. Unfortunately I don't know enough C++ to make 'a' window, let alone one that has these effects. :(
[Go to top] top

Posted by Poromenos   Greece  (1,037 posts)  [Biography] bio
Date Reply #12 on Sun 14 Mar 2004 01:13 AM (UTC)
Message
From what i've seen, transparent windows are a bit slow to redraw, etc, but that could be just an impression...

Vidi, Vici, Veni.
http://porocrom.poromenos.org/ Read it!
[Go to top] top

Posted by Shadowfyr   USA  (1,786 posts)  [Biography] bio
Date Reply #13 on Sun 14 Mar 2004 03:21 AM (UTC)

Amended on Sun 14 Mar 2004 03:22 AM (UTC) by Shadowfyr

Message
Yeah. I figured they would tend to be. Purely transparent ones probably wouldn't be, since all they do is *not* draw the background. All forms of windows that employ transparency in the background, like the curved edges on Getright skins, use an image that gets drawn over the background. Normal windows are a solid color, so just use a quick fill that is handled by the windowing code.

The question I want answered is, "Is alphablend significantly slower than a solid image (with or without sections of transparency) and if so is the 2000/XP solution faster. If the result is like:

None = fastest.
Skin/partial transparent = slower.
Alphablend = slowest.
2000/XP alphablend = Something between the fastest and slowest.

If the last possibility above is true, then obviously checking the OS version or API to see if it supports that method and using it instead is much better than just using the 98/ME/NT version of alphablending. If alphablending is in fact slower (which is likely) than doing normal transparency or an image, then it makes sense to have the option to disable it on slower machines, same if it is in fact somehow slower to use an image that has transparent sections, instead of a solid one.

Knowing that it will be slower is a given, how much and which things should be used when available given the highest settings on a particular OS is an unknown.
[Go to top] top

Posted by Gore   (207 posts)  [Biography] bio
Date Reply #14 on Mon 15 Mar 2004 09:14 AM (UTC)
Message
problem with transperency/skins is that, they generally cause the program to slow down.. and I use mushclient for it's speed, not the way it looks (I have a slow computer, heh)
[Go to top] top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


78,157 views.

This is page 1, subject is 2 pages long: 1 2  [Next page]

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.

[Home]


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( https://gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Hosted at HostDash]