コード例 #1
0
        private void PicturCol_Click(object sender, EventArgs e)
        {
            ModPichers newsender = (ModPichers)sender;

            PictureMain.Image = newsender.Image;
            newsender.Image   = new Bitmap(PictureMain.Image);
            ActualName        = newsender.Name;
            if (newsender.origin != null)
            {
                PictureMain.Image = newsender.origin;
            }
            newsender.Focus();
        }
コード例 #2
0
 private void button1_Click(object sender, EventArgs e)
 {
     if (PathSave != "")
     {
         for (int i = 0; i < panel1.Controls.Count; i++)
         {
             ModPichers box = (ModPichers)panel1.Controls[i];
             Graphics   g   = Graphics.FromImage(box.Image);
             g.DrawString(textcopyright, new Font("Arial", 100), new SolidBrush(Color.Red), new Point(0, box.Image.Height - box.Image.Height / 5));
             g.DrawImage(new Bitmap("prin.png"), box.Image.Width - ((box.Image.Width / 2) + 720), 0, 1280, 720); //логотип
             g.Dispose();
             box.Image.Save(PathSave + @"\Картинка" + i + ".png");
         }
         MessageBox.Show("Все картинки обрвботвны и добавлены по указаному пути");
     }
     else
     {
         MessageBox.Show("Введите путь сохранения");
     }
 }
コード例 #3
0
        private void graf(Image image)
        {
            bool flag = true;

            Control[] mass = panel1.Controls.Find(ActualName, flag);
            if (mass != null)
            {
                ModPichers box = (ModPichers)mass[0];
                Graphics   g   = Graphics.FromImage(box.Image);
                g.DrawImage(new Bitmap("voskl.png"), 0, 0, 142 * 3, 119 * 3); //логотип
                box.Image = box.Image;
                dataGridView1.Rows.Add();
                dataGridView1.Rows[dataGridView1.Rows.Count - 1].Cells[3].Value = textcopyright;
                dataGridView1.Rows[dataGridView1.Rows.Count - 1].Cells[1].Value = box.Width;
                dataGridView1.Rows[dataGridView1.Rows.Count - 1].Cells[2].Value = box.Height;
                dataGridView1.Rows[dataGridView1.Rows.Count - 1].Cells[0].Value = box.file;

                box.origin = image;
            }
        }
コード例 #4
0
        private void OpenDirectoryToolStripMenuItem_Click(object sender, EventArgs e)
        {
            number = 0;
            col    = 0;
            panel1.Controls.Clear();
            dataGridView1.Rows.Clear();
            FolderBrowserDialog dialog = new FolderBrowserDialog();

            dialog.ShowDialog();
            if (dialog.SelectedPath != "")
            {
                string[] second = Directory.GetFiles(dialog.SelectedPath);
                for (int i = 0; i < second.Length; i++)
                {
                    if (second[i].Contains(".jpg") == true)
                    {
                        ModPichers box = new ModPichers();
                        box.Parent          = panel1;
                        box.Location        = new System.Drawing.Point(0, 17 + col);
                        box.Name            = "pictureBox" + number;
                        box.Size            = new System.Drawing.Size(250, 150);
                        box.TabIndex        = 0;
                        box.TabStop         = false;
                        box.SizeMode        = PictureBoxSizeMode.Zoom;
                        box.Image           = new Bitmap(second[i]);
                        box.PreviewKeyDown += new System.Windows.Forms.PreviewKeyDownEventHandler(this.Pictur_PreviewKeyDown);
                        box.Width           = Convert.ToString(box.Image.Width);
                        box.Height          = Convert.ToString(box.Image.Height);
                        box.file            = second[i];
                        box.Click          += new System.EventHandler(this.PicturCol_Click);
                        col += 140;
                        number++;
                    }
                }
            }
        }