GDI+ Graphics on the fly in ASP.NET

Category:
C#, VB.NET, ASP.NET
Type:
Applications
Difficulty:
Intermediate

Author: Greg Givler

Version Compatibility: ASP.NET

More information:
I had need of this little page so I wrote it in an afternoon. It uses GraphicPath to create a LinearGradientBrush using the InterpolationColors method to draw a colored bar that is a gradient from Red to Yellow to Green. It also places the value that you pass to the page in the graphic as well. Usage is:

Rating must be a number from 1 to 10 Width and Height set the Width and Height of the gif

RatingBar.aspx?Width=300&Height=50&Rating=10

Enjoy

Greg

Updated 7/3/03 with some bug fixes and extensive comments

Instructions: Copy the declarations and code below and paste directly into your VB project.

Declarations:

Code: