is it possible to open a dialogbox to choose an image file

Stimulsoft Reports.NET discussion
Post Reply
alepage
Posts: 56
Joined: Mon Jan 19, 2009 7:02 am
Location: France

is it possible to open a dialogbox to choose an image file

Post by alepage »

Hi,

Is it possible by an event to present a form that ask the end user to choose an image file ?

My second thinking is this one. It is possible to present a image on a form, and to choose an image with the "image" property. Is it possible to show the same dialogbox by an event ?

Thanks in advance.
Arnaud
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: is it possible to open a dialogbox to choose an image fi

Post by Alex K. »

Hello,

You can use the following code:

Code: Select all

OpenFileDialog openFileDialog1 = new OpenFileDialog();
if(openFileDialog1.ShowDialog() == DialogResult.OK)
{
	Image1.Image = Image.FromFile(openFileDialog1.FileName);
}
this.Render();
Thank you.
Attachments
ReportSample.mrt
(5.23 KiB) Downloaded 322 times
alepage
Posts: 56
Joined: Mon Jan 19, 2009 7:02 am
Location: France

Re: is it possible to open a dialogbox to choose an image fi

Post by alepage »

Hi Alex,

Happy New Year to the support team of Stimulsoft !

Thanks for your solution. It works very well !
Arnaud
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: is it possible to open a dialogbox to choose an image fi

Post by Alex K. »

Hello

We are always glad to help you!
Please let us know if you need any additional help.

Thank you.
Post Reply