admin 管理员组文章数量: 1184232
2024年4月19日发(作者:java程序设计建议)
利用.NET 框架下的FromBase64String和ToBase64String方法可以很容易地实现图
象文件和XML文件的互换。这样可以轻易解决以XML格式保存图片的问题。代码
如下:
Public Class Form1
Inherits Systndows.Formm
#Region " Windows 窗体设计器生成的代码 "
Public Sub New()
MyBaw()
InitializeComponent()
在 InitializeComponent() 调用之后添加任何初始化
End Sub
窗体重写处置以清理组件列表。
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing Then
If Not (components Is Nothing) Then
components.Dispose()
End If
End If
MyBaspose(disposing)
End Sub
Windows 窗体设计器所必需的
Private components As SystmponentModontainer
注意:以下过程是 Windows 窗体设计器所必需的
可以使用 Windows 窗体设计器修改此过程。
不要使用代码编辑器修改它。
Friend WithEvents Button1 As System.Windowtton
Friend WithEvents Button2 As Systndows.Formton
Friend WithEvents PictureBox1 As System.Windows.Forms.PictureBox
Friend WithEvents Button3 As System.Windowtton
Friend WithEvents Label1 As Systedows.Forms.Label
Friend WithEvents Label2 As System.Windowbel
tton1 = New System.Windowtton()
Mton2 = New Systndows.Formton()
Me.PictureBox1 = New System.Windows.Forms.PictureBox()
tton3 = New System.Windowtton()
Mel1 = New Systedows.Forms.Label()
Me.Label2 = New System.Windowbel()
Me.SuspendLayout()
Button1
tton1.Location = New Systawing.Point(365, 63)
Me.Button1.Name = "Button1"
Me.Button1.Size = New Systewing.Size(115, 23)
Me.ButtonIndex = 0
Me.Buttoxt = "将图象保存成XML"
Button2
tton2.Location = New Systawing.Point(365, 98)
Me.Button2.Name = "Button2"
Me.Button2.Size = New Systewing.Size(115, 23)
Me.ButtonIndex = 1
Me.Buttoxt = "从XML中得到图象"
PictureBox1
MtureBox1.Location = New System.Drawing.Point(18, 6)
MtureBox1.Name = "PictureBox1"
Me.PictureBoxe = New System.Drawize(320, 460)
ctureBox1.TabIndex = 2
ctureBox1.TabStop = False
Button3
Mton3.Location = New Systewing.Point(365, 28)
Me.Buttome = "Button3"
Me.Buttoze = New System.Drawing.Size(115, 23)
tton3.TabIndex = 3
Me.Buttont = "浏览图片…"
Label1
Mel1.Location = New System.Drawing.Point(369, 135)
Me.Labele = "Label1"
bel1.Size = New Systawing.Size(105, 95)
Me.LabelIndex = 4
Label2
Me.Labelation = New System.Drawinnt(367, 437)
bel2.Name = "Label2"
Me.Labeze = New System.Drawing.Size(130, 16)
bel2.TabIndex = 5
bel2.Text = "【孟宪会之精彩世界】"
Form1
Me.AutoScaleBaseSize = New System.Drawize(5, 13)
Me.ClientSize = New System.Drawine(500, 480)
版权声明:本文标题:把图象文件转换成XML格式文件 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://roclinux.cn/b/1713480143a636751.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论