|
-
May 25th, 2017, 07:27 AM
#1
VB6 Easing-Functions (a more powerful alternative to AnimateWindow)
For those who never heard of Easing-Functions, they are used in all kind of
animation-scenarios - these days most often for Browser-(js)Widgets and -Effects.
Here's a link which describes them (with a nice Overview-Chart, which animates its Images on MouseOver):
http://easings.net/en
The underlying math is not that difficult - and I've encapsulated the most interesting Easing-Methods in a little Class.
This Class now also contains an 'Animate'-Method, which you can hand a Control,
a Property-Name, and PropStart - PropEnd-Values, you want to animate (over a given Duration).
For that 'Animate'-Method the little cEasing-Class now makes use of an internal cTimer-Class
(for which I've choosen the first one I was able to find in the CodeBank that supported an Event):
http://www.vbforums.com/showthread.p...ule-2008-06-15
Here is what it looks like in action (animating two Control-Properties at once - the Top- and the Alpha-Property):

Here is the Source-Code: http://vbRichClient.com/Downloads/Easing.zip
Have fun with it...
Olaf
Last edited by Schmidt; May 25th, 2017 at 07:32 AM.
-
May 25th, 2017, 08:49 AM
#2
Re: VB6 Easing-Functions (a more powerful alternative to AnimateWindow)
Haven't tried your code, but I think it is restricted to Win8 and higher, due to setting layered window attribute on a child window, correct?
-
May 25th, 2017, 10:44 AM
#3
Re: VB6 Easing-Functions (a more powerful alternative to AnimateWindow)
Hi, LaVolpe, I tested the above example on XP, and it worked perfectly.
-
May 25th, 2017, 11:27 AM
#4
Re: VB6 Easing-Functions (a more powerful alternative to AnimateWindow)
 Originally Posted by LaVolpe
Haven't tried your code, but I think it is restricted to Win8 and higher, due to setting layered window attribute on a child window, correct?
Yep, that's what I wrote already in the thread which triggered this contribution:
http://www.vbforums.com/showthread.p...=1#post5172513
@dreammanor
It works on XP, but the Alpha-changes (which happen in parallel to the Movements) are not having any effect.
Olaf
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|