public bool ProcessImage(string sourceFile, string destinationFile, int timeout, int width, int height, ContentAwareResizeFilterConvolutionType convolutionType) { string runArguments = " -I \"" + sourceFile + "\" -O \"" + destinationFile + "\" -T 1 -C " + convolutionType; runArguments += " -X " + width; runArguments += " -Y " + height; if (!File.Exists(CairPath)) throw new DynamicImageException("Could not find CAIR.exe. This file needs to be in ~/App_Data/DynamicImage."); ProcessStartInfo info = new ProcessStartInfo(CairPath, runArguments) { UseShellExecute = false, RedirectStandardInput = true, RedirectStandardError = true, RedirectStandardOutput = true, CreateNoWindow = true }; using (Process scr = Process.Start(info)) { bool result = scr.WaitForExit(timeout); if (!result) scr.Kill(); return result; } }
public bool ProcessImage(string sourceFile, string destinationFile, int timeout, int width, int height, ContentAwareResizeFilterConvolutionType convolutionType) { string runArguments = " -I \"" + sourceFile + "\" -O \"" + destinationFile + "\" -T 1 -C " + convolutionType; runArguments += " -X " + width; runArguments += " -Y " + height; var info = new ProcessStartInfo(_cairPath, runArguments) { UseShellExecute = false, RedirectStandardInput = true, RedirectStandardError = true, RedirectStandardOutput = true, CreateNoWindow = true }; using (Process scr = Process.Start(info)) { bool result = scr.WaitForExit(timeout); if (!result) { scr.Kill(); } return(result); } }
public bool ProcessImage(string sourceFile, string destinationFile, int timeout, int width, int height, ContentAwareResizeFilterConvolutionType convolutionType) { string runArguments = " -I \"" + sourceFile + "\" -O \"" + destinationFile + "\" -T 1 -C " + convolutionType; runArguments += " -X " + width; runArguments += " -Y " + height; var info = new ProcessStartInfo(_cairPath, runArguments) { UseShellExecute = false, RedirectStandardInput = true, RedirectStandardError = true, RedirectStandardOutput = true, CreateNoWindow = true }; using (Process scr = Process.Start(info)) { bool result = scr.WaitForExit(timeout); if (!result) scr.Kill(); return result; } }
public ContentAwareResizeFilterBuilder ConvolutionType(ContentAwareResizeFilterConvolutionType convolutionType) { Filter.ConvolutionType = convolutionType; return(this); }