public GetAndCrop ( string relativeFilePath, int targetWidth, int targetHeight, double widthRatio, double heightRatio, double leftRatio, double topRatio ) : |
||
relativeFilePath | string | e.g. asdf/asdf.jpg |
targetWidth | int | |
targetHeight | int | |
widthRatio | double | |
heightRatio | double | |
leftRatio | double | |
topRatio | double | |
return |
public void ProcessRequest(HttpContext context) { this.context = context; var service = new ImageService(context); setContentType(); setClientCaching(); switch (imageMod) { case ImageMod.Raw: context.Response.BinaryWrite(string.IsNullOrEmpty(QueryString["MaxSize"]) ? service.Get(fileName, maxWidth, maxHeight, outputFormat) : service.Get(fileName, maxSize, outputFormat)); break; case ImageMod.SpecifiedCrop: context.Response.BinaryWrite(service.GetAndCrop(fileName, width, height, widthRatio, heightRatio, leftRatio, topRatio, outputFormat)); break; default: context.Response.BinaryWrite(cacheEnabled ? service.GetCached(fileName, width, height, imageMod, hexBackGroundColour, anchor, outputFormat) : service.Get(fileName, width, height, imageMod, hexBackGroundColour, anchor, outputFormat)); break; } }
public void ProcessRequest(HttpContext context) { this.context = context; var service = new ImageService(context); setContentType(); setClientCaching(); switch (imageMod) { case ImageMod.Raw: context.Response.BinaryWrite(string.IsNullOrEmpty(QueryString["MaxSize"]) ? service.Get(fileName, maxWidth, maxHeight, outputFormat) : service.Get(fileName, maxSize, outputFormat)); break; case ImageMod.SpecifiedCrop: context.Response.BinaryWrite(service.GetAndCrop(fileName, width, height, widthRatio, heightRatio, leftRatio, topRatio, outputFormat)); break; default: context.Response.BinaryWrite(cacheEnabled ? service.GetCached(fileName, width, height, imageMod, hexBackGroundColour, anchor, outputFormat) : service.Get(fileName, width, height, imageMod, hexBackGroundColour, anchor, outputFormat)); break; } }