如何将图像分配到图片框 [英] how do assign image to picturebox

查看:81
本文介绍了如何将图像分配到图片框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用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));
           }
       }

推荐答案

这些是什么& amp; amp; quot;在Name属性的值中?

看起来它来自HTML。

无论如何,如果你可以发送更多代码或整个测试项目,它可能会有所帮助我来帮助你: - )
What is these " in the value of the Name property?
It seems like it comes from HTML.
Anyway, if you could send more code, or an entire test project, it may help me to help you:-)


这篇关于如何将图像分配到图片框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