From 2d7fcd43904b6cfeb4b6096fcb07a85dc356e6cc Mon Sep 17 00:00:00 2001 From: DarthAffe Date: Sun, 15 Jan 2017 10:50:11 +0100 Subject: [PATCH] Updated Image Brush (markdown) --- Image-Brush.md | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/Image-Brush.md b/Image-Brush.md index 30404ce..1767dd9 100644 --- a/Image-Brush.md +++ b/Image-Brush.md @@ -1 +1,24 @@ -TODO \ No newline at end of file +The _ImageBrush_ is one of the default brushes provided by CUE.NET. +It's used to draw a bitmap into a rectangle. + +Using the _ImageBrush_ is really easy. You just need to assign your bitmap to the __Image__-property after creating the brush (it can even be changed on the fly) like this: + +```C# +ImageBrush imageBrush = new ImageBrush(); +imageBrush.Image = myBitmap; +myLedGroup.Brush = imageBrush; +``` + +### Configure the image-rendering +There are multiple properties which allow you to customize the way how the brush renders the image. +> This might be expanded later but right now there's only one possibility for every setting. + +#### ImageScaleMode +The _ImageScaleMode_ defines how the image is stretched or cropped if the aspect ratio of the image isn't equal the aspect ratio of the rectangle drawn to. (Default: _Stretch_:) +- **Stretch** + The image is resized to fill the destination-rectangle. The aspect ratio is not preserved. + +#### ImageInterpolationMode +The _ImageInterpolationMode_ defines how the image is scaled down to the low pixel-resolution of the keyboard. +- **PixelPerfect** + The image is scaled by taking always the single pixel nearest to the requested point. This method is really fast, but doesn't do any smoothing or interpolation, and might yield not the best quality. \ No newline at end of file