本文整理汇总了VB.NET中System.Resources.ResourceManager.GetStream方法的典型用法代码示例。如果您正苦于以下问题:VB.NET ResourceManager.GetStream方法的具体用法?VB.NET ResourceManager.GetStream怎么用?VB.NET ResourceManager.GetStream使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Resources.ResourceManager
的用法示例。
在下文中一共展示了ResourceManager.GetStream方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的VB.NET代码示例。
示例1: Main
' 导入命名空间
Imports System.Drawing
Imports System.Drawing.Imaging
Imports System.IO
Imports System.Resources
Module Example
Public Sub Main()
Dim bmp As New Bitmap(".\SplashScreen.jpg")
Dim imageStream As New MemoryStream()
bmp.Save(imageStream, ImageFormat.Jpeg)
Dim writer As New ResXResourceWriter("AppResources.resx")
writer.AddResource("SplashScreen", imageStream)
writer.Generate()
writer.Close()
End Sub
End Module
示例2: Example
' 导入命名空间
Imports System.Drawing
Imports System.IO
Imports System.Resources
Imports System.Windows.Forms
Module Example
Public Sub Main()
Dim rm As New ResourceManager("AppResources", GetType(Example).Assembly)
Dim screen As Bitmap = CType(Image.FromStream(rm.GetStream("SplashScreen")), Bitmap)
Dim frm As New Form()
frm.Size = new Size(300, 300)
Dim pic As New PictureBox()
pic.Bounds = frm.RestoreBounds
pic.BorderStyle = BorderStyle.Fixed3D
pic.Image = screen
pic.SizeMode = PictureBoxSizeMode.StretchImage
frm.Controls.Add(pic)
pic.Anchor = AnchorStyles.Top Or AnchorStyles.Bottom Or
AnchorStyles.Left Or AnchorStyles.Right
frm.ShowDialog()
End Sub
End Module