string[] Files;
var root = Application.ExecutablePath;
var temp = root.Split('\\');
temp[temp.Length - 1] = "";
temp[temp.Length - 2] = "Images";
var newpath = string.Join("\\", temp);
Files = Directory.GetFiles(newpath);
/// <summary>
/// Show the image in the PictureBox.
/// </summary>
public static void ShowImage(string path, PictureBox pct)
{
pct.ImageLocation = path;
}
/// <summary>
/// Show the next image.
/// </summary>
private void ShowNextImage()
{
ShowImage(this.Files[(++this.selected) % this.Files.Length], this.pictureBox);
}
No comments:
Post a Comment