How does it work open Background image in Visual Studio?
-
Hi all, i want to create a control that does just like a panel into Visual Studio. If i want to set a background image i go on open file dialog at the voice background image and load the image. I know how create this property for my cotnrol but when i laod the image it doesn't is set in my resource project directory as Visual Studio does. How can i do?
-
Hi all, i want to create a control that does just like a panel into Visual Studio. If i want to set a background image i go on open file dialog at the voice background image and load the image. I know how create this property for my cotnrol but when i laod the image it doesn't is set in my resource project directory as Visual Studio does. How can i do?
Is your problem runtime or design time related? In design time Visual Studio should handle it automatically if its a public property. In runtime you will have to store the bitmap yourself. You could either save the bitmap as a file (image.Save()) or serialize it like Visual Studio does it. For this have a look at the System.Runtime.Serialization namespace.
-
Is your problem runtime or design time related? In design time Visual Studio should handle it automatically if its a public property. In runtime you will have to store the bitmap yourself. You could either save the bitmap as a file (image.Save()) or serialize it like Visual Studio does it. For this have a look at the System.Runtime.Serialization namespace.
-
the problem is in design. if i use the panel object and i load a bitmap it is placed in resource project embedded file. How can i do the same for my object?
Should be working automatically. Here is a small sample:
public class MyControl : UserControl
{
private Image _image;
public Image Image
{
get { return _image; }
set { _image = value; }
}
}Setting the Image property with the designer will automatically put the image into the resource of the form.
-
Should be working automatically. Here is a small sample:
public class MyControl : UserControl
{
private Image _image;
public Image Image
{
get { return _image; }
set { _image = value; }
}
}Setting the Image property with the designer will automatically put the image into the resource of the form.