Air display Image problem

I fetch an api service from a remote site, get a xml result,
the format is below:
<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
<channel>
<item>
<title>ssss....</title>
<description><![CDATA[ssss....]]></description>
<pubDate>Thu, 29 Jan 2009 05:38:39
+0000</pubDate>
<guid>
http://fanfou.com/statuses/xxx</guid>
<link>
http://fanfou.com/statuses/xxx</link>
</item>
<item>
<title>ttt....</title>
<description><![CDATA[ttt....]]></description>
<pubDate>Thu, 29 Jan 2009 05:36:09
+0000</pubDate>
<guid>
http://fanfou.com/statuses/yyy</guid>
<link>
http://fanfou.com/statuses/yyy</link>
</item>
</channel>
</rss>
i will compute image url from this xml item and then i put
the ArrayCollection in the the Repeater' DataProvider , as below:
<mx:Image
source="{getUsrImage(getUsr(String(rep.currentItem.title)))}"/>
## this image could display
<mx:Repeater id="rep" horizontalCenter="true"
verticalCenter="true" width="100%">
<mx:HBox width="100%" horizontalAlign="center">
<mx:Label
text="{getUsr(String(rep.currentItem.title))}"/> ## this image
could display
<mx:Image
source="{getUsrImage(getUsr(String(rep.currentItem.title)))}"/>
## this image could NOT display
</mx:HBox>
</mx:Repeater>
Stange thing happened:
if I run that in Flex Builder enviroment, all Image and Label
could be displayed, but If i deploy to air and install it on
windows or mac machine, only the label inside the repeater can
display, also the image outside the repeater can display, but the
Image control inside the Repeater can not display. it seems that
any dynamic generate expression in source or tip property will
cause the control not function.
can anyone explains this to me, it puzzle me for a long
time.

I am also having an issue that is fine when testing in Flash
but stops working when compiled and installed as an AIR app.
This saves an image to the desktop..... but does nothing in
AIR.
public function Main():void
var bitmapData:BitmapData = new BitmapData
(stage.stageWidth, stage.stageHeight, true, 0x000000 );
bitmapData.draw(this);
var jpgEncoder:JPGEncoder = new JPGEncoder( 100 );
var byteArray:ByteArray = jpgEncoder.encode( bitmapData );
var filename:String = "IMAGE.jpg";
var file:File = File.desktopDirectory.resolvePath( filename
var wr:File = new File( file.nativePath );
var stream:FileStream = new FileStream();
stream.open( wr , FileMode.WRITE);
stream.writeBytes ( byteArray, 0, byteArray.length );
stream.close();
}

Similar Messages

  • MacBook Air Display connection problem

    Hi,I recently got a MacBook Air (late 2010) used 9my dad gave it to me ).
    When I shut the computer's display it sometimes doesn't illuminate when I wake it I tried entering the password even though I can't see.
    And then i can vaguely make out my desktop or the apps.I recently discovered that by moving the whole computer it would illuminarte again i'm thinking that there is a loose connection between the screen and the motherboard.
    I'M RUNNING OSX 10.7.2 AND EVERYTHING IS UP TO DATE I'M VERY PICKY ABOUT THAT IF MORE INFO IS NEEDED JUST ASK.
    I would appreciate any response,
    -Georges
    P.S: I'm a hacker so i will understand any thechnical stuff, and i'm 12.

    I have had this same problem. Has the wifi worked before? What I did was I turned my wifi off, then I restarted my computer, then I turned my wifi back on. If that doesnt work, leave the wifi off, and shut it down for a while. Hope I could help!

  • Displaying Image Problem

    Hello,
    I need some advice. I have an existing java application that I am trying to convert into a portlet.
    The application is a directory search of people on campus. The only catch is that
    I am displaying their photo that is stored on a windows shared drive and I obtained
    the path to the image from a database query. So, all of my functions to load and resize
    the image are working, it is a matter of integrating everything into a portlet.
    This is where I am stumped:
    In my doView() method I have this snippet
    //imagePath is a path that was found through a database query using a first and Last Name
    String imagePath = getImageTag(Last_Name,First_Name);
    session.setAttribute("imagePath", imagePath, PortletSession.PORTLET_SCOPE);
    res.setContentType("text/html");
    Writer writer = res.getWriter();
    writer.write("<IMG SRC=" + res.encodeURL(req.getContextPath()+"/WEB-INF/jsp/image.jsp?file=" + imagePath) + ">");I had tried the <img src> line with a static image and it works, but integrating it using a jsp file has been a challenge.
    This is what image.jsp looks like:
    <%@ page import = "java.io.*" %>
    <%
        //get fileName of image from request
        String imgFileName = request.getParameter("file");
        try {
           //get thumbnail of image in byte array format
           byte[] imgData = beans.ImageUtil.getImage(imgFileName) ; 
           response.setContentType("image/jpg");
           out.clear();     
           OutputStream o = response.getOutputStream();
           o.write(imgData);
           o.flush();
           o.close();
        catch (Exception e) {
          e.printStackTrace();
    %>The getImage() method works fine in the standalone(non-portlet) application
    so I know the code works fine otherwise. It seems like it is a matter of
    putting everything together and getting it connected correctly in a
    portlet. I am wondering if in image.jsp can't find the method getImage().
    Any suggestions?
    Perhaps, someone has an idea on bypassing the whole image.jsp idea.
    Thanks,
    Laura

    Looks like you want to access the resource via direct URL. For IMG tag, the browser makes the direct request to the specified image source which is a jsp in your case. But WEB-INF cannot be accessed directly. So instead of "/WEB-INF/jsp/image.jsp" use "image.jsp". i.e image.jsp should not be inside the WEB-INF, put it outside of WEB-INF.

  • 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(...);

  • Problem Displaying image from blob

    Hi all,
    I m using,
    Database : 10g Rel 2
    Frontend : DevSuite 10g
    OS : WinXp
    Browser : IE 6
    Problem : In my forms i m displaying images from blob column but some of the images are not displayed. I have tried with all image formats available in combination with all available display quality but no luck. What could be the reason for it and how do i solve it?
    Can anyone help me plz?
    Thnx in advance.
    Imtiaz

    Hello,
    It is very difficult for us to "guess" what images you can read and what others you cannot.
    Maybe you could provide more information on images that are not displayed ?
    What is their native format ?
    Francois

  • Problem in displaying images one by one in JList

    I have a problem in displaying images one by one in Jlist. I want to show 100 images as a thumbnailview in jlist but it is talking too much time to show all the images after scalling 100 images to thumbnail view and making it into ImageIcon. So, i thought that it would be better way to show one by one after scaling it into thumnailview. But my renderer is getting calling after 100 images scaled down and setting into list. I have posted my code 2 days back but there is no reply.
    http://forum.java.sun.com/thread.jspa?threadID=789943
    I donno where i am missing in this code.
    Plz suggest me some solution for it.

    Where is the scaling done? In the ListCellRenderer? Regardless of where that is being done, I assume you are caching the scaled images after you scale them, right? If not, consider adding some sort of caching.
    This should do the trick...
    Rework your ListCellRenderer to check to see if a scaled version of the image is available. If not, start a thread to do the scaling and create an ImageIcon. In the meantime, while that thread is running, have the renderer return some sort of stock icon, like a little generic image icon. When the scaling thread completes, make a call to repaint() on the JList so the cell renderer gets re-asked for the icons. This time around, the renderer should notice that a scaled version (the ImageIcon) is available. Return that. So, this method doesn't guarantee that the images will be produced in order, 1...2...3..., but it will return images as they become available, and the overall JList rendering won't wait until all 100 are ready. If you want them returned in order, just do all of the scaling in a single thread and queue up the images to be scaled, in order.
    I hoped this helps. (If it does, please throw me some Duke Dollars.)

  • Problem in displaying images

    Dear JSP/Servlet experts,
    I have problem in displaying images on a JSP page. I stored all the images names in a database and
    try to retrieve them based on the user selection. When the JSP page is load for the first time the
    following error occur but the images are displayed correctly:
    2002-08-07 04:40:15 - Ctx( /simple ): IOException in: R( /simple + /images/cover150.jpg + null) Connection aborted by peer: socket write error
    2002-08-07 04:40:15 - Ctx( /simple ): IOException in: R( /simple + /images/cover154.jpg + null) Connection aborted by peer: socket write error
    2002-08-07 04:40:15 - Ctx( /simple ): IOException in: R( /simple + /images/cover152.jpg + null) Connection aborted by peer: socket write error
    2002-08-07 04:40:15 - Ctx( /simple ): IOException in: R( /simple + /images/cover151.jpg + null) Connection aborted by peer: socket write error
    2002-08-07 04:40:15 - Ctx( /simple ): IOException in: R( /simple + /images/cover156.jpg + null) Connection aborted by peer: socket write error
    Here is the code to display the images(the getCover() method will return cover150.jpg, cover151.jpg.... )
    and the images are stored in /simple/images folder
    <td><a href="<img src="/simple/images/<%= b.getCover() %>" alt="details"></td>

    try this
    <img src=/simple/images/<%=b.getCover() %>
    vasanth

  • Problem in displaying images stored in Blob variable

    Hi all,
    I have a requirement where i need to retrieve the image stored in Blob variable in DB and display the image in JSP page.
    I have written the below code to achieve this, it works fine
    In JSP, I am calling a action in the <img tag
    <img src='downloadPhoto.page?method=getPhotoInBytes&accessoryModelPictures.id.accessoryNumber=${photo.id.accessoryNumber}/> In my controller class
    InputStream inputStream=accessoryPicturesLOB.getPicture().getBinaryStream();
    byte[] theBytes = new byte[inputStream.available()];
    inputStream.read(theBytes);
    response.setContentType("image/jpg");
    response.getOutputStream().write(theBytes);But the problem is, *if i right click on the image and select save picture as option i get a error saying "The system cannot find the specified file "*
    Can you please tell me what is wrong in my approach/code
    Is there any better approach to display image that is store in Blob variable ?
    Please help on this.
    Thanks in advance.

    You need at least to set the filename in the content disposition header.

  • Problem with displaying image

    Hello!
    Sorry, I'm a beginner in APEX and have some problems with displaying images in my application. I have read the same topic but unfortunately didnt find the solution.
    So.. I have the interactive report
    table test (
    NAME NOT NULL VARCHAR2(4000)
    ID NUMBER
    BLOB_CONTENT BLOB
    MIME_TYPE VARCHAR2(4000))
    I need to display the column blob_content.
    Thnks a lot.

    1009316 wrote:
    Hello! Welcome to the forum: please read the FAQ and forum sticky threads (if you haven't done so already), and update your forum profile with a real handle instead of "1009316".
    When you have a problem you'll get a faster, more effective response by including as much relevant information as possible upfront. This should include:
    <li>Full APEX version
    <li>Full DB/version/edition/host OS
    <li>Web server architecture (EPG, OHS or APEX listener/host OS)
    <li>Browser(s) and version(s) used
    <li>Theme
    <li>Template(s)
    <li>Region/item type(s) (making particular distinction as to whether a "report" is a standard report, an interactive report, or in fact an "updateable report" (i.e. a tabular form)
    With APEX we're also fortunate to have a great resource in apex.oracle.com where we can reproduce and share problems. Reproducing things there is the best way to troubleshoot most issues, especially those relating to layout and visual formatting. If you expect a detailed answer then it's appropriate for you to take on a significant part of the effort by getting as far as possible with an example of the problem on apex.oracle.com before asking for assistance with specific issues, which we can then see at first hand.
    Sorry, I'm a beginner in APEX and have some problems with displaying images in my application. I have read the same topic but unfortunately didnt find the solution.
    So.. I have the interactive report
    table test (
    NAME NOT NULL VARCHAR2(4000)
    ID NUMBER
    BLOB_CONTENT BLOB
    MIME_TYPE VARCHAR2(4000))
    I need to display the column blob_content.This is described in the documentation: About BLOB Support in Forms and Reports and Display Image. There's an OBE tutorial that followed the introduction of declarative BLOB support in 3.1 as well.

  • Problem in bbm display image

    When I change bbm display image,it is not clear,its always blurr and dull it's not original image,might be there is some problem in bbm.
    Pls guide

    Hi punitinani,
    Are you changing your BBM display picture to a photo that you took with your device?
    Thanks.
    -CptS
    Come follow your BlackBerry Technical Team on twitter! @BlackBerryHelp
    Be sure to click Kudos! for those who have helped you.Click Solution? for posts that have solved your issue(s)!

  • Problem Displaying Images in a JFrame

    I am writing a program that displays images on a JFrame window. I have been reading the other postings about this topic however I have not been able to make my code work. I am hoping there is some obvious solution that I am not noticing. Please help, I am very confused!
    public class WelcomeWindow {
    private JLabel label;
    private ImageIcon logo;
    public WelcomeWindow() {
    label = new JLabel();
    logo = new ImageIcon("/images/logo.gif");
    label.setIcon(logo);
    this.getContentPane().add(label);

    Instead of a JLabel, have you tried to use a JButton containing the Icon?
    Also (but I think you've done it already), you could do that :
    File iconFile = new File("/images/logo.gif");
    if (!iconFile.isFile()) {
    System.out.println("Not a file");
    That way you'll be certain that the path given is correct.
    Hope this helps.

  • Problem for displaying image in jsp

    I like to retrieve and display image from database in jsp file. Now, image has been retrieved and store in session. But it cannot be displayed in jsp. Who can help me? Thanks a lot!
    Codes like below:
    <%
    byte[] b = (byte[])session.getAttribute("sessionName");
    System.out.println(b.length); //the length can be printed at console successfully
    if(b != null) {
    response.setContentType("image/*");
    OutputStream toClient=response.getOutputStream();
    toClient.write(b);
    toClient.flush();
    toClient.close();
    %>

    JSP is designed to return text/html documents.
    As such it automatically calls getWriter() to return a character stream. (places it in the implicit variable "out"
    Seeing as you want to return bytes, instead of character data, the JSP technology is not applicable
    Calling getOutputStream after getWriter has been called results in an IllegalStateException
    So calling getOutputStream in a JSP will ALWAYS throw an exception.
    Cheers,
    evnafets

  • How can i display image in mx:TextArea Component?

    I found display img tag in htmlText of mx:TextArea component
    is very difficult in Flex Air
    I new a simple air project in flex builder, put the code
    below in it, i put a glad.png file in the src folder, every thing
    is OK, when i run it, image cannot be displayed. why this happend,
    I search the google for the solution, it seems there is a bug in
    air, and told me to use mx:HTML coponent, but that component still
    can not display img tag.
    could any one help me with this?
    <mx:TextArea width="100%" height="100%">
    <mx:htmlText>
    <![CDATA[
    <a href='
    http://www.adobe.com'><img
    src='glad.png'/></a>Click the image to go to the Adobe
    home page.
    ]]>
    </mx:htmlText>
    </mx:TextArea>

    I ran into a similar problem and wasn't able to find a way to have regular Flex components (like Text and TextArea) display <img> tags in their htmlText.  Everything works find in a web-based Flex application, but once the same code was used in AIR, the images just wouldn't display.
    I changed my display to use the mx:HTML component and everything worked fine (I was using only external images).

  • XML to display image from userDirectory

    Hi All,
    I've been racking my brain for weeks now trying to work out how to do the following. I can do some of it in Flash and some of in Flex, but I can't do it all in Flex which is frustrating.
    In a nutshell, I want to create an Air App that will allow me to load an XML file from:
    File.userDirectory
    and then display images or SWF's based on the XML data:
    ============
    <?xml version="1.0" encoding="utf-8"?>
    <GALLERY>
    <IMAGE TITLE="shop">test_4.swf</IMAGE>
    </GALLERY>
    ===========
    In Flex 3 I can get the XML file loading from the userDirectory no problem, but I can't work out how to code it to display the images on the stage.
    In Flash I can get the XML file loading from the app's installation directory only, but I can display the images on the stage.
    Here are the two lots of code:
    FLASH (Note: I have a few movieclips holding the images)
    =============
    var myXML:XML;
    var myLoader:URLLoader = new URLLoader();
    myLoader.load(new URLRequest("example.xml"));
    myLoader.addEventListener(Event.COMPLETE, processXML);
    function processXML(e:Event):void {
    myXML = new XML(e.target.data);
    //trace(myXML.IMAGE);
    for (var i:int = 0; i<myXML.*.length(); i++) {
      trace("My image number is " + (i+1) + ", it's title is " + myXML.IMAGE[i].@TITLE + " and it's URL is " + myXML.IMAGE[i]);
      var url:URLRequest = new URLRequest(myXML.IMAGE[i]);
      var loader:Loader = new Loader();
      loader.load(url);
      switch (i) {
       case 0 :
        trace(0);
        mc_container_0.addChild(loader);
        break;
       case 1 :
        trace(1);
        mc_container_1.addChild(loader);
        break;
       case 2 :
        trace(2);
        mc_container_2.addChild(loader);
        break;
       default :
        //trace("Not 0, 1, or 2");
    =======================
    and:
    FLEX 3
    =======================
    <?xml version="1.0" encoding="utf-8"?>
    <mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical"
    width="768" height="1366" xmlns:comp="*" xmlns:fmtComp="fmtComps.*"
    creationComplete="readXMLContent();" paddingLeft="0" paddingRight="0" paddingTop="0" paddingBottom="0" backgroundColor="#ff00ff">
    <mx:Script>
    <![CDATA[
    import mx.controls.Alert;
    import mx.utils.ObjectProxy;
    import mx.rpc.events.ResultEvent;
    [Bindable]
    private var userManualObj:ObjectProxy;
    private function loadModelData(event:ResultEvent):void
    userManualObj=event.result.UserManual;
    private function readXMLContent():void
    var reportDir:File = File.userDirectory.resolvePath("myassets");
    var xmlFile:File;
    var fileStream:FileStream = new FileStream();
    xmlFile = reportDir.resolvePath("example.xml");
    if(xmlFile.exists && xmlFile.size > 0)// Checking if the UserGuide.xml file already exists and the file is not empty
    var stream:FileStream = new FileStream();
    var xml:XML = new XML();
    stream.open(xmlFile, FileMode.READ);
    xml = XML(stream.readUTFBytes(stream.bytesAvailable));
    var strXml:String = xml.toXMLString();
    Alert.show(strXml);
    trace(strXml);
    stream.close();
    ]]>
    </mx:Script>
    <mx:SWFLoader height="93" width="708" id="mc_container_0" />
    <mx:SWFLoader height="393" width="708" id="mc_container_1" />
    <mx:SWFLoader height="293" width="708" id="mc_container_2" />
    </mx:WindowedApplication>
    =========================
    Somehow I need to get the XML data for the file location into each of the SWF loaders in Flex, but I simply don't know how to code it? It's probably very easy for an expert out there.
    Note: I only want to end up with an Air App which will be running locally on my machine.
    The idea is, when the XML file changes with new image data, the Air App will display that new image. The image will be added to the "myassets" folder too.
    If anyone out can point me in the right direction, it would certainly be appreciated.
    Many thanks.
    Tim

    Can anyone help me please?

  • Display image in full screen

    Hi everyone, I am a newbie for labview. I just wanna ask you about image display in labview. Now I can display one image in my front panel. I open the file path and display it. First thing I wanna do is that is it possible to display on monitor full screen not on front panel and second thing is that how can I display images in folder and display it about 2 seconds delay in between? Pls kindly help me.
    Thanks millions.
    Solved!
    Go to Solution.

    Hi there, 
    -I don't know whether the image full display can be possible or not, Any reason why you are asking for such requirement?
    -The other question about reading files in a folder and display for 2sec can be done like shown in image.
    -I've attached vi in lv 12 if needed.
    -Next time, please post your vision related queries in Machine vision Board.
    Thanks
    uday,
    Please Mark the solution as accepted if your problem is solved and help author by clicking on kudoes
    Certified LabVIEW Associate Developer (CLAD) Using LV13
    Attachments:
    Image_read_folder.vi ‏43 KB

Maybe you are looking for

  • Help with multiple flash movies in same website

    I'm trying to create a website in dreamweaver. I created the artwork in fireworks. a slice of it i exported to flash to create rolling clouds over the background. i also want in the same swf file a screen for my main content. ( I used a scrollPane co

  • Space in the Table Name

    I was writing a program to move data from an Access database on to a different database. The existing access data base has table names with spaces and SQL queries do not recognize such names! Any suggestions?

  • Itunes syncing my ipod fast

    Today my ipod touch has a problem.My ipod has started syncing way too fast, to the point that it won't sync songs or pictures. I repeat the process and it continues to do the same thing. Can anyone help me with this problem?

  • Using MDX query in RPD

    I have a MDX query that I want to use in the RPD as "Table Type" =Select I did create a new object as "Physical Dimension" and gave the below script as Essbase 11 specific SQL, but this does not work and an getting the generic error "[nQSError: 15002

  • NO DISPLAY FOR POSSIBLE ENTERIES(F4) FOR TRANSACTION

    Hi GURU, WE ARE FACING A SITUATION WHERE WHEN WE PRESS (F4) FOR POSSIBLE ENTRIES FOR EXAMPLE IN T.CODE MD04 OR CO01 ITS BLANK AND BELOW THE POP SCREEN ITS SHOWS 16 ENTRIES FOUND. PLEASE HELP REGARDS RAMKUMAR WARIYAR