コード例 #1
0
ファイル: LessGeometry.cs プロジェクト: jondot/nmagick
 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();
     }
 }
コード例 #2
0
ファイル: Geometry.cs プロジェクト: jondot/nmagick
 public virtual double calculateWidth(MagickImage image)
 {
     double newWidth = Math.Round(this.getHeight() * image.getWidth() / image.getHeight());
     return Math.Min(newWidth, this.getWidth());
 }
コード例 #3
0
ファイル: PercentGeometry.cs プロジェクト: jondot/nmagick
 public override double calculateHeight(MagickImage image)
 {
     return image.getHeight() * this.getHeight() / 100;
 }
コード例 #4
0
ファイル: Gravity.cs プロジェクト: jondot/nmagick
 public override int getY(MagickImage img, int consideredHeight)
 {
     return (int)(img.getHeight() - consideredHeight) / 2;
 }
コード例 #5
0
ファイル: Gravity.cs プロジェクト: jondot/nmagick
 public override int getY(MagickImage img)
 {
     return (int)img.getHeight() / 2;
 }
コード例 #6
0
ファイル: AreaGeometry.cs プロジェクト: jondot/nmagick
 public override double calculateWidth(MagickImage image)
 {
     return Math.Round(Math.Sqrt(this.getWidth() * image.getWidth() / image.getHeight()));
 }