问题描述
我正在使用visual c#2013 ultimate。我的项目有几个图像,我分配给图片框,没有任何问题。但是现在,当我想添加新的图片框时,我无法为其分配新的图像。以前它不是。设计模式没有问题,图像被正确分配到图片框。但在运行模式下,新的图片框没有任何图像并显示空的图片框,只显示bgcolor。但其他图片框没有任何问题。有什么问题?
在此代码中300720131281是一个有效的jpg
I'm using visual c# 2013 ultimate. My project has several image that i assigned to picture box and don't have any problem with this. But now, when i want to add new picturebox,i can't assign new image to it.Whereas it was not before. Design mode don't have a problem and image is properly assigned to picture box. But in running mode,new picturebox don't have any image and show empty picturebox , just show bgcolor. But other picturebox don't have any problem. What is wrong?
"in this code 300720131281 is a valid jpg"
this.pictureBox4.Image = global::bimeh_ok.Properties.Resources._300720131281;
this.pictureBox4.Location = new System.Drawing.Point(36, 181);
this.pictureBox4.Name = "pictureBox4";
this.pictureBox4.Size = new System.Drawing.Size(100, 50);
this.pictureBox4.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
this.pictureBox4.TabIndex = 302;
this.pictureBox4.TabStop = false;
实际上,使用'resources.rex'中的以下代码构建的图像返回null!为什么??
actually, image that build with the following code in 'resources.rex' is returned null ! why??
internal static System.Drawing.Bitmap _300720131281 {
get {
object obj = ResourceManager.GetObject("300720131281", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
推荐答案
这篇关于如何将图像分配到图片框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!