コード例 #1
0
 public Dar(ulong x, ulong y)
 {
     ar     = (decimal)x / (decimal)y;
     this.x = x;
     this.y = y;
     RatioUtils.reduce(ref this.x, ref this.y);
 }
コード例 #2
0
 public Dar(decimal?dar, ulong width, ulong height)
 {
     ar = -1;
     if (dar.HasValue)
     {
         ar = dar.Value;
     }
     else
     {
         ar = (decimal)width / (decimal)height;
     }
     this.x = width;
     this.y = height;
     RatioUtils.reduce(ref this.x, ref this.y);
 }
コード例 #3
0
 public Dar(int x, int y, ulong width, ulong height)
 {
     ar = -1;
     if (x > 0 && y > 0)
     {
         ar     = (decimal)x / (decimal)y;
         this.x = (ulong)x;
         this.y = (ulong)y;
     }
     else
     {
         ar     = (decimal)width / (decimal)height;
         this.x = width;
         this.y = height;
     }
     RatioUtils.reduce(ref this.x, ref this.y);
 }
コード例 #4
0
 public Dar(decimal dar)
 {
     ar = dar;
     RatioUtils.approximate(ar, out x, out y);
 }