Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » TopWindow&PopUp, TrayIcon » Tranparent TopWindow
Tranparent TopWindow [message #19800] Wed, 21 January 2009 23:26 Go to next message
galious is currently offline  galious
Messages: 28
Registered: March 2008
Promising Member
Hi,

is it possible to create transparent TopWindow.

Calling
TransParent()
in the constructor doesn't seem to work as the window-background is still painted on my Windows machine.

I would like to have a transparent top window (so you see the windows behind it or the desktop of the user) and still be able to show a text or image.



Best regards,

Martin
Re: Tranparent TopWindow [message #19828 is a reply to message #19800] Sun, 25 January 2009 15:06 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
galious wrote on Wed, 21 January 2009 17:26

Hi,

is it possible to create transparent TopWindow.

Calling
TransParent()
in the constructor doesn't seem to work as the window-background is still painted on my Windows machine.

I would like to have a transparent top window (so you see the windows behind it or the desktop of the user) and still be able to show a text or image.



Best regards,

Martin


Well, at time it was considered too platform dependent.

In any case, you can still use GetHWND to obtain the handle and/or use Style/ExStyle to setup Win32 window styles.

However, alternatively, it would be nice if you or somebody fixed TopWindow code (but both for Win32 and X11) - I would be glad to use such fix.

Mirek
Re: Tranparent TopWindow [message #19901 is a reply to message #19828] Fri, 30 January 2009 19:00 Go to previous messageGo to next message
galious is currently offline  galious
Messages: 28
Registered: March 2008
Promising Member
I already supposed I've to use GetHWND.

I'll check whenever I've got some free time to see if I can implement transparency in upp. However if someone wants to be beat me at it, be my guest Wink

Martin
Re: Tranparent TopWindow [message #20116 is a reply to message #19901] Thu, 19 February 2009 08:18 Go to previous message
galious is currently offline  galious
Messages: 28
Registered: March 2008
Promising Member
Using GetHWND() was easy. However I would like to add the transparent possibility to Upp. It seems for Windows we've 2 possibilities:
1. When we call Transparent(bool isTransparent, Color color) immediately call SetLayeredWindowAttributes(...).
2. Store the color to be transparent and use it in UpdateLayeredWindow(...) once we're going to draw the window. However this will probably be slower, since the UpdateLayeredWindow always updates the entire window. I'm not sure what Upp does when updating the window (only parts, or the always complete window).

Could someone direct me where I can catch up how to do this in X11 / xlib, I suppose it will be with some kind of bitmask. In that case how do I convert very quickly from a colored image to a bitmask?

As you see I've extended the Transparent call with a parameter color. Windows expect you to set the color which should be transparent. Alternatively I could add a new method SetTransparentColor(Color color) so I don't have to adjust the Transparent-method.

As for which method to choose 1 or 2 I would like to consult the Upp developers; I think it's also important the Win32 and X11 method of doing transparency shouldn't differ to much, so someone reading the Win32 code should automatically have an understanding of the X11 code.

Does anybody know if it's possible (and how) to do alpha blending of windows in X11 / xlib? I figured while I'm implementing transparency I could add alpha blending as well.

Best regards,

Martin
Previous Topic: TopWindow not closed on Escape
Next Topic: Howto Drop Files into a TopWindow please?
Goto Forum:
  


Current Time: Thu Mar 28 21:33:54 CET 2024

Total time taken to generate the page: 0.01747 seconds