Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/image/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# UserControl从C中的资源获取图像#_C#_Image_User Controls - Fatal编程技术网

C# UserControl从C中的资源获取图像#

C# UserControl从C中的资源获取图像#,c#,image,user-controls,C#,Image,User Controls,我想让用户控制与自由改变图像。我搜索并制作了以下代码 [Description("Setting the image which shows main"), Category("Custom"), DefaultValue(typeof(Image),"null"), EditorAttribute(typeof(System.Drawing.Design.ImageEditor), typeof(System.Drawing.Design.UITypeEditor))] publi

我想让用户控制与自由改变图像。我搜索并制作了以下代码

[Description("Setting the image which shows main"), Category("Custom"),
 DefaultValue(typeof(Image),"null"),
 EditorAttribute(typeof(System.Drawing.Design.ImageEditor), 
 typeof(System.Drawing.Design.UITypeEditor))]

 public Image MainImage
 {
     get { return pictureBoxMain.Image; }
     set { pictureBoxMain.Image = value; }
 }
当我尝试在design editor上更改图像时,它调用exploror。但我想显示的不是exploror,即主项目的资源列表。(只需调用基本图像属性)

我想也许我应该在底线下换衣服

    EditorAttribute(typeof(System.Drawing.Design.ImageEditor), 
    typeof(System.Drawing.Design.UITypeEditor))]

在这里结巴。所以请帮我解决这些问题。

我已经尝试了
[Description(“设置显示main的图像”)、Category(“Custom”)、DefaultValue(typeof(image),“null”)]public image main image{get{return pictureBoxMain.image;}set{pictureBoxMain.image=value;}
我对此没有任何问题。rraszewski///谢谢。完成。