Raw |
public class RawImageData
The RawImageData type exposes the following members.
Name | Description | |
---|---|---|
RawImageData | Constructor |
Name | Description | |
---|---|---|
Data | byte array with image data | |
Empty | Gets a RawImageData with empty Data array and Width and Height set to zero. | |
Format | image format | |
HasTransparentPixels | Nullable Boolean that can specify if the image data contains transparent pixels (alpha value is less then 1 for at least one pixel). | |
Height | image height in pixels | |
IsPreMultipliedAlpha | Nullable Boolean that can specify if the image data contains pre-multiplied alpha colors (colors are multiplied by alpha value). | |
OneBlackPixelImage | Gets a static 1 x 1 bitmap data with one black pixel with alpha set to 1. | |
Stride | image stride in bytes (length of one data row) | |
Width | image width in pixels |
Name | Description | |
---|---|---|
CheckTransparency | CheckTransparency method checks the data of the image for transparent pixels and returns true in case any transparent pixel is find. It also sets the HasTransparency property. | |
CheckTransparencyAndConvertToPremultipliedAlpha | CheckTransparencyAndConvertToPremultipliedAlpha method converts the colors by multiplying the red, green and blue values by alpha value. This produces the pre-multiplied colors. The method also checks the data of the image for transparent pixels and returns true in case any transparent pixel is find. It also sets the HasTransparency property. | |
CheckTransparentPixels | CheckTransparentPixels returns true when the image data contains transparent pixels (where alpha is less the 1); for fully opaque image false is returned. | |
Clone | Returns a cloned RawImageData with copied data array. | |
ConvertToPremultipliedAlpha | ConvertToPremultipliedAlpha method converts the colors by multiplying the red, green and blue values by alpha value. This produces the pre-multiplied colors. | |
GetBytesPerPixel | Returns number of bytes that is required to store the specified format. The method can get results only for the following formats: R8G8B8A8Unorm, B8G8R8A8Unorm, R8G8B8Unorm, B8G8R8Unorm, R8Unorm. Other formats will throw an exception. | |
GetColor | Returns the color as uint value at the specified position. | |
GetColor4 | Returns the color as Color4 value at the specified position. | |
GetColor4Relative | Returns the color as Color4 value at the specified relative position (x and y should be in range from 0 to 1). | |
GetColorRelative | Returns the color as uint value at the specified relative position (x and y should be in range from 0 to 1). | |
GetFormatProperties | GetFormatProperties sets the hasAlpha, pixelSize and alphaOffset properties from the image format. The method returns false when the format is not known. | |
Resize | Creates a new Data array with new dataLength and updates the Width, Height and Stride properties (Format value is preserved). | |
SetColor | Set the color at the specified position | |
SetColor4 | Set the color at the specified position | |
SetColor4Relative | Set the color at the specified relative position (x and y should be in range from 0 to 1). | |
SetColorRelative | Set the color at the specified relative position (x and y should be in range from 0 to 1). | |
SwapRedAndBlueColors | SwapRedAndBlueColors converts RGBA to BGRA and vice versa. |