Picture show in ListBox from HMI ftp
Posted: Thu Nov 07, 2013 3:02 am
Hello everyone,
Deals with one specific application. I have a 5 camera Cognex In-Sight and 5xHMI T15B. Driver on Cognex works great. Now cameras stores images in a ftp HMI. Now I need to be able to select an image and display it on HMI.
My idea was that i choose a picture from ListBox. Click on Button and the picture
which I have chosen appear to me in PictureBox.
Problem is That I Can not Fill the list box with the names of the current images stored in Project Files and then to show in PictureBox
I try>
Do you have any ide how to do it ??
JohnCZ
Deals with one specific application. I have a 5 camera Cognex In-Sight and 5xHMI T15B. Driver on Cognex works great. Now cameras stores images in a ftp HMI. Now I need to be able to select an image and display it on HMI.
My idea was that i choose a picture from ListBox. Click on Button and the picture
which I have chosen appear to me in PictureBox.
Problem is That I Can not Fill the list box with the names of the current images stored in Project Files and then to show in PictureBox
I try>
Code: Select all
DirectoryInfo dinfo = new DirectoryInfo(@"\FlashDrive\Project\Project Files")
FileInfo[] Files = dinfo.GetFiles("*.jpg");
foreach( FileInfo file in Files )
{
ListBox2.Items.Add(file.Name);
}
JohnCZ