AtalaImageGetChangedPixelFormat Method |
// Load an image. AtalaImage image = new AtalaImage(@"D:\Test Images\1.jpg"); AtalaImage converted = null; // Convert the image to 8-bit Grayscale. // Be sure the image is a different PixelFormat or an exception is thrown. if (image.PixelFormat != PixelFormat.Pixel8bppGrayscale) { converted = image.GetChangedPixelFormat(PixelFormat.Pixel8bppGrayscale); image.Dispose(); } else converted = image;
' Load an image. Dim image As AtalaImage = New AtalaImage("D:\Test Images\1.jpg") Dim converted As AtalaImage = Nothing ' Convert the image to 8-bit Grayscale. ' Be sure the image is a different PixelFormat or an exception is thrown. If image.PixelFormat <> PixelFormat.Pixel8bppGrayscale Then converted = image.GetChangedPixelFormat(PixelFormat.Pixel8bppGrayscale) image.Dispose() Else converted = image End If
Name | Description | |
---|---|---|
GetChangedPixelFormat(PixelFormat) | Returns a new AtalaImage object with a different PixelFormat from this AtalaImage.
| |
GetChangedPixelFormat(PixelFormat, ColorProfile) | Returns a new AtalaImage object with a different PixelFormat from this AtalaImage.
| |
GetChangedPixelFormat(PixelFormat, ColorProfile, Boolean) | Returns a new AtalaImage object with a different PixelFormat from this AtalaImage
specifying a ColorProfile and if the ChangedPixelFormat event
should fire. |
// Load an image. AtalaImage image = new AtalaImage(@"D:\Test Images\1.jpg"); AtalaImage converted = null; // Convert the image to 8-bit Grayscale. // Be sure the image is a different PixelFormat or an exception is thrown. if (image.PixelFormat != PixelFormat.Pixel8bppGrayscale) { converted = image.GetChangedPixelFormat(PixelFormat.Pixel8bppGrayscale); image.Dispose(); } else converted = image;
' Load an image. Dim image As AtalaImage = New AtalaImage("D:\Test Images\1.jpg") Dim converted As AtalaImage = Nothing ' Convert the image to 8-bit Grayscale. ' Be sure the image is a different PixelFormat or an exception is thrown. If image.PixelFormat <> PixelFormat.Pixel8bppGrayscale Then converted = image.GetChangedPixelFormat(PixelFormat.Pixel8bppGrayscale) image.Dispose() Else converted = image End If