Skip to content
This repository has been archived by the owner on Aug 6, 2021. It is now read-only.

Image Brush

DarthAffe edited this page Jan 15, 2017 · 2 revisions

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:

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.
Clone this wiki locally