• 大小: 45.94MB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2023-08-08
  • 语言: C#
  • 标签: 图片水印  

资源简介

利用bitmap和Graphics 实现简单的给图片添加水印小demo,可选择水印文字,颜色,位置等。

资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace GraphicDemo
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
           
        }

        private void Form1_Load(object sender EventArgs e)
        {
        }

        private void paintCircular()
        {
        
            Graphics g = this.CreateGraphics();
            Pen p = new Pen(Color.Orange3);
            g.DrawEllipse(p 190 130 100 100);
            Brush brush = new SolidBrush(Color.Beige);
            g.FillEllipse(brush 190 130 100 100);
            g.DrawLine(p new Point(190 180) new Point(290 180));
            Rectangle r = new Rectangle(190 130 100 100);
            g.DrawRectangle(p r);
            g.DrawLine(p new Point(240 130) new Point(240 230));
            g.DrawLine(p new Point(190 130) new Point(290 230));
            g.DrawLine(p new Point(290 130) new Point(190 230));
        }
        private void Form1_Paint(object sender PaintEventArgs e)
        {
            paintCircular();
        }

       



        

    }
}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件      16896  2019-03-27 15:20  GraphicDemo\GraphicDemo\bin\Debug\GraphicDemo.exe

     文件      38400  2019-03-27 15:20  GraphicDemo\GraphicDemo\bin\Debug\GraphicDemo.pdb

     文件      11600  2019-03-27 15:20  GraphicDemo\GraphicDemo\bin\Debug\GraphicDemo.vshost.exe

     文件       1314  2019-03-27 10:33  GraphicDemo\GraphicDemo\Form1.cs

     文件       1557  2019-03-27 10:16  GraphicDemo\GraphicDemo\Form1.Designer.cs

     文件       5817  2019-03-27 10:16  GraphicDemo\GraphicDemo\Form1.resx

     文件       4268  2019-03-27 15:20  GraphicDemo\GraphicDemo\Frm2.cs

     文件      14710  2019-03-27 15:20  GraphicDemo\GraphicDemo\Frm2.Designer.cs

     文件       6190  2019-03-27 15:20  GraphicDemo\GraphicDemo\Frm2.resx

     文件       4020  2019-03-27 11:49  GraphicDemo\GraphicDemo\GraphicDemo.csproj

     文件       2756  2019-03-27 14:58  GraphicDemo\GraphicDemo\ImgHelper.cs

     文件       6290  2019-03-27 15:20  GraphicDemo\GraphicDemo\obj\x86\Debug\DesignTimeResolveAssemblyReferencesInput.cache

     文件        588  2019-03-27 15:20  GraphicDemo\GraphicDemo\obj\x86\Debug\GraphicDemo.csproj.FileListAbsolute.txt

     文件       1150  2019-03-27 15:20  GraphicDemo\GraphicDemo\obj\x86\Debug\GraphicDemo.csproj.GenerateResource.Cache

     文件      16896  2019-03-27 15:20  GraphicDemo\GraphicDemo\obj\x86\Debug\GraphicDemo.exe

     文件        180  2019-03-27 11:49  GraphicDemo\GraphicDemo\obj\x86\Debug\GraphicDemo.Form1.resources

     文件        180  2019-03-27 15:20  GraphicDemo\GraphicDemo\obj\x86\Debug\GraphicDemo.Frm2.resources

     文件      38400  2019-03-27 15:20  GraphicDemo\GraphicDemo\obj\x86\Debug\GraphicDemo.pdb

     文件        180  2019-03-27 11:49  GraphicDemo\GraphicDemo\obj\x86\Debug\GraphicDemo.Properties.Resources.resources

     文件        491  2019-03-27 11:46  GraphicDemo\GraphicDemo\Program.cs

     文件       1372  2019-03-27 09:18  GraphicDemo\GraphicDemo\Properties\AssemblyInfo.cs

     文件       2874  2019-03-27 09:18  GraphicDemo\GraphicDemo\Properties\Resources.Designer.cs

     文件       5612  2019-03-27 09:18  GraphicDemo\GraphicDemo\Properties\Resources.resx

     文件       1098  2019-03-27 09:18  GraphicDemo\GraphicDemo\Properties\Settings.Designer.cs

     文件        249  2019-03-27 09:18  GraphicDemo\GraphicDemo\Properties\Settings.settings

     文件       1168  2019-03-27 15:33  GraphicDemo\GraphicDemo.sln

    ..A..H.    123392  2019-03-27 15:33  GraphicDemo\GraphicDemo.suo

     文件    2310656  2010-05-03 22:36  GraphicDemo\watermark\Debug\DotNetFX40Client\dotNetFx40LP_Client_x86_x64zh-Hans.exe

     文件   43000680  2010-03-18 15:42  GraphicDemo\watermark\Debug\DotNetFX40Client\dotNetFx40_Client_x86_x64.exe

     文件     430592  2019-03-27 15:33  GraphicDemo\watermark\Debug\setup.exe

............此处省略20个文件信息

评论

共有 条评论