Quantcast
Channel: Andrés Jaimes » C#
Viewing all articles
Browse latest Browse all 4

How to create a simple gradient in C#

$
0
0
Creating a simple gradient using two colors is very simple: Rectangle rect = new Rectangle(0, 0, 100, 100); LinearGradientBrush lgb = new LinearGradientBrush(rect, Color.White, Color.Blue, 90); e.Graphics.FillRectangle(lgb, rect); This code will generate a gradient in the given rectangle that goes from white to blue in a vertical way (see last parameter in constructor). In this [...]

Viewing all articles
Browse latest Browse all 4

Trending Articles