Slashdot Mirror


Fast Alpha-Blending In Your GUI

visnu writes: "I've been waiting for this for 2 years now -- a REAL glass-like windowing system. And yes, it's Microsoft to do it. Ever since W2k came out, and they included alpha-blending in the GDI, I was tempted to write a little tool to turn on any window's transparency, but of course I'm way too lazy to do that. These guys weren't though: glass2k runs in the systray and handles turning on any window's transparency. yes, here's a screenshot. I'm not too sure about the speed in W2k, but in XP w/ the newest Nvidia drivers and a somewhat recent video card, it's hardware accelerated, and yes, you should be drooling." Update: 11/26 19:00 GMT by T : Links updated, so hopefully you'll be able to actually get to the content again :)

22 of 592 comments (clear)

  1. Great for always on top windows by snake_dad · · Score: 4, Insightful

    There are some apps that I would like to run "always on top", but most of the time they get in the way. This would sure be a nice way to still sorta see them .

    Great stuff, now implement it for NT4 and win98 :P

    --
    karma capped .sig seeking available Slashdot poster for long-term relationship.
    1. Re:Great for always on top windows by DaEvOsH · · Score: 5, Insightful

      The required API's needed to do this in any windows than ME or NT4 is not there. It can be done 'manually', but it is very slow, difficult to do well (I have done it in one of my progs but at the end disabled it when the prog detected the alpha api was not there) and brings problems when running with other programs that alter the way a window is shown.

      It is a pretty esy thing to do. For win32 programmers:

      1. Find the window handle you want to alpha blend. (say, hwnd).
      2. Add the WS_EX_LAYERED extended style to the window with this call:
      SetWindowLong (hwnd, GWL_EXSTYLE, GetWindowLong(hwnd, GWL_EXSTYLE) | WS_EX_LAYERED);
      3. Call SetLayeredWindowAttributes. Look up MSDN for the info.

      Also, this API in Win2k does not seem to work well in some video cards - windows which update themselves a lot will cause problems i.e. an opengl window, etc (my program has a few of them).

  2. It's nice and all that... by AltGrendel · · Score: 5, Insightful

    ...but it strikes me as "Not that useful". Most of my users get confused with standard GUI look and feel. I'd hate to think what this would do to their poor little minds.

    --
    The simple truth is that interstellar distances will not fit into the human imagination

    - Douglas Adams

    1. Re:It's nice and all that... by be-fan · · Score: 5, Insightful

      When its on Windows, it's not useful. When its on Linux, its the great, awesome, ground-breaking new technology that Packard dreamed up.

      --
      A deep unwavering belief is a sure sign you're missing something...
  3. Nothing new by Mwongozi · · Score: 5, Informative
    Stardock have an application called WindowsFX which allows you to turn on transparent windows selectively, for example, just for Notepad windows, which is much less of a CPU hit than turning it on for everything. It also lets you add shadows and various other graphical trickery to windows.

    It's rather cool, but not free, in either sense of the word.

  4. Thanks, by Anonymous Coward · · Score: 5, Funny

    Now I need to stack *10* maximized windows in front of my porn when mom comes. If I put just one like I'm doing now she would see through.

  5. it's vaguely interesting. by matthayes · · Score: 4, Funny

    Athough I can't really think of any practical reason for it - when I'm working / concentrating I usually minimise all but a couple of windows anyway.

    And I think it could be a little dangerous while surfing at work. You know, the boss comes around and you swiftly alt-tab to your work window...to find that it is 90% transparent.

    Does look nice, though.

    Just a thought,
    Matt.

  6. Let me bind this to a toggle key on my keyboard by Sludge · · Score: 4, Interesting

    If this was bound to a key that was togglable on my keyboard, it would be nice. I could hit the key, and see where each window lies. Perhaps making the windows transparent and alt-tabbing through them while putting a red border on each one instead of having them pop up would be nice.

    Whatever the case, it looks kind of hokey. I would like to see something like this where the widget graphics have alpha channels. Right now everything is one level of transparency. One step at a time, right?

  7. XFree86's RENDER extension by BESTouff · · Score: 4, Informative

    If you have Xfree86 4.x, you have the RENDER extention which does the same thing. See http://www.xfree86.org/~keithp/render/ for a description (screenshot at the bottom). Now you just need the guy who'll patch Gtk to use this.

  8. Shiny! by fhwang · · Score: 5, Funny
    I think I'll design a desktop theme called "The Bedazzler". And basically what it will do, is it'll show the same windows and widgets that we've all been stuck with for twenty fucking years, only they'll be covered in rhinestones and glitter! You'll be able to customize your own rhinestone patterns, to say things like "Groovy!" and "Fan-tastic!"

    And this is how we'll enter the brave new era of computing: Not by actually designing and using tools to make our lives more productive, convenient, and satisfying, but by slumping in our chairs and staring at useless eye-candy while we touch ourselves. I can't wait for the future.

  9. OS X does this too ... by ramseys · · Score: 4, Interesting

    For what it's worth, OS X has the capacity to do this as well (and with WindowShade, you can phase any window on the screen). I haven't found the feature incredibly useful, yet, but it sure does look cool.

  10. Operation Brainfuck by Eloquence · · Score: 4, Insightful
    Overlapping windows were a pretty brain-dead idea to begin with. This is increasingly being realized by developers who add sidebars and "panels" to their applications which can be moved and resized (knode, the KDE newsreader, implements this quite fully, although it's a bit awkward to use). The information below the window you're overlapping is cut in half: A browser window you're overlapping might show you text like

    as not a good idea
    creasingly being interested
    ot to be confused with the

    i.e. noise. The only purpose it serves is to faster identify the window you're dealing with. This has become unnecessary with the invention of the taskbar. Further additions to this concept, like window summarization and application-specific taskbars, make it even easier to use. If you want to view a lot of information simultaneously instead of having everything in full-screen mode, a smart window-manager like ion will rearrange windows automatically in useful tiles. Additional usability can be gained with clever hotkeys for application-switching.

    But while overlapping windows are stupid, transparent windows are really part of a vast right-wing conspiracy to stupidify the masses by making computers incapable of displaying information. The next step will be window-spectific screensavers, which turn on after a specific period of inactivity in a single window. Just you wait. Thanks to transparency:

    • Information becomes unreadable, especially with unfortunate color combinations.
    • Information you think is there is actually part of another window -- have fun editing that picture.
    • When two windows overlap with the wrong alpha-blending setting, you can no longer be sure which one is on top without looking at the taskbar or focus (in this screenshot, thanks to additional braindead color gradients in the title bars, this is especially hard).
    • Even your calculator will use more RAM than Mozilla ..

    If you like eye-candy, you may "drool" over this one and get your brain fucked by the Illuminati. A frontal lobotomy may be a quicker solution though.

  11. Slashdot hypocrisy by The_Messenger · · Score: 4, Troll
    Slashdot likes Enlightment and the whole mess of other useless XFree86 GUI toys. Slasdot also likes MacOS X. Plenty of absolutely useless graphical gimmicks (i.e. fully transparent terminals with anti-aliased text shadows), but we rejoiced when it was released.

    But when some Windows-weenie slaps together a VB control in five minutes to do the same thing in Win2k, the readers get all bitchy and start complaining about how "useless" it all is. Well, duh. But why didn't you complain about MacOS X's uselessness too?

    I object to this story, too, but for a completely different reason: this isn't news. Windows 2000 has always had the ability to display transparent and translucent forms. Windows 2000 can do a whole load of other useless things with forms, too. Ask any Delphi developer -- I can't stand Delphi myself, but a lot of my friends use it -- and he'll show you dynamic desktop magnification and a bunch of other demos that the development suite comes with. It's not news. It may be news to Slashdot's "We only use Windows for games, and Quicktime, and word processing, and financial apps, and graphics work, and email, and web surfing -- but we use Linux for writing Perl scripts, so we're hackers, right?" loser crew, but it's not news to anyone else.

    --

    --
    I like to watch.

  12. Ho Hum, Already Done by under_score · · Score: 5, Informative

    Over a decade ago in the NeXT computers. Transparency (alpha-channel) was part of their graphics system (including their windowing system built using Display Postscript), pretty much from day one. I wrote software which depended on it - some funky drag-n-drop stuff which used transparency in icons. It was fast back then on a 25MHz 68040 - eighty times slower clock speed than todays high end processors!!!

  13. Re:Been There... by Osty · · Score: 4, Informative

    Windows 2000/XP also does this natively. It simply doesn't expose per-window control of it through the UI. Each window does have its own alpha level, and it's up to the programmer to decide if s/he wants all windows the same or not. For a good example, check out Lucidamp, a Winamp plugin that allows you to set varying levels of alpha transparency on each of the four main Winamp windows, and also works with the Mikroamp Winamp plugin.


    Also, please note that Windows 2000 did this before OS X did this. Not that it matters, but it's true.

  14. Transparency effect... by frleong · · Score: 5, Informative
    It's very easy, suppose that hwnd is your window handle:

    SetWindowLong(hwnd, GWL_EXSTYLE, GetWindowLong(hwnd, GWL_EXSTYLE) | WS_EX_LAYERED); SetLayeredWindowAttributes (hwnd, 0, 180, LWA_ALPHA);

    GUI programming in Windows is quite snappy.

    --
    ¦ ©® ±
  15. Does anyone here get the point? by Dynedain · · Score: 5, Informative

    Sure, this stuff has been done before on other operating systems. Sure, Win2k has had it hidden in the API. THE POINT IS that this is being done by your GRAPHICS CARD....nothing on the processor end. Oh, and its a 54K yes 54K download, and is easy to use. Calm down people. Why start flaming someone without ever checking out what it is?

    --
    I'm out of my mind right now, but feel free to leave a message.....
  16. Glass and icing by viktor · · Score: 5, Insightful

    There might be a very good reason it's taken two years for the glass-like windowing system. And that would be that it isn't a good idea.

    Sure it looks pretty. It's technically cool. It's very nice eyecandy. But useful? Hardly.

    If our desktops were three-dimensional, there would be a point - in that case you could refocus on a window below your current. When refocusing, the frontmost window would be so blurry to you that it didn't interfere with your view of what was behind it.

    But desktops aren't 3D (and "fake" 3D doesn't work, refocusing requires that your desktop is not displayed on a single plane, as that plane only has one focus), and you can't refocus. What you get is just a blur of all windows that happen to be ontop of one another (and the background if you have a background/wallpaper image).

    I would guess that the only time that transparent windows help is if you have an OS/wm that does not offer workspaces or similar. The transparency might help cram an extra three windows onto the screen. Using workspaces you can just put those extra three on another workspace instead.

    I have yet to see anybody argue how great it would be if all books were printed on plastic rather than paper, so that we could see through them.

  17. also HW acc on win2k + Radeon + 3276drv by Otis_INF · · Score: 5, Informative

    I just installed it on my Win2k box with ATi Radeon 32MB DDR and v3276 drivers and it runs very smooth, the windows are draggable with content at full speed on 1600x1200x32bpp. A year ago, some registry hacking tool did this too, but then all drivers were software rendering the alphablended windows and it was dogslow. However making Internet Explorer semi transparent isn't that fast. I guess (but do not know for sure) IE is redrawing the complete page every time something changes in the window (like typing in an edit box).

    --
    Never underestimate the relief of true separation of Religion and State.
  18. Glass windowing on Linux by ortholattice · · Score: 5, Insightful

    Translucent windowing has also been in Linux; here is an example (not mine; look it up on Usenet). (Warning: Partial nudity.) I don't know how it compares since the site referenced in the article has been slashdotted.

  19. Alpha Blended Pie Menus and Censorship in The Sims by SimHacker · · Score: 5, Informative
    The classic papers on transparent user interfaces include Toolglass and Magic Lenses: The See-Through Interface (1993), and A Taxonomy of See-Through Tools (1994).

    The pie menus in The Sims use a combination of desaturation, darkening, and alpha blending to feather the edges of the menu.

    Why transparency and the other effects? I didn't want the pie menus to obscure too much of the scene behind them. You can see through the pie menu as the animation continues on in real time behind it. The head of the currently selected person is drawn in the center of the pie menu, and follows the cursor by looking at the currently selected item.

    I found it necessary to somehow separate the head from the rest of the scene, otherwise it looked like a giant head was floating in a room of the house! Drawing a solid opaque menu background would obscure too much of the scene. But even a partially transparent menu background still did not visually separate the head from the background scene enough. It looked muddy and cluttered, instead of crisp and bright.

    So instead of simply alpha blending, I actually made it desaturate the background (removes the color so it's gray scale), and darken it (like casting a colorless shadow).

    I wanted the colorful head to look sharp and bright up against the dark gray background. So the effect looks at the Z buffer to clip out the head in the menu center, so it remains bright and colorful against the dark gray background. That gives it visual "pop" that separates the head from the background. The edges of the effect are feathered, so there's no sharp line dividing the inside and the outside of the menu (useless visual clutter).

    The gray shadow just gradually tapers off with distance, suggesting that the pie menu active area extends to the edge of the screen, not confined to the borders of a circle. The labels are drawn with high contrast drop shadows around the pie menu, so they stand out and easy to read, partially overlapping the shadow so they're look like they're part of the menu.

    There's special code to perform that particular combination of pixel filters in real time, to every frame just after the 3D rendering phase.

    The pixelated censorship effect works the same way as the pie menu shadow, like a Photoshop filter run after the 3D rendering phase. There's a special suit type that's tagged as a "censorship" suit. It consists of bounding boxes attached to the varius bones of the skeleton that you can select to censor. So if you just want to censor the head, you attach the head censor suit to the head bone. The 3D character renderer transforms the 8 vertices but doesn't draw anything, and stashes the screen bounding box away for the pixelation filter to draw later. That's how it can censor just the crotch of naked men, but also the chests of naked girls gone wild.

    -Don

    --
    Take a look and feel free: http://www.PieMenu.com
  20. Adding functionality not eye-candy by swb · · Score: 5, Interesting

    When will we see more functionality additions instead of just eye-candy? Admittedly translucency can be considered a navigation functionality, but its seldom talked about as one.

    One thing that they (GUI developers -- KDE, MS, Apple, etc) should implement RIGHT NOW is a feature I've seen on SGIs: A wheel widget that scales the contents of a file browser window. Even at 1600x1200 with a dinky font, I work with plenty of directories that just aren't easily navigable with a full-screen window. Too much scrolling. The ability to scale the contents of the window would be awesome, especially if it was coupled with a magnifying lens area arround the pointer.

    Even normal windows with no content scaling would be more usable if we could hold a key and get a panning-type movement feature for windows with more content than screen space. I know plenty of applications do this, but this should be a base feature of the file management tools as well.

    The point is, too many recent "developments" in GUIs seem to have more to do with making it fit stylistic or visual appearance goals and less with making the windowing system MORE USEFUL. Nice to look at makes it more enjoyable, but more useful means I can get the job done faster and get more time to look at something else.