Display image in standalone AIR application

I have loaded images and like to display image in standalone AIR application. But I cannot get it work. The code as follows:
private function ImageLoader(url:String):void
var request:URLRequest = new URLRequest(url);
var loader:Loader = new Loader();
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, loaderComplete);
loader.load(request);    
private function loaderComplete(event:Event):void
var scaleFactor:Number = 1;
var uic:UIComponent = new UIComponent();
try
var bmp:Bitmap = event.target.content as Bitmap;
var bmd:BitmapData = bmp.bitmapData; //Bitmap(event.target.content).bitmapData;
var scaledBMD:BitmapData = new BitmapData(400, 400);
var matrix:Matrix = new Matrix();
matrix.scale(scaleFactor, scaleFactor);
scaledBMD.draw(bmd, matrix, null, null, null, true);
uic.x = 40;
uic.y = 40;
uic.addChild(new Bitmap(scaledBMD));
catch (errObject:Error)
trace(errObject.message);

Found answer by adding mx:Canvas and add
iconCanvas.addChild(uic);
after
uic.addChild(new Bitmap(scaledBMD));
<mx:Canvas id="iconCanvas" width="10" height="10" horizontalScrollPolicy="off" verticalScrollPolicy="off" x="0" y="0" clipContent="false"/>
Is anyone create "Canvas" by using new Canvas and get it works? example:
var canv:Canvas = new Canvas(...);

