public MediaRenditionInfo Scale(double scale) { var a = MediaTransformation.Parse(Path); var b = new MediaTransformation(a.Source); foreach (var transform in a.GetTransforms()) { switch (transform) { case ResizeTransform resize: b.Apply(resize * scale); break; case CropTransform crop: b.Apply(crop.Scale(scale)); break; default: b.Apply(transform); break; } } return(new MediaRenditionInfo( host: host, sourcePath: b.Source.Key, transformPath: b.GetFullName(), width: b.Width, height: b.Height, seperator: seperator, signer: signer )); }
public MediaRenditionInfo Crop(Rectangle rect) { var transformation = MediaTransformation.Parse(Path); transformation.Crop(rect); return(new MediaRenditionInfo(host, transformation, seperator, signer)); }