public override double calculateHeight(MagickImage image) { if (image.getWidth() < this.getWidth() && image.getHeight() < this.getHeight()) { return new Geometry(this.getWidth(), this.getHeight(), this.getX(), this.getY()).calculateHeight(image); } else { return image.getHeight(); } }
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 calculateHeight(MagickImage image) { return image.getHeight() * this.getHeight() / 100; }
public override int getY(MagickImage img, int consideredHeight) { return (int)(img.getHeight() - consideredHeight) / 2; }
public override int getY(MagickImage img) { return (int)img.getHeight() / 2; }
public override double calculateWidth(MagickImage image) { return Math.Round(Math.Sqrt(this.getWidth() * image.getWidth() / image.getHeight())); }