Tools.cs

(开头部分) 5KB

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

using System;
using System.Collections.Generic;
using System.Text;
using System.IO;
using System.Drawing;
// 下载于www.51aspx.com
namespace WindowsFormsApplication1
{
    public class Tools
    {

        /// <summary>
        /// 
        /// </summary>
        /// <param name="targetPath"></param>
        /// <param name="savePath"></param>
        /// <param name="w"></param>
        /// <param name="h"></param>
        /// <returns></returns>
        public bool ShengCheng(string targetPath, string savePath,int w,int h)
        {

            try
            {
                string[] pics = Directory.GetFiles(targetPath, "*.jpg");
                foreach (string s in pics)
                {
                    if (!shengcheng(s, savePath, w, h))
                        continue;
                }
                return true;
            }
            catch { return false; }
        }


        /// <summary>
        /// 
        /// </summary>
        /// <param name="targetPath"></param>
        /// <param name="savePath"></param>
        /// <param name="sort">1:百分比,2:指定高,3:指定宽 ,4:指定高宽</param>
        /// <param name="w"></param>
        /// <param name="h"></param>
        /// <returns></returns>
        public bool ShengCheng(string targetPath, string savePath, int sort, int w, int h=0)
        {
            Image image = null;
            try
            {
                string[] pics = Directory.GetFiles(targetPath, "*.jpg");
                foreach (string s in pics)
                {
                    int x, y;
                    image = Image.FromFile(s);
                    if (sort == 1)
                    {
                        x = image.Size.Width * w / 100;
                        y = image.Size.Height * w / 100;
                    }
后面还有 98 行代码,解锁后查看完整代码

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

AI 解读 AI

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

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