-
Notifications
You must be signed in to change notification settings - Fork 18
Image Brush
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;
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.
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.
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.
Please drop me a message if you find mistakes or inadequate descriptions in one of the pages here!
-
Introduction
1.1. What is CUE.NET?
1.2. What can I do with CUE.NET?
1.3. Projects using CUE.NET -
Getting started
2.1. Adding CUE.NET to a project
2.2. Initializing CUE.NET
2.3. Perform basic lighting
2.4. Understanding CUE.NET ledgroups -
Gradients
3.1. Understanding CUE.NET gradients
3.2. Linear Gradient
3.3. Rainbow Gradient
3.4. Implementing an own gradient -
Brushes
4.1. Understanding CUE.NET brushes
4.2. Color-Corrections
4.3. Solid-Color Brush
4.4. Linear-Gradient Brush
4.5. Radial-Gradient Brush
4.6. Random-Color Brush
4.7. Image-Brush
4.8. Implementing an own brush -
Effects
5.1. Understanding CUE.NET effects
5.2. Flash Effect
5.3. Move-Gradient Effect
5.4. Implementing an own effect -
Tutorials