本文整理匯總了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