aharui commented on issue #878:
URL: https://github.com/apache/royale-asjs/issues/878#issuecomment-652491805


   Loading images from loaded data is trickier in Royale because the browser 
can't handle image data like Flash does.  Your code will have to detect the 
file type and encode the data.
   
   ```
                import mx.utils.ByteArray;
                import org.apache.royale.utils.Base64;
   
           var encodedData:String = Base64.encode(strFileRef.data as ByteArray);
        profilePic.source = "data:image/png;base64," + encodedData;
   ```
   
   I think you have to swap out `image/png` for `image/jpeg` and other formats 
depending on what got loaded.
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to