In Image
's asdoc, we can see :
Flex also includes the BitmapImage class. This class is used for embedding images into skins and FXG components
but we can also use Image
in skins and use @Embed
with Image
...
Therefore, where and when should I use Image
or BitmapImage
please ?
Image
is a skinnable class that wraps BitmapImage
. As such BitmapImage is more lightweight, but Image has more features. So the question when to use which boils down to this:
if the features of BitmapImage suffice, use that; otherwise use Image. Especially in mobile environments try to favor the use of BitmapImage.
Now what features does Image add exactly?
- Image extends SkinnableComponent: this means you can assign your images a skin with a border or a dropshadow or whatever you like consistently throughout your application.
- It also provides a progress indicator which can be displayed while the image is loading.
- One more feature is the possibility to queue the loading of multiple images.