void pictureSearchPopup_PictureSelected(object sender, EventArgs e)
        {
            PictureSearchUserControl psp = sender as PictureSearchUserControl;

            BitmapImage bi = psp.DownloadSelectedImage();

            if (bi != null)
            {
                string filename = GetCoverFilename();

                FileStream        stream  = new FileStream(filename, FileMode.Create);
                JpegBitmapEncoder encoder = new JpegBitmapEncoder();
                encoder.QualityLevel = 30;
                encoder.Frames.Add(BitmapFrame.Create(bi));
                encoder.Save(stream);
                stream.Close();

                SetNewCoverFilename(filename);

                PictureSearchPopup popup = psp.Parent as PictureSearchPopup;
                if (popup != null)
                {
                    popup.IsOpen = false;
                }
            }
        }
示例#2
0
 public void Search(string searchText)
 {
     PictureSearchUserControl.Search(searchText);
 }