byMSohm07-23-201212:25 PM - edited 08-14-201208:53 AM
This article describes different methods that can be used to load an image and give an example of when you should use them.
This should be used as much as possible, especially for dynamic content like a profile picture in a list item. Simply specify the relative path from the asset directory like this (in the example below the image is placed directly in asset folder in the BlackBerry® Native SDK project).
Synchronous loading should be used when you need the image to be fully loaded before it shows up in the UI. Background images or images used in custom controls should all load synchronously. Note that this will lock the Server thread temporarily so it’s especially important in list items to avoid this as much as possible.
All nine sliced images are Synchronously loaded. You use nine slicing when you want to stretch an image.
Load using Absolute path
It’s also possible to load an image using an absolute path. It’s not as common but when it’s used it’s usually to get the path to a shared directory like Image folder or Data. Note that this loads the image asynchronously.