示例#1
0
        private void InitExamples()
        {
            textW = new TextW();
            imgW  = new ImgW();
            mouse = new Mouse();

            soloImg = new SoloImg();
            dirImg  = new DirImg();

            extensions = new Extension(".jpg", ".png", ".jpeg", ".bmp");
        }
示例#2
0
        public void IfWaterText(Graphics g, SoloImg soloImg, TextW textW)
        {
            Bitmap b = new Bitmap(soloImg.Image.Width, soloImg.Image.Height);

            using (g = Graphics.FromImage(b))
            {
                g.DrawImage(soloImg.Image, 0, 0, soloImg.Image.Width, soloImg.Image.Height);
                g.DrawString(textW.TextWatermark, new Font("Times New Roman", 25, FontStyle.Bold), Brushes.Black, OriginCoordinate.X, OriginCoordinate.Y);
            }
            b.Save("Copy_TextW_" + Counter.Count.ToString() + ".bmp");
        }
示例#3
0
 public void MoveTextDraw(Graphics g, TextW textW, Mouse mouse)
 {
     g.DrawString(textW.TextWatermark, new Font("Times New Roman", 15, FontStyle.Bold), Brushes.Black, mouse.X, mouse.Y);
     textW.IsMoveText = false;
 }
示例#4
0
 public void IfTextWatermark(Graphics g, TextW textW, Mouse mouse, ToolStripMenuItem saveBtn)
 {
     g.DrawString(textW.TextWatermark, new Font("Times New Roman", 15, FontStyle.Bold), Brushes.Black, mouse.X, mouse.Y);
     saveBtn.Enabled       = true;
     textW.IsTextWatermark = false;
 }
示例#5
0
        public void IfDirText(Graphics g, DirImg dirImg, Mouse mouse, PictureBox pictureBox1, TextW textW)
        {
            foreach (Image image in dirImg.Images)
            {
                Counter.Count++;
                OriginCoordinate.X = (image.Width * mouse.X) / pictureBox1.Width;
                OriginCoordinate.Y = (image.Height * mouse.Y) / pictureBox1.Height;

                Bitmap b = new Bitmap(image.Width, image.Height);
                using (g = Graphics.FromImage(b))
                {
                    g.DrawImage(image, 0, 0, image.Width, image.Height);
                    g.DrawString(textW.TextWatermark, new Font("Times New Roman", 25, FontStyle.Bold), Brushes.Black, OriginCoordinate.X, OriginCoordinate.Y);
                }
                b.Save(@"pictures with a watermark/Copy_" + Counter.Count.ToString() + ".bmp");
            }
        }