Hi and sorry for disturbing,
what i want here is to get the screen size in any possible way to check if the TV is HDTV or a normal TV... so if you can help me out on this one i would really appreciate it.
i have the the jscript class but i don't know how to convert it to C# in order to include it in my application... i'll post the class below. and if there is any other way to get the screen height and width using c#, it would be really helpfull.
var ASResolution;//ASResolutionObject instance
//ASResolutionObject class
function ASResolutionObject()
{
var ScreenWidth;
var ScreenHeight;
var IsHDResolution;
}
//Neccessary to initialize ASResolution Object
function initASResolution()
{
ASResolution = new ASResolutionObject();
ASResolution.ScreenWidth = document.body.clientWidth;
ASResolution.ScreenHeight = document.body.clientHeight;
ASResolution.IsHDResolution = isHDResolution();
}
//Returns TRUE if screen-resolution is HD. Returns FALSE otherwise.
function isHDResolution()
{
var stDefResolutions;
//get current screen width and height
var scrWidth = screen.width; //document.body.clientWidth;
var scrHeight = screen.height; //document.body.clientHeight;
var scrRatio = scrWidth / scrHeight ;
var hdRatioMax = 1.78
var hdRationMin = 1.65
//checking width
if( (scrRatio >=hdRationMin ) && (scrRatio <= hdRatioMax ))
{
return true;
}
return false;
}
Thank You,
Souhail J. Jabbour
Souhail J. Jabbour (Activemania)