要将图像添加到xml文件中: [英] To add an image to an xml file:
本文介绍了要将图像添加到xml文件中:的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
1>如何将图像添加到xml文件中(语法)?
2>您如何从xml中获取该图像并在asp.net(网页中的按钮)中单击按钮时显示它?
1> How do I add an image to an xml file.(syntax for it)?
2> How can you fetch that image from xml and show it when a button is clicked in asp.net(button in webpage)?
推荐答案
XML不支持图像.您必须将图像存储为XML中的Base64.
^ ]可能会帮助您. br/>
XML doesn''t support images. You have to store image as Base64 in XML.
This[^] might help you.
Dim img As Image
Dim stream As New IO.MemoryStream()
Dim result As String
img = ' your image
img.Save(stream, System.Drawing.Imaging.ImageFormat.Jpeg) ' or whatever format you want to use
result = Convert.ToBase64String(stream.ToArray)
并反向检索图像.
and reverse to retrieve the image.
这篇关于要将图像添加到xml文件中:的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文