您的位置:学习中国 推荐教程 VB编程 正文
原作者:kuku 添加时间:2007-06-02 原文发表:2007-06-02 人气:44 来源:互联网

本文章共28074字,分19页,当前第3页,快速翻页:
 
-----------------------------------------------------------------------------------------------------------------------------------------------

本文提示:《vb.net例程集锦(3)》是本站编辑们为广大网友精选的实用文章,本文阐述了关于文章的相关理论,相对来说专业性强,但是本文只是针对于某个问题提出的见解与论述,未必能辐射到相关问题的方方面面,所以本文处理问题的方法仅仅为您提供一些参考。更多问题请查阅学习中国网其他栏目哦.

-----------------------------------------------------------------------------------------------------------------------------------------------


Me.Button2.Name = \"Button2\"
Me.Button2.Size = New System.Drawing.Size(115, 23)
Me.Button2.TabIndex = 1
Me.Button2.Text = \"从XML中得到图象\"
\'
\'PictureBox1
\'
Me.PictureBox1.Location = New System.Drawing.Point(18, 6)
Me.PictureBox1.Name = \"PictureBox1\"
Me.PictureBox1.Size = New System.Drawing.Size(320, 460)
Me.PictureBox1.TabIndex = 2
Me.PictureBox1.TabStop = False
\'
\'Button3
\'
Me.Button3.Location = New System.Drawing.Point(365, 28)
Me.Button3.Name = \"Button3\"
Me.Button3.Size = New System.Drawing.Size(115, 23)
Me.Button3.TabIndex = 3
Me.Button3.Text = \"浏览图片…\"
\'
\'Label1
\'
Me.Label1.Location = New System.Drawing.Point(369, 135)
Me.Label1.Name = \"Label1\"
Me.Label1.Size = New System.Drawing.Size(105, 95)
Me.Label1.TabIndex = 4
\'
\'Label2
\'
Me.Label2.Location = New System.Drawing.Point(367, 437)
Me.Label2.Name = \"Label2\"
Me.Label2.Size = New System.Drawing.Size(130, 16)
Me.Label2.TabIndex = 5
Me.Label2.Text = \"【孟宪会之精彩世界】\"
\'
\'Form1
\'
Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
Me.ClientSize = New System.Drawing.Size(500, 480)
Me.Controls.AddRange(New System.Windows.Forms.Control() {Me.Label2, Me.Label1, Me.Button3, Me.PictureBox1, Me.Button2, Me.Button1})
Me.Name = \"Form1\"
Me.Text = \"图象文件和XML格式文件互换例子\"
Me.ResumeLayout(False)

End Sub

#End Region

Private MyFile As String = \"\"
Private MyFileExt As String = \"\"
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) _
Handles Button2.Click
Dim pic As String
Dim MyXml As System.Xml.XmlDocument = New System.Xml.XmlDocument()
MyXml.Load(\"c:\\MyPhoto.xml\")
Dim picNode As System.Xml.XmlNode
picNode = MyXml.SelectSingleNode(\"/pic/photo\")
pic = picNode.InnerText
Dim memoryStream As System.IO.MemoryStream
memoryStream = New System.IO.MemoryStream(Convert.FromBase64String(pic))
Me.PictureBox1.Image = New System.Drawing.Bitmap(memoryStream)
memoryStream.Close()
End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) _
Handles Button1.Click
If MyFile = \"\" Then
MessageBox.Show(\"请选择一个图片!\", \"错误\", MessageBoxButtons.OK, MessageBoxIcon.Warning)
Exit Sub
End If
Dim MyImg As System.Drawing.Image = MyImg.FromFile(MyFile)
Dim memoryStream As System.IO.MemoryStream = New System.IO.MemoryStream()
MyImg.Save(memoryStream, GetImageType(MyFileExt))
Dim b() As Byte
b = memoryStream.GetBuffer()
Dim pic As String = Convert.ToBase64String(b)
memoryStream.Close()
Dim MyXml As System.Xml.XmlDocument = New System.Xml.XmlDocument()
MyXml.LoadXml(\"孟宪会\" + pic + \"\")
MyXml.Save(\"c:\\MyPhoto.xml\")
Label1.Text = \"文件被保存到了:\" + Microsoft.VisualBasic.ChrW(13) + \"c:\\MyPhoto.xml\"
 
本文章更多内容<<上一页 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - 15 - 16 - 17 - 18 - 19 - 下一页>>
本页地址
收藏到:[收藏夹] [百度搜藏] [新浪ViVi] [POCO网摘] [ 和讯网摘] [好哦网摘] [Google书签]
               
[搜狐网摘] [365Key网摘] [天极网摘] [我摘] [博采网摘] [igooi网摘]
相关文章

在VB.NET中获得功能加强的分类和查询数组
解析Visual Basic.NET事件编程
VB.NET中对象的克隆
VB.Net编程入门之Hello World 入门篇
VB 神童教程第二章第九节——综合示例三
VB 神童教程第二章第八节——组合框控件
VB 神童教程第二章第七节——列表框控件
VB 神童教程第二章第六节——综合示例二
VB 神童教程第二章第五节——单选与复选控件
VB 神童教程第二章第四节-CommandButton控件
向SQL Server数据库添加图片和文字
多个窗体之间如何互相调用
如何拖动没有边框的窗体?
怎么让窗体透明后,控件不透明?
Video/ Audio压缩数据流播放技术
VB程序中处理随机事件
VB编程的必备技巧
VB6制作Win98风格的工具栏
VB实现窗口的弹出式菜单
用VB6实现动态增减控件

相关评论


本文章所属分类:首页 推荐教程 VB编程   VB编程