1
0
mirror of https://github.com/DarthAffe/CUE.NET.git synced 2025-12-13 09:08:34 +00:00

Added some content

DarthAffe 2015-11-29 09:49:53 +01:00
parent 0f49368377
commit 71454bb4e7

@ -1 +1,25 @@
TODO The _LinearGradientBrush_ is one of the default brushes provided by CUE.NET.
It's used to draw a gradient as a "line" inside a rectangle.
You are able to define a start and an end-point (both are inter- or extrapolated if needed) and the gradient which should be drawn on the virtual line between this points by either providing them as constructor-parameters or using the _StartPoint_-, _EndPoint_- and _Gradient_-Properties.
If you don't set an gradient the brush will return transparent for every key.
> The Start- and End-Point is given as the percentage from the top left corner.
> new PointF(0f, 0f) will be top left, new PointF(0,5f, 0,5f) in the center and new PointF(1f, 1f) in the bottom right.
If you want to create a background on your keyboard looking like this
<img src="https://upload.wikimedia.org/wikipedia/commons/2/27/Gradient.svg" width="128" height="128">
you could use this code
```C#
GradientStop[] gradientStops =
{
new GradientStop(0f, Color.Blue),
new GradientStop(1f, Color.Red)
};
LinearGradient blueToRedGradient = new LinearGradient(gradientStops); // Gradient from blue to red
PointF startPoint = new PointF(0f, 1f); // Bottom left corner
PointF endPoint = new PointF(1f, 0f); // Top right corner
LinearGradientBrush linearBrush = new LinearGradientBrush(startPoint, endPoint, blueToRedGradient);
keyboard.Brush = linearBrush;
```