Draw a Gradient Within a Picture Box

Category:
Screen/Graphics
Type:
Modules
Difficulty:
Intermediate
Author:
KOSTYA

Version Compatibility:

More information:
This Module contains a function GradientSquare which can be used to draw a square in which the color changes from border to center.

The function includes a parameter, mixing, which, when set to true, mixes the gradient square with the background of the picture box.

Example:

GradientSquare Picture1, 300, 300, RGB( 0, 0, 255), RGB(255, 0, 0), 255, True

This will draw a square within picture1 in which the color changes from BLUE (center) to YELLOW (border) with center in (300,300) on Picture1 and mix it with the background of Picture1.

NOTE: The AutoRedraw property of the picturebox must be set to false.


Instructions: Click the link below to download the code. Select 'Save' from the IE popup dialog. Once downloaded, open the .zip file from your local drive using WinZip or a comparable program to view the contents.

Download gradientsquare.zip