Sign in to follow this  
Followers 0
crashdemons

Another Fake Aero-Glass Example

1 post in this topic

#1 ·  Posted (edited)

Posted Image

Introduction

This example was made to show a simple way to have Glass-like blurring in a [fake] Non-client area of a a window [with image overlays] on operating systems that do not support Aero.

How was this done?

The idea was to blur a subsection of a screenshot under the window; however there was one problem with this - you apparently can't screenshot *under* a window. To work-around this, the window is made transparent for a short period of time when activated to acquire the screenshot. This was the "Cheating" part.

The Blurring is done by a Box Blur function of a custom DLL (included w/ source).

The blurred screenshot subsection is then drawn onto a [GDIP] backbuffer, the window controls are forced to draw onto it as well, overlay images on top of that - and finally the backbuffer is brought to the screen.

Usage Notes

Since the background is recloned and reblurred while moving, CPU usage is likely to be higher while dragging the window - but it should drop to almost nothing when you stop moving the window.

You can change the number of Blur passes (amount of blurring) to complement your preference of CPU or realism. See "$BlurPasses" on Line 30.

Known Issues

  • If you attempt to drag the window while inactive, the script will be temporarily paused after becoming transparent, resulting in you dragging an invisible window. (becomes visible when released)
  • Reliable "correct" background can't be acquired while the window is not on top of the z-order, so we show solid gray when inactive.
  • Since screenshots are taken when the active state changes, any background-changes since will not appear in the "glass"
  • If a window below the "glass" window doesn't redraw while the window becomes transparent (see "Cheating"), then this may be shown in the "glass".

Download

FakeGlassTest.zip

Included files: AutoIt Script, Required DLL, Required PNG's; DLL Source, GIMP development files (XCF) for the PNG's.

Note: Only tested on Windows XP SP3 with AutoIt 3.3.6.1

Credits

All image work was done from scratch in GIMP while looking at screenshots of Vista/Win7 for reference.

Part of the code concerned with acquiring DIB data and CreateDIBSection was modified from an unrelated project by Phodexis.

Any criticisms, complements, modifications or enhancements are welcome.

Edited by crashdemons

My Projects - WindowDarken (Darken except the active window) Yahsmosis Chat Client (Discontinued) StarShooter Game (Red alert! All hands to battlestations!) YMSG Protocol Support (Discontinued) Circular Keyboard and OSK example. (aka Iris KB) Target Screensaver Drive Toolbar Thingy Rollup Pro (Minimize-to-Titlebar & More!) 2D Launcher physics example Ascii Screenshot AutoIt3 Quine Example ("Is a Quine" is a Quine.) USB Lock (Another system keydrive - with a toast.)

Share this post


Link to post
Share on other sites



Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0