コード例 #1
0
        public void LoadPictures()
        {
            IInputProvider iprov = Provider.Instance as IInputProvider;
            PictureList    pl    = iprov.GetPictures(new PictureSearch()
            {
                SearchProvider  = Provider,
                MaxPictureCount = 10,
                BannedURLs      = Settings.CurrentSettings.BannedImages,
                PreviewOnly     = true
            });

            foreach (Picture p in pl.Pictures)
            {
                PictureBox pb = new PictureBox();
                Image      i  = p.GetThumbnail();

                if (i == null)
                {
                    continue;
                }

                pb.Image  = i;
                pb.Width  = i.Width;
                pb.Height = i.Height;

                flowLayoutPanel1.Controls.Add(pb);
            }
        }
コード例 #2
0
        private void Form1_Load(object sender, EventArgs e)
        {
            WallbaseImageSearchSettings wiss = new WallbaseImageSearchSettings();

            wiss.SA = "toplist";


            PictureSearch ps = new PictureSearch();

            ps.SearchProvider = new ActiveProviderInfo("Wallbase")
            {
                Active = true, ProviderConfig = wiss.Save()
            };
            ps.MaxPictureCount = 100;

            string path = System.IO.Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Desktop), "TEMP");

            Directory.CreateDirectory(path);
            ps.SaveFolder = path;

            IInputProvider p = ps.SearchProvider.Instance as IInputProvider;

            pl = p.GetPictures(ps);

            Timer t = new Timer();

            t.Tick    += t_Tick;
            t.Interval = 5000;
            t.Enabled  = true;
        }
コード例 #3
0
        private void button1_Click(object sender, EventArgs e)
        {
            PictureSearch ps = new PictureSearch();

            ps.SearchProvider = new ActiveProviderInfo(providerComboBox1.SelectedItem.ToString())
            {
                Active = true, ProviderConfig = _current.SaveConfiguration()
            };
            ps.MaxPictureCount = (int)numericUpDown1.Value;

            ps.SaveFolder = txtDownloadPath.Text;

            IInputProvider p  = ps.SearchProvider.Instance as IInputProvider;
            var            pl = p.GetPictures(ps);

            PictureBatch pb = new PictureBatch();

            pb.AllPictures.Add(pl);

            DownloadManager.Current.SaveFolder = txtDownloadPath.Text;
            DownloadManager.Current.PreFetchFiles(pb);
        }