Thank you for visiting the BlackBerry Support Community Forums.
BlackBerry will be closing the BlackBerry Support Community Forums Device Forums on April 1st (Developers, see below)
BlackBerry remains committed to providing excellent customer support to our customers. We are delighted to direct you to the CrackBerry Forums, a well-established and thorough support channel, for continued BlackBerry support. Please visit http://forums.crackberry.com or http://crackberry.com/ask. You can also continue to visit BlackBerry Support or the BlackBerry Knowledge Base for official support options available for your BlackBerry Smartphone.
"When we launched CrackBerry.com 10 years ago, we set out to make it a fun and useful destination where BlackBerry Smartphone owners could share their excitement and learn to unleash the full potential of their BlackBerry. A decade later, the CrackBerry community is as active and passionate as ever and I know our knowledgeable members and volunteers will be excited to welcome and assist more BlackBerry owners with their questions."
- Kevin Michaluk, Founder, CrackBerry.com
Developers, for more information about the BlackBerry Developer Community please review Join the Conversation on the BlackBerry Developer Community Forums found on Inside BlackBerry.
02-12-2011 10:58 AM
Hello, I have an Image object and have set its content using setImage(). When I resize the image by doing Image.width = 500 (for example) the actual image object will resize but the content inside of it will remain the same. Calling setImage everytime I resize the image isn't very efficient as it isn't an instant processing calling setImage. So how would I accomplish resizing the image content every time the image is resized?
02-12-2011 12:05 PM
02-12-2011 02:38 PM
scaleX and scaleY resize the Image but do not resize the BitmapData within it. Is there a way to change the containment of the bitmap data? How would I access the bitmap data in the first place since there is no option like Image.bitmapdata?
02-12-2011 04:21 PM
Depending on what you're trying to accomplish, you may be going about it wrong. Actually resizing the data repeatedly would be Very Bad. You'd get all kinds of nasty artifacts building up from the repeated transformation. Generally you would want to do something like scaling a copy of the original, and only if and when it was time to write out the final modified data (assuming you want to do that) would you actually apply a resize operation to modify the data, once.
None of that helps you find out how to get to the BitmapData from an Image, of course... but for that I'd simply recommend you retrieve BitmapData in the first place, and use that to do the setImage(). Keep a copy of it around for later, and you're all set.
02-21-2011 01:34 PM - edited 02-21-2011 01:49 PM
I figured out how to get the Bitmap but how would I use scaleX and scaleY to scale the image according to its containers (The actual image object) width & height?
Also is there a more efficient method since I will be using this a lot so that the user can resize an image with his/her mouse?
I have resolved the scale issue by rereading another thread I started.
My question about the efficiency still stands though.