Esempio n. 1
0
        private void ShowLargeImage_Load(object sender, EventArgs e)
        {
            pictureBox1.MouseWheel   += new MouseEventHandler(pic_1_mouse_wheel);
            pictureBox1.ImageLocation = url;
            DiChuyen dc = new DiChuyen(this, pictureBox1);

            this.Width         = Screen.PrimaryScreen.Bounds.Width;
            this.Height        = Screen.PrimaryScreen.Bounds.Height;
            pictureBox1.Width  = Screen.PrimaryScreen.Bounds.Width;
            pictureBox1.Height = Screen.PrimaryScreen.Bounds.Height;
        }
Esempio n. 2
0
        private void Setting_Load(object sender, EventArgs e)
        {
            DiChuyen dc = new DiChuyen(this, panel1);

            if (!isReset)
            {
                if (File.Exists("setting.option"))
                {
                    this.DialogResult = DialogResult.OK;
                    this.Close();
                }
            }
        }
Esempio n. 3
0
        private void Form1_Load(object sender, EventArgs e)
        {
            DiChuyen runD = new DiChuyen(this, this.pictureBox1);
            Setting  set  = new Setting();

            if (set.ShowDialog() == DialogResult.OK)
            {
                if (isCheckFile())
                {
                    mediaitems = JsonConvert.DeserializeObject <List <PhotoInfor.Mediaitem> >(File.ReadAllText(PATH_DATABASE));
                    SetImageToPictureBox();
                    timer1.Start();
                }
                else
                {
                    GET(URL_IMG + PARAMESTER_GETIMAGE, () => {
                        MessageBox.Show("Đã tải thành công");
                        PhotoInfor.Mediaitem itemImage = mediaitems.ElementAt(new Random().Next(mediaitems.Count));
                        SetImage(itemImage);
                        File.WriteAllText(PATH_DATABASE, JsonConvert.SerializeObject(mediaitems));
                        SetImageToPictureBox();
                        timer1.Start();
                        String path = File.ReadAllText(PATH_SETTING_PATH);
                        playListMusic(path);
                    },
                        () => {
                        MessageBox.Show("Đã tải xong " + mediaitems.Count);
                        PhotoInfor.Mediaitem itemImage = mediaitems.ElementAt(new Random().Next(mediaitems.Count));
                        SetImage(itemImage);
                        File.WriteAllText(PATH_DATABASE, JsonConvert.SerializeObject(mediaitems));
                        SetImageToPictureBox();
                        timer1.Start();
                        String path = File.ReadAllText(PATH_SETTING_PATH);
                        playListMusic(path);
                    });
                }
            }
        }