In This Sample you need maximum width of the object1024 and maximum height 750; You need to pass the width and height of object (dblWidth AND dblHeight) and you willget the scaled height and width of the object.

Sample Code:Double dblWRatio =0

//Actual Width of the ObjectDouble dblWidth =1280;//Actual Height of the ObjectDouble dblHeight =960

//Maximum width of the ObjectDouble PalyerWidth =1024;//Maximum height of the ObjectDouble PlayerHeight =750;