public AccessibleBitmap GetAccessibleBitmap() { AccessibleBitmap aBitmap = new AccessibleBitmap(width, height, pixelBytes); aBitmap.SetRawPixelBytes(byteArray); return(aBitmap); }
//Decompress byte array into aBitmap with help of width, length and bitdepth public static AccessibleBitmap Decompress(byte[] source, int width, int height, int pixelBytes) { //Create aBitmap from raw data AccessibleBitmap aBitmap = new AccessibleBitmap(width, height, pixelBytes); aBitmap.SetRawPixelBytes(source); //Return the created bitmap return(aBitmap); }
public AccessibleBitmap GetAccessibleBitmap() { byte[] tmpBytes = new byte[width * height * pixelBytes]; new BitArray(boolArray).CopyTo(tmpBytes, 0); AccessibleBitmap aBitmap = new AccessibleBitmap(width, height, pixelBytes); aBitmap.SetRawPixelBytes(tmpBytes); return(aBitmap); }
//Decompress byte array into aBitmap with help of width, length and bitdepth public static AccessibleBitmap Decompress(byte[] source, int width, int height, int pixelBytes) { BitStreamFIFO layerBits = new BitStreamFIFO(source); int[] byteArray = VaryingIntArrayCompressor.Decompress(ref layerBits); //Create aBitmap from pixel data AccessibleBitmap aBitmap = new AccessibleBitmap(width, height, pixelBytes); aBitmap.SetRawPixelBytes(Array.ConvertAll(byteArray, Convert.ToByte)); return(aBitmap); }