VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Animated, shimmering form reflection effect

by grigri (9 Submissions)
Category: Graphics
Difficulty: Advanced
Date Added: Wed 3rd February 2021
Rating: (23 Votes)

This code creates a semi-transparent reflection of your form which shimmers in realtime. The screenshot shows the basic idea, but it looks much better animated!

It uses the UpdateLayeredWindow() API, so will only work on 2k/XP. I have only tested it on XP.

It can use quite a bit of CPU (especially while moving or sizing the form) but could be a nice feature on an about box or something.

Parts of the code are optimized, others are not. It could easily be improved upon, and I welcome any suggestions you might have.

The effect subclasses your form. To keep the code simple, I have not used ASM-thunking as I usually do, so if you run it in the IDE: DO NOT press the stop button, and DO NOT try and debug-step through the subclassed WindowProc. If you avoid doing this it will run in the IDE quite nicely.

There is one "feature" that occurs when the form is near the left edge of the screen : the wave is shunted to the right. I don't know why, if you do, tell me!

Some routines were adapted from the vbaccelerator article at https://www.vbaccelerator.com/home/vb/code/libraries/Graphics_and_GDI/Drop_Shadows/article.asp

Rate Animated, shimmering form reflection effect

Download Animated, shimmering form reflection effect

Download Animated, shimmering form reflection effect (27 KB)

Animated, shimmering form reflection effect Comments

No comments have been posted about Animated, shimmering form reflection effect. Why not be the first to post a comment about Animated, shimmering form reflection effect.

Post your comment

Subject:
Message:
0/1000 characters