VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



ColorGradient Class

by Brian Zablocky (4 Submissions)
Category: Miscellaneous
Compatability: VB Script
Difficulty: Advanced
Date Added: Wed 3rd February 2021
Rating: (5 Votes)

This is an improvement upon my ColorFade class. Supply up to 11 colors (0% to 100% by 10%) and it will produce a gradient on your form or picture box. Optionally choose up to 8 sources for the gradient (4 sides, 4 corners). The only file needed is the class module. The test project is for demonstration purposes. Updated with comments. Added a new UnSetColor method.

Inputs
Include the class in your project and declare it. Specify up to 11 colors and a gradient source using the SetColor method with an index of 0 through 10. Use the PaintObject method to draw the gradient.
Assumes
This code does not require ColorFade. It is standalone. Much of the code in this class was derived from ColorFade. If you need a midpoint color, use ColorFade instead of ColorGradient.
Code Returns
A gradient drawn on a form or picture box.
Side Effects
Make sure the auto-redraw is on. After you draw the gradient on an object, call the object's Refresh method.
API Declarations
'
' No API. Pure VB
'

Rate ColorGradient Class

Download ColorGradient Class

Download ColorGradient Class (48 KB)

ColorGradient Class Comments

No comments have been posted about ColorGradient Class. Why not be the first to post a comment about ColorGradient Class.

Post your comment

Subject:
Message:
0/1000 characters