예제 #1
0
 static void WriteBitmap(string path, uint[] palette, byte[] pixels, int width)
 {
     using var stream = File.Open(path, FileMode.Create, FileAccess.Write);
     using var bw     = new BinaryWriter(stream);
     using var s      = new GenericBinaryWriter(bw, Encoding.ASCII.GetBytes);
     Bitmap8Bit.Serdes(new Bitmap8Bit((ushort)width, palette, pixels), s);
 }
예제 #2
0
 static byte[] GetRawWoplBytes(WoplFile wopl)
 {
     using var ms  = new MemoryStream();
     using var bw  = new BinaryWriter(ms);
     using var gbw = new GenericBinaryWriter(bw, Encoding.ASCII.GetBytes, ApiUtil.Assert);
     WoplFile.Serdes(wopl, gbw);
     return(ms.ToArray());
 }