public BinImageData(Bitmap image) { byte[] tiles; ushort[] mapping; Color[] palette; ushort width; ushort height; VideoSega.ImageToData(image, null, out tiles, out mapping, out palette, out width, out height); image.Dispose(); MemoryStream dataStream = new MemoryStream(); dataStream.WriteWordInc(0, (ushort)(tiles.Length / TileSize)); dataStream.WriteWordInc(0, width); dataStream.WriteWordInc(0, height); byte[] palBytes = VideoSega.PaletteToByteArray(palette); dataStream.Write(palBytes, 0, palBytes.Length); byte[] mapBytes = Mapper.WordMapToByteMap(mapping); dataStream.Write(mapBytes, 0, mapBytes.Length); dataStream.Write(tiles, 0, tiles.Length); data = dataStream.ToArray(); }
public void ImageAndMask(out Bitmap image) { image = VideoSega.ImageFromData(Tiles, Mapping, Palette, Width, Height); }