本文整理汇总了C#中System.Resources.ResourceManager.GetStream方法的典型用法代码示例。如果您正苦于以下问题:C# ResourceManager.GetStream方法的具体用法?C# ResourceManager.GetStream怎么用?C# ResourceManager.GetStream使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Resources.ResourceManager
的用法示例。
在下文中一共展示了ResourceManager.GetStream方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Main
//引入命名空间
using System;
using System.Drawing;
using System.Drawing.Imaging;
using System.IO;
using System.Resources;
public class Example
{
public static void Main()
{
Bitmap bmp = new Bitmap(@".\SplashScreen.jpg");
MemoryStream imageStream = new MemoryStream();
bmp.Save(imageStream, ImageFormat.Jpeg);
ResXResourceWriter writer = new ResXResourceWriter("AppResources.resx");
writer.AddResource("SplashScreen", imageStream);
writer.Generate();
writer.Close();
}
}
示例2: Main
//引入命名空间
using System;
using System.Drawing;
using System.IO;
using System.Resources;
using System.Windows.Forms;
public class Example
{
public static void Main()
{
ResourceManager rm = new ResourceManager("AppResources", typeof(Example).Assembly);
Bitmap screen = (Bitmap) Image.FromStream(rm.GetStream("SplashScreen"));
Form frm = new Form();
frm.Size = new Size(300, 300);
PictureBox pic = 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 | AnchorStyles.Bottom |
AnchorStyles.Left | AnchorStyles.Right;
frm.ShowDialog();
}
}