We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Image to ImageExt

Thread ID:

Created:

Updated:

Platform:

Replies:

63606 Jul 5,2007 08:20 PM UTC Jul 11,2007 12:31 PM UTC WinForms 3
loading
Tags: Tools
Russell Coombes
Asked On July 5, 2007 08:20 PM UTC

Hi,

I am using a BarItem within an XPToolBar. I need users of my UserControl to provide a System.Drawing.Image. However, when creating the BarItem, the Image property expects an ImageExt and not a System.Drawing.Image.

Can you please explain how I can convert an Image to an ImageExt?

Thanks!

Regards,
Russell

Rashidha F [Syncfusion]
Replied On July 10, 2007 12:03 PM UTC

Hi Russell,

Thanks for using Syncfusion Products.

The following code snippet which illustrates how to set an System.Drawing.Image to ImageExt.

string url= "Specify the path of the Image";
System.Drawing.Image image=new Bitmap(url);
this.xpToolBar1.Bar.Items[0].Image = new Bitmap(image);

Please let me know if this helps.

Thanks and Regards,
Rashidha.

Russell Coombes
Replied On July 10, 2007 02:06 PM UTC

Hi Rashidha,

Thanks for your reply.

I am given the image as a parameter to a method, and it is within the method that I need to convert an image to an imageExt. So I'm afraid your example will not work for me.

The Image object is given to me by retrieving it from the indexer on an ImageList. I would be grateful if your next answer would consider this scenario.

Regards,
Russell

>Hi Russell,

Thanks for using Syncfusion Products.

The following code snippet which illustrates how to set an System.Drawing.Image to ImageExt.

string url= "Specify the path of the Image";
System.Drawing.Image image=new Bitmap(url);
this.xpToolBar1.Bar.Items[0].Image = new Bitmap(image);

Please let me know if this helps.

Thanks and Regards,
Rashidha.

Rashidha F [Syncfusion]
Replied On July 11, 2007 12:31 PM UTC

Hi Russell,

Thanks for the update.

Please refer the following code snippet which will helps to achieve your requirement in your application.

private void Form1_Load(object sender, EventArgs e)
{
this.xpToolBar1.Bar.Items[0].Image = Images(imageList1.Images[0]);
}

private ImageExt Images(System.Drawing.Image img)
{
ImageExt x = (ImageExt)(img);
return x;
}

Please refer the attached sample and let me know if this helps.

http://websamples.syncfusion.com/samples/Tools.Windows/F63606_1/main.htm

Thanks and Regards,
Rashidha.

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;