public override double calculateWidth(MagickImage image) { if (image.getWidth() < this.getWidth() && image.getHeight() < this.getHeight()) { return new Geometry(this.getWidth(), this.getHeight(), this.getX(), this.getY()).calculateWidth(image); } else { return image.getWidth(); } }
public virtual double calculateWidth(MagickImage image) { double newWidth = Math.Round(this.getHeight() * image.getWidth() / image.getHeight()); return Math.Min(newWidth, this.getWidth()); }
public override double calculateWidth(MagickImage image) { return image.getWidth() * this.getWidth() / 100; }
public override int getX(MagickImage img, int consideredWidth) { return (int)(img.getWidth() - consideredWidth) / 2; }
public override int getX(MagickImage img) { return (int)img.getWidth() / 2; }
public override double calculateWidth(MagickImage image) { return Math.Round(Math.Sqrt(this.getWidth() * image.getWidth() / image.getHeight())); }