I have a bitmap in as3, I want its height to be 800, I want the width to be adjusted with the correct ratio so the image doesn’t look squashed. How can I do this programatically in as3?
myImageBM.height = 800;
myImageBM.width = ??
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Try:
This is assuming you are just displaying it. For further processing of the image I would apply a matrix to it’s bitmap data.
Of course if you are dealing with both portrait and landscape images it would be slightly more complicated, but the general idea is you set either height or width, then use the bitmap’s scale properties to adjust the other dimension.