This class enables you to resize a bitmap.
Namespace:
Aurigma.GraphicsMill.Transforms
Assembly:
Aurigma.GraphicsMill (in Aurigma.GraphicsMill.dll)
Public NotInheritable Class Resize _ Inherits BitmapTransform
public sealed class Resize : BitmapTransform
Using this class you may resample the bitmap: specify Width and Height properties, then apply the transform, and it will return resized bitmap. If you set some of these properties to 0, this property is automatically calculated to preserve the aspect ratio of the image.
Essential parameter of all the geometric Transforms (including resizing) is an interpolation algorithm. It specifies how to calculate intermediate points. Different algorithms produces different quality, but as usual the higher quality it produces, the slower algorithm works. You can select interpolation algorithm with InterpolationMode property.
This class provides interesting feature - you can resize not only entire bitmap, but even a portion of this bitmap. This way you can avoid edge effects (which will arise if you first crop and then resize the bitmap). It is important when you need to stitch several resized portions seamlessly (for example, during optimized drawing). To enable this feature, set CropEnabled property to true and fill CropRectangle with necessary values.
All the coordinates and sizes are measured in units specified with Unit property.
Member Name | Description |
---|---|
Format1bppIndexed | 1 bit per pixel. Indexed. |
Format4bppIndexed | 4 bits per pixel. Indexed. |
Format8bppIndexed | 8 bits per pixel. Indexed. |
Format8bppGrayScale | 8 bits per pixel. Grayscale. 8 bits are used for luminosity level. |
Format16bppGrayScale | 16 bits per pixel. Grayscale. All 16 bits are used for luminosity level (extended pixel format). |
Format16bppAGrayScale | 16 bits per pixel. Grayscale with alpha channel. 8 bits are used for alpha channel and other 8 bits are used for luminosity level. |
Format32bppAGrayScale | 32 bits per pixel. Grayscale with alpha channel. 16 bits are used for alpha channel and other 16 bits are used for luminosity level (extended pixel format). |
Format16bppRgb565 | 16 bits per pixel. RGB. 5 bits each are used for the red, and blue components. 6 bits are used for green component. |
Format16bppRgb555 | 16 bits per pixel. RGB. 5 bits each are used for the red, green, and blue components. The rest bit is unused. |
Format16bppArgb1555 | 16 bits per pixel. RGB with alpha channel. 1 bit is used for the alpha component, and 5 bits each are used for the red, green, and blue components. |
Format24bppRgb | 24 bits per pixel. RGB. 8 bits each are used for the red, green, and blue components. |
Format32bppRgb | 32 bits per pixel. RGB. 8 bits each are used for the red, green, and blue components. The rest 8 bits are unused. |
Format32bppArgb | 32 bits per pixel. RGB with alpha channel. 8 bits each are used for the alpha, red, green, and blue components. |
Format48bppRgb | 48 bits per pixel. RGB. 16 bits each are used for the red, green, and blue components (extended pixel format). |
Format64bppArgb | 64 bits per pixel. RGB with alpha channel. 16 bits each are used for the alpha, red, green, and blue components (extended pixel format). |
Format32bppCmyk | 32 bits per pixel. CMYK. 8 bits each are used for the cyan, magenta, yellow, and black components. |
Format64bppCmyk | 64 bits per pixel. CMYK. 16 bits each are used for the cyan, magenta, yellow, and black components (extended pixel format). |
Format80bppAcmyk | 80 bits per pixel. CMYK with alpha channel. 16 bits each are used for the alpha, cyan, magenta, yellow, and black components (extended pixel format). |