• word 另存为xml后,读取xml的图片数据


    我们把word文档另存为xml后。图片数据是使用base64编码存储的,这样我们就可以使用base64对数据进行解码。

    把图片读取出来。

    代码如下:

    代码
     private void button1_Click(object sender, EventArgs e)
            {
                
    byte[] ary = Convert.FromBase64String(textBox1.Text);
                Image img 
    = BytesToImage(ary);
                pictureBox1.Image 
    = img;
            }

            
    public static Image BytesToImage(byte[] bytes)
            {
                MemoryStream ms 
    = new MemoryStream(bytes);
                Image rtnImg 
    = Image.FromStream(ms);
                
    return rtnImg;
            }

    文本框中的数据是word的图片经过base64编码的数据。

  • 相关阅读:
    leetcode69
    leetcode204
    leetcode414
    leetcode532
    leetcode28
    leetcode155
    leetcode303
    leetcode190
    2018-7-21-win10-uwp-调用-Microsoft.Windows.Photos_8wekyb3d8bbwe-应用
    2018-7-21-win10-uwp-调用-Microsoft.Windows.Photos_8wekyb3d8bbwe-应用
  • 原文地址:https://www.cnblogs.com/yg_zhang/p/1806947.html
Copyright © 2020-2023  润新知