如何将图像分配到新的图片框

时间:2015-03-05 20:36:33

标签: c# image picturebox

我正在使用visual c#2013 ultimate。我的项目有几个图像,我分配给图片框,没有任何问题。但是现在,当我想添加新的图片框时,我无法为其分配新的图像。以前它不是。设计模式没有问题,图像被正确分配到图片框。但在运行模式下,新的图片框没有任何图像并显示空的图片框,只显示bgcolor。但其他图片框没有任何问题。怎么了? “在此代码300720131281是一个有效的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!为什么??

internal static System.Drawing.Bitmap _300720131281 {
           get {
               object obj = ResourceManager.GetObject("300720131281", resourceCulture);
               return ((System.Drawing.Bitmap)(obj));
           }
       }

0 个答案:

没有答案
相关问题