public static byte[] DecodePngFile(string encoded) { encoded = encoded.Substring($"{OfficeDrawIoPayloadPrexix}:".Length); var encoder = new BasE91(); var pngBytes = encoder.Decode(encoded).ToArray(); return(pngBytes); }
public static string EncodePngFile(string path) { var pngBytes = FileReadAllBytes(path); var encoder = new BasE91(); var pngEncoded = encoder.Encode(pngBytes).ToString(); var encoded = $"{OfficeDrawIoPayloadPrexix}:{pngEncoded}"; return(encoded); }