Similar Messages

  • Displaying image on the swings application

    Hi All,
    I want to display images onto my swing application. I was using ImageIcon and Class to getResource(filename). It can only provide me images that i have placed in my package not outside my package.
    Please help me, how to to do?
    Thanks in advance.

    [url http://java.sun.com/docs/books/tutorial/uiswing/components/icon.html]How to Use Icons

  • Displaying server stored images in an air application

    Usually when I go about displaying server stored images in a regular flex application I go about it the following way:-
    - Create a mysql database table on a server which contains image names
    - Create a php file which generates all of the image namesfrom the table as xml and upload this file to the server
    - Create a new flex application/project
    - In the application make a http service which points to my php/xml file and turns this data into an array collection
    - Set the array collection to the dataprovider of a tilelist component so that all of the images will eventually be displayed within it when they are created
    - I set the itemrenderer of the tilelist to an image component which has it's source set to something like source="{'assets/images'+ data.imagename}" with imagename being the field containing the name of the image which is stored in the mysql database table.
    - Make a folder in the app/project called assets/images which will contain all of the images
    - Upload the app to the server and once it runs all the images will be displayed in the application
    - Then any images that are uploaded to the server can also be displayed as long as their names are added to the mysql database
    My question is though how do you get server stored images to display within an Air Application? My air app will be used on multiple machines but I want the images in it to be dynamic i.e. stored on a server and can be changed. How can this be done?

    I'm struggling to figure out how to access the image files when the assets/images folder will be on a server and the app itself will be on the user's desktop whereas usually in the case of a regular flex app this wouldn't mater as both the app and the image files would be on the server together. Is what I'm trying to do possible i.e. displaying images on a desktop air app straight from a server?

  • Open PS (CS-CS4) and load image from flex/air application?

    Hello,
    (Not sure wether to post this in the AIR forum or the FLEX forum?)
    I am at a loss on how to get my simple application to work. I have a small desktop air application that simply opens Photoshop and runs an action. I used switchboard and the application ran great on PC and MAC. However it only worked for CS3, and CS4 not CS or CS2?. Plus the size of switchboard was a bit large for my small app. I am willing to live with that though . I am using Air with Flex and wanted to know if perhaps there is a beter approach? All the application does is open photoshop, loads an image, and runs an action. Can I do this for all versions of Photoshop using switchboard? Can I do this without switchboard and just use javascript. The big issue is the Air app needs to open Photoshop, and most of the examples have me open PS first and then execute a script located in the PS directory. This needs to work outside of the PS directory. Any examples are appreciated.
    I have looked at the following:
    - SwitchBoard : only works for CS3-CS4 (on my tests)
    - PatchPanel: same issue, plus seperate SDKs
    - ExtendScript: requires script to be run from PS not Air

    Of course you may have some unstated reason for doing this in Air, but if not...
    Google photoshop droplet....
    Bob

  • Display Images at WD ABAP application

    Hi,
    How to display the image which exist in KM ? I need to read the image from KM and display in WebDynpro ABAP  application. How to do it.  Do we have that provision here ? If not posible can we display some images keeping them in the application itself. ?
    Thanks
    Jyothi.

    Jyothi,
    you can store the images in MIME repository like this https://forums.sdn.sap.com/click.jspa?searchID=18727216&messageID=6430157
    Showing Image in Web Dynpro using ABAP
    Thanks
    Bala Duvvuri

  • How to display image at jpanel in application GUI

    i wana load an image from given location to my GUI when application starts.
    according to my perception this code should load image but its not working.
    Will any body kindly help me and point out the "reasons" for not working following piece of code from my application.
    public class MainFrame extends JFrame
    JPanel jPanel1 = new JPanel();
    JPanel jPanel2 = new JPanel();
    JButton jButton1 = new JButton();
    JButton jButton2 = new JButton();
    Image image = Toolkit.getDefaultToolkit().createImage("c:\\form-3.jpg");
    javax.swing.JScrollBar jScrollBar1 = new JScrollBar();
    BorderLayout borderLayout1 = new BorderLayout();
    public MainFrame()
    try
    jbInit();
    } catch (Exception ex)
    ex.printStackTrace();
    public static void main(String[] args)
    MainFrame mainFrame = new MainFrame();
    private void jbInit() throws Exception
         //jbInit() defined here
    public void paintComponent(Graphics g)
    // jPanel1.getGraphics().drawImage(image,0,0,jPanel1);
    Graphics2D g2D = (Graphics2D) g;
    BufferedImage bi = (BufferedImage) createImage(getWidth(),getHeight());
    bi.createGraphics().drawImage(image, 0,0, jPanel1);
    // g.drawImage(image,0,0,jPanel1);
    public void jButton2_mouseClicked(MouseEvent e)
         public void jButton1_mouseClicked(MouseEvent e)
    this.dispose();
    System.exit( 0 );
    /////////////////////////////////////////////////////////////////////////////

    this works OK
    (stripped of everything unrelated to your question)
    import javax.swing.*;
    import java.awt.*;
    class MainFrame extends JFrame
      Image image = Toolkit.getDefaultToolkit().createImage("test.gif");
      public static void main(String[] args)
        MainFrame mainFrame = new MainFrame();
        mainFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        mainFrame.setSize(200,200);
        mainFrame.setVisible(true);
      public void paint(Graphics g)//<-----heavyweight component
        super.paint(g);
        g.drawImage(image,50,50,this);
    }

  • Html display order : PDF document in AIR application

    Hello.
    I read
    "The display order of a PDF file operates differently than other display objects in an AIR application. Although PDF content clips correctly according to HTML display order, it will always sit on top of content in the AIR application's display order."
    I am concerned with the "PDF content clips correctly according to HTML display order" part. I would like to know what it exactly means. That is I want to be sure that I could put, for example, and image over the PDF doc, or any other HTML elements without them being graphically overridden by the PDF view. Thanks in advance.

    My reading of the quoted bits is: Inside the PDF, layer ordering rules should work correctly.  But the PDF itself will float above any other content in AIR.

  • How to display  image efficiently in JPanel.............

    i have following piece of code used to load and display image on jpanel when application starts.
    the problem is that
    image is not loaded efficiently,
    also it covers other panels added in frame.
    and scrollbar of panel does not work to show parts of image.
    i want to efficiently load the image and to fit in in my panel and also to scroll bar to work proper with image.
    looking for any nice suggestion
    public class MainFrame extends JFrame
    Image image = Toolkit.getDefaultToolkit().createImage("c:\\form-3.jpg");
    javax.swing.JScrollBar jScrollBar1 = new JScrollBar();
    BorderLayout borderLayout1 = new BorderLayout();
    JPanel jPanel1 = new JPanel();
    JPanel jPanel2 = new JPanel();
    JButton jButton1 = new JButton();
    JButton jButton2 = new JButton();
    public MainFrame()
    try
    {            jbInit();        } catch (Exception ex)
    {            ex.printStackTrace();        }
    public static void main(String[] args)
    MainFrame mainFrame = new MainFrame();
    jBInit Method defined here
    public void paint(Graphics g)
    g.drawImage(image,0,0,jPanel1);
    Message was edited by:
    @tif

    You have overided the paint method on JFrame then you are drowing on entire Frame.
    Instead you have to override the paintComponent method of a JPanel class or use a JLabel with the image

  • AIR Application Installer screen - name - How to use image??

    I want to use the image instead of the plain text for the name of the application. Is there any way to use image as an application name?
    PrincessWidget-app.xml
    <!-- Used as the filename for the application. Required. -->
    <filename>Princess Countdown Connection</filename>
    <!-- The name that is displayed in the AIR application installer.
    May have multiple values for each language. See samples or xsd schema file. Optional. -->
    <name>assets/Princess_logo.png</name>
    <!-- An application version designator (such as "v1", "2.5", or "Alpha 1"). Required. -->
    <version>v1.0.1</version>

    thanks levi_h
    JTextPane class extends JEditPane and allows you to embed
    images or other components within the text managed by the component

  • PC/64/Windows 7/XIStandard recently installed/unable to put footer into document because I can't move to the bottom of the image when in footer application mode.  Display is at recommended 1920x1080.  Is there a solution or is it a flaw in the program?

    PC/64/Windows 7/XIStandard recently installed/unable to put footer into document because I can't move to the bottom of the image when in footer application mode.  Display is at recommended 1920x1080.  Is there a solution or is it a flaw in the program?

    Don't have a direct answer. But did you install the updates. They might resolve the problem.

  • Incorrect functionality of Embedded tag in html page, displaying object on top of all layers of Adobe air application native window

    Title
    Incorrect functionality of embed tag in html loader for adobe air development
    Description
    Problem Description: If we had loaded youtube.com video url in a view stack and navigate to other index of stack or away from we UI screen within the same native window video or embeded tag of flash player or any other embed object will be displayed on top of all screens layer in same position of where the object should be placed in side of html loader only.
    Steps to Reproduce:
    1) go to http://get.straweb.com/StraWebBrowser/StraWebBrowser.air download and install
    2) load 2 tabs and in the 3 tab load video player of youtube.com which will a sample video
    before completing the load of 3 tab which trying to load video from youtube.com, navigate to other tabs 1 or 2 in few second once the flash player of youtube.com video player is load it will display in the current tab or UI screen.
    3) Try navigating to other tabs than youtube.com loaded tab you see the flash player is on top it stable.
    4) navigate to 3 tab and try to navigate to other tab you can observe that so how it will not show that flash player and only visible in that 3 tab which is fine.
    Actual Result: Embedded tag of html page displaying on top of all layers of Adobe air application native window
    Expected Result: Embedded tag of html page should only displayed in side htmlloader
    This you can replicate in any adobe air plugin update and on any Hardware and Environment.
    Applicable to all sdk versions of adobe air.

    Adobe Bugbase: Bug 3823839 Incorrect functionality of embed tag in html loader for adobe air development

  • How to  upload and display image using bsp application

    hi
    I  just wants to know that
    1- how to  upload image from BSP page with attachment into sap server .?
    2-how to display image in to BSP page(webpage).
    thanks

    Hello Gupta Prashant,
    Just to upload and display an image, import image in MIME repository. Not only still images but also flash files can also be uploaded in the MIME repository. Once you import the image in it, use normal html code for image call;
    <img src = "file.jpg/gif" width=  height=>
    Besides it, if your requirement is to store the image in the database and fetch it based on specified field-name, then you have to go for BLOBs i.e Binary Large Object, using this you can also store images, videos, pdfs, applications in the database.
    MBLOB - Medium BLOBs store videos and pdfs,
    LBLOB  - Large BLOBs store movie files and applications.
    You have got 2 ways to use it; some databases store BLOB objects into themselves and some store the path of the BLOB object maintained on the FTP server.
    You can also implement it in ABAP;
    read the following link and practice the tutorial;
    [ Use of MIME Types|http://help.sap.com/saphelp_45b/helpdata/en/f1/b4a6c4df3911d18e080000e8a48612/content.htm]
    also check this
    [TYPES - LOB HANDLE|http://help.sap.com/abapdocu/en/ABAPTYPES_LOB_HANDLE.htm]
    And looking at your question, in order to upload an image, you can make use of FILEUPLOAD tag provided by HTMLB.
    Step 1: FILEUPLOAD provides a browse button to choose desired image file.
    Step 2: Store that image in database using BLOBs.
    Step 3: Retrieve the image using normal select query and display it on the screen.
    Hope it helps you,
    Zahack

  • How to display BLOB image column with WEB application, JSF, ADF BC

    I looking for a way to display the content from a blob column on a WEB application, JSF, ADF BC
    The blob column contains a JPEG image.
    About the application
    The model contains a viewobject where the blob column attribute (photoimg) type is of type : BlobDomain
    Now I have to create the view to display the content of photoimg inside a JSF-JSP page.
    Any advice ?

    Search is your friend
    How to display the content of a BLOB column in a ADF/BC pages ?
    John

  • Images stored in Application Data folder are not visible in HTML Page generated by AIR Application

    Hi Programmers,
    I have an AIR application where in I am capturing the images of persons via web cam and storing them in the Application Data folder of the users machine. I am successfully able to do so.
    However, when generating the report in the HTML format from within the AIR application, I use the image captured and give the absolute path. but some how the image doesnt appear in the browser, I get the icon for image not found.
    When I right click on the image, select property and copy the image path in new browser, I can see that image. Any thoughts on why this is happening?
    Thanks,
    Hitesh patel

    I tried changing the directory  as following in java class:
    File trgDir = new File("/tmp/myTarget/");
    File srcDir = new File("/tmp/mySource/");
    FileUtils.copyDirectory(srcDir, trgDir);
    but unfortunately  Adf mobile application does not support "File Utils. copy Directory" library
    so is there any way to circumvent this problem.
    Any help would be appreciated 

  • Displaying Image from ADF BC (BLOB Column) in ADF Mobile Application

    I have made an ADF BC over a database. Now I want to use that ADF BC's data control in my ADF Mobile App to display image stored in a blob column in the database!
    How should I got about it?
    Regards,
    Muhammad Zaheer

    Sir,
    I have exposed it through web services and I'm using the Web Service data control in my mobile application but the blob column is shown as output text in the data control. Now I don't know how to display the image from the blob column in my ADF mobile application.
    Looking forward for your help.
    Thank you.

Maybe you are looking for

  • Satellite A200 - Vista Home Premium to Ultimate upgrading

    Hi Guy's back again with a new query. I'm looking to upgrade from Vista Home Premium to Ultimate...checked out all the so called requirements on the" Windows anytime upgrade" site and I can assure you there are plenty of conflicting ideas about how i

  • How do I restore Firefox Last Session?

    After a crash: bp-1dc9064f-fcc3-44f8-9c04-e058d2120127 I missclicked Restore Session button and clicked on the New Session instead. Then I tried to click on the History -> Restore Last Session button but it was "grey" (i.e. inactive). I thought it is

  • Embedded video in Indesign won't play

    Hi all, I've been playing with InDesign for the last 8+ hours on trying to figure this out and hoping somebody here on this forum is smarter than me. I have embedded a video (it's a flash video) in my InDesign file - a magazine. I'm testing the page

  • "My Computer" not showing ipod shuffle 2nd gen songs

    Im trying to take the music from my ipod shuffle, make a file, and transfer the music to that file to load onto itunes. My problem is that when I click on my ipod through "My Computer", it shows that it is empty. This is a pre-used computer that I ju

  • Reverse Sync?

    Ok, so this isn't so much a technical problem as much as it is just very very annoying, fist-through-the-wall, situation. Long story short, I had to do a full system restore on my computer for unrelated reasons. Naturally, this will wipe all the song