コード例 #1
0
 /// <summary>
 ///
 /// </summary>
 /// <returns></returns>
 public static IImgLim Instance()
 {
     if (_instance == null)
     {
         lock (Lock)
         {
             if (_instance == null)
             {
                 _instance = new ImgLim();
             }
         }
     }
     return(_instance);
 }
コード例 #2
0
        public void Setup()
        {
            _imagesLim = new ImgLim();
            string path = AppDomain.CurrentDomain.BaseDirectory;

            _filePath = $"{path}Resources\\";

            //测试图片下载
            //http://7xkv1q.com1.z0.glb.clouddn.com/grape.jpg?imageslim

            //默认文件在《Resources》《imageslim》文件中,请设置属性(如果较新则复制)

            var name = "grape-imageslim-" + Guid.NewGuid().ToString("N");

            _outputFilePath = $"{_filePath}output\\{name}.jpg";
        }