frmWater.cs

(开头部分) 4KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Drawing.Imaging;
namespace PictureManage
{
    public partial class frmWater : Form
    {
        public frmWater()
        {
            InitializeComponent();
        }
        public Image ig;
        public string FPath;
        FontStyle Fstyle = FontStyle.Regular;
        float Fsize = 18;
        Color Fcolor = System.Drawing.Color.Yellow;
        FontFamily a = FontFamily.GenericMonospace;
        int Fwidth;
        int Fheight;

        public void makeWatermark(int x,int y,string txt)
        {
            System.Drawing.Image image = Image.FromFile(FPath);
            System.Drawing.Graphics e = System.Drawing.Graphics.FromImage(image);
            System.Drawing.Font f = new System.Drawing.Font(a, Fsize,Fstyle);
            System.Drawing.Brush b = new System.Drawing.SolidBrush(Fcolor);
            e.DrawString(txt, f, b, x, y);
            SizeF XMaxSize = e.MeasureString(txt,f);

            Fwidth = (int)XMaxSize.Width;
            Fheight = (int)XMaxSize.Height;

            e.Dispose();
            pictureBox1.Image = image;
        }
        private void frmWater_Load(object sender, EventArgs e)
        {
            pictureBox1.Image = ig;
        }

        private void button1_Click_1(object sender, EventArgs e)
        {
            pictureBox1.Image = ig;
            if (txtChar.Text.Trim() != "")
            {
                if (radioButton1.Checked)
                {
                    int x = 10, y = 10;
                    makeWatermark(x, y, txtChar.Text.Trim());
                }
                if (radioButton2.Checked)
                {
                    int x1 = 10, y1 = ig.Height - Fheight;
                    makeWatermark(x1, y1, txtChar.Text.Trim());
                }
后面还有 65 行代码,购买后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。