示例#1
0
        public static byte[] DecodePngFile(string encoded)
        {
            encoded = encoded.Substring($"{OfficeDrawIoPayloadPrexix}:".Length);
            var encoder  = new BasE91();
            var pngBytes = encoder.Decode(encoded).ToArray();

            return(pngBytes);
        }
示例#2
0
        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);
        }