public static ImageSource Decode(byte[] data, TgaHeader tgaHeader, int size) { var imageDataOffset = RgbBufferDecoder.GetImageDataOffset(tgaHeader); var numberOfPixels = RgbBufferDecoder.GetStride(tgaHeader) * tgaHeader.Height; var imageBuffer = data.Skip(imageDataOffset).Take(numberOfPixels).ToArray(); return(RgbBufferDecoder.Decode(tgaHeader, imageBuffer, size)); }
public static ImageSource Decode(byte[] data, TgaHeader tgaHeader, int size) { var imageBuffer = GetImageBuffer(data, tgaHeader); return(RgbBufferDecoder.Decode(tgaHeader, imageBuffer, size)); }