コード例 #1
0
 private void setCoverLocal()
 {
     try
     {
         string fileName = ImageFilePath;
         if (File.Exists(fileName))
         {
             cover = ImageItem.ImageItemFromGraphicsFile(fileName);
         }
         else
         {
             fileName = ImageFilePath2;
             if (File.Exists(fileName))
             {
                 cover = ImageItem.ImageItemFromGraphicsFile(fileName);
             }
         }
     }
     catch
     {
     }
 }
コード例 #2
0
        private void loadArt()
        {
            try
            {
                string path = String.Empty;
                Track  t    = template;

                if (t != null)
                {
                    path = t.FilePath;
                }

                if (path.Length == 0 || !File.Exists(path))
                {
                    path = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);
                }
                else
                {
                    path = Path.GetDirectoryName(path);
                }

                OpenFileDialog ofd = Lib.GetOpenFileDialog(path,
                                                           true,
                                                           "Image Files (*.jpg;*.jpeg;*.gif;*.png;*.bmp;*.tif;*.tiff)|*.jpg;*.jpeg;*.gif;*.png;*.bmp;*.tif;*.tiff|All Files (*.*)|*.*",
                                                           1);

                ofd.Multiselect = false;

                if (ofd.ShowDialog(this) == DialogResult.OK)
                {
                    Image      = ImageItem.ImageItemFromGraphicsFile(ofd.FileName);
                    ImageDirty = true;
                }
            }
            catch { }
        }