VBcoders Browse New Submit Contact Sign In

No account? Register free

Forgot password?

Animated, shimmering form reflection effect

grigri  (9 Submissions)   Graphics   Advanced   Wed 3rd February 2021

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 (24(24 Vote))

Download Animated, shimmering form reflection effect

Animated, shimmering form reflection effect Comments

No comments yet — be the first to post one!

Post a Comment

0/1000 characters