flex-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Lee Burrows <subscripti...@leeburrows.com>
Subject MultiDPIBitmapSource
Date Wed, 16 Oct 2013 15:42:43 GMT
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


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message