/// <summary> /// サムネイルを表示します。 /// </summary> /// <param name="folderPath">イメージファイル格納先フォルダのパスを表す文字列。</param> /// <param name="thumbSize">サムネイルのサイズを表すThumbNailSize。</param> /// <returns>サムネイルの表示結果を表すThumbNailViewStatus。</returns> private ThumbNailViewStatus showThumbNails(string folderPath, ThumbNailSize thumbSize) { try { this.Cursor = Cursors.WaitCursor; this.tnvMain.BeginUpdate(); // サムネイルを表示 ThumbNailViewStatus result = this.tnvMain.ShowThumbNail(folderPath, thumbSize); switch (result) { case ThumbNailViewStatus.ImageFolderNotExists: this.showErrorMessage(Properties.Resources.ImageSplitter_ERR_IMAGE_FOLDER_NOT_FOUND); break; default: // メニューを使用可能に this.changeMenuEnabledForThumbNailView(true); this.slbImageFolderPath.Text = folderPath; this.slbCount.Text = this.tnvMain.ThumbNailCount + Properties.Resources.ImageSplitter_INF_IMAGE_FILE_COUNT; break; } return(result); } finally { this.tnvMain.EndUpdate(); this.Cursor = Cursors.Default; } }
/// <summary> /// 指定したフォルダ内のイメージファイルをサムネイルで表示します。 /// </summary> /// <param name="imageFolderPath">サムネイル表示するファイルの格納先フォルダのパスを表す文字列。</param> /// <param name="thumbSize">サムネイルのサイズを表すThumbNailSize。</param> /// <returns>サムネイルの表示結果を表すThumbNailViewStatus列挙型の内の1つ。</returns> public ThumbNailViewStatus ShowThumbNail(string imageFolderPath, ThumbNailSize thumbSize) { if (!(System.IO.Directory.Exists(imageFolderPath))) { // 指定フォルダが存在しない return(ThumbNailViewStatus.ImageFolderNotExists); } this.imgFolderPath = imageFolderPath; this.thumbSize = thumbSize; // 対象の拡張子リストを作成 this.createExtensionList(); // サムネイルイメージを表示 this.showThumbNailImages(); return(ThumbNailViewStatus.ThumbNailLoadsFinished); }
/// <summary> /// 指定したサムネイルのサイズを保存します。 /// </summary> /// <param name="newSize">保存するサムネイルサイズを表すThumbNailSize列挙型の内の1つ。</param> private void saveThumbNailSize(ThumbNailSize newSize) { // サムネイルのサイズを保存 Properties.Settings.Default.ThumbNailImageSize = newSize; Properties.Settings.Default.Save(); }