in Tools/Cam360/MainPage.xaml.cs [825:848]
private string GetAspectRatio(uint width, uint height)
{
double value = width / (double)height;
const double tolerance = 0.015;
if (Math.Abs(1 - value / (16 / 9.0)) <= tolerance)
{
return "16:9";
}
if (Math.Abs(1 - value / (4 / 3.0)) <= tolerance)
{
return "4:3";
}
if (Math.Abs(1 - value / (5 / 3.0)) <= tolerance)
{
return "5:3";
}
if (Math.Abs(1 - value) <= tolerance)
{
return "1:1";
}
uint gcd = GCD(width, height);
return string.Format("{0}:{1}", width / gcd, height / gcd);
}