You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@flex.apache.org by Lee Burrows <su...@leeburrows.com> on 2013/10/16 17:42:43 UTC
MultiDPIBitmapSource
Hi All,
I've just posted a question to stackoverflow;
http://stackoverflow.com/questions/19407700/how-to-embed-multidpibitmapsource-objects-in-flex-library-project
Cheeky i know, but i thought i'd ask here too as i would realllllly like
an answer ;)
Here's the question:
I currently store embedded images in a flex library project (swc) like so:
public class BitmapAssets
{
[Embed(source="/assets/icon_160.png")]
public static const icon_160:Class;
[Embed(source="/assets/icon_240.png")]
public static const icon_240:Class;
[Embed(source="/assets/icon_240.png")]
public static const icon_240:Class;
}
And then i reference the images in other projects. For example:
<s:Button>
<s:icon>
<s:MultiDPIBitmapSource source160dpi="{BitmapAssets.icon160}"
source240dpi="{BitmapAssets.icon240}"
source320dpi="{BitmapAssets.icon320}" />
</s:icon>
</s:Button>
What i would like to do is embed the MultiDPIBitmapSource in the library
project; then i could reduce the code to this:
<s:Button icon="{MultiDPIBitmapAssets.icon}" />
However, i can't figure out how to embed a MultiDPIBitmapSource object
with source160/240/320 values filled.
--
Lee Burrows
ActionScripter