/** * Function to resize an image **/ function resizeImage (id, ReqWidth, ReqHeight) { id.scaleX = 1; id.scaleY = 1; var OriginalW:Number = id.width; var OriginalH:Number = id.height; var new_width:Number = 0; var new_height:Number = 0; if (OriginalW<=ReqWidth && OriginalH<=ReqHeight) { new_width = OriginalW; new_height = OriginalH; } else { if (OriginalW>ReqWidth) { new_width = ReqWidth; new_height = Math.floor(OriginalH * (ReqWidth / OriginalW));// 149*(119.30/149) = 83.51 if (new_height > ReqHeight) { new_width = Math.floor(new_width*(ReqHeight/new_height)); new_heigh...
Possible solutions of Impossible problem. Out-of-the-box Ideas. Amazing notes. Unbelievable facts. Simple & easy to follow tips and procedures.