示例#1
0
 public static string Decompress(string fileIn, string fileOut, string mode)
 {
     if (BasicIO.WriteStreamToFile(fileOut, Decompress(BasicIO.ReadStreamFromFile(fileIn), mode)))
     {
         return("UnCompressed Successfully!");
     }
     else
     {
         return("Operation Interruppted!");
     }
 }
示例#2
0
 public static string GenWatermark(string fileIn, string fileOut, string copyright)
 {
     if (BasicIO.WriteStreamToFile(fileOut, GenWatermark(BasicIO.ReadStreamFromFile(fileIn), GetImageFormat(BasicIO.ExtractExt(fileOut)), copyright)))
     {
         return("Watermarked Successfully!");
     }
     else
     {
         return("Operation Interruppted!");
     }
 }
示例#3
0
 public static string GenThumb(string fileIn, string fileOut, string width, string height)
 {
     if (BasicIO.WriteStreamToFile(fileOut, GenThumb(BasicIO.ReadStreamFromFile(fileIn), GetImageFormat(BasicIO.ExtractExt(fileOut)), width, height)))
     {
         return("Manipulated Successfully");
     }
     else
     {
         return("Operation Interruppted!");
     }
 }
示例#4
0
        public static string Compress(string fileIn, string fileOut, string mode)
        {
            if (BasicIO.WriteStreamToFile(fileOut, Compress(BasicIO.ReadStreamFromFile(fileIn), mode)))
            {
                int   sSize = BasicIO.GetFileSize(fileIn);
                int   tSize = BasicIO.GetFileSize(fileOut);
                float ratio = ((sSize - tSize) / (float)sSize) * 100;

                return(string.Format("Compressed Successfully! Ratio: {0}%", ratio.ToString().Substring(0, ratio.ToString().LastIndexOf(".") + 3)));
            }
            else
            {
                return("Operation Interruppted!");
            }
        }