Display image in an array format

I'm new to flex and I would really appreciate anyone who can help me. My  problem is I need to display an (1)image in columns and rows depending  on the user input. I have two text inputs one for length and width on  the other. Say the user inputs 5 for length and 6 for width so the  image will be displayed in a 5 x6 picture array(5 pictures in 6 rows).  Looking forward for your advise on how I can workon this. I hope I was able to explain my problem very well. Thank you in  advance.

You might find TileLayout to be useful.  It exposes a requestedColumnCount and requestedRowCount property.
Here is a simple example:
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
               xmlns:s="library://ns.adobe.com/flex/spark">
    <s:controlBarContent>
        <s:HSlider id="colSlider" minimum="2" value="3" maximum="6" />
    </s:controlBarContent>
    <s:List width="100%" height="100%">
        <s:layout>
            <s:TileLayout requestedColumnCount="{colSlider.value}" />
        </s:layout>
        <s:itemRenderer>
            <fx:Component>
                <s:ItemRenderer>
                    <s:Rect width="100" height="100">
                        <s:fill>
                            <s:SolidColor color="0xe3e3e3" />
                        </s:fill>
                    </s:Rect>
                    <s:Label text="{data}" verticalCenter="0" horizontalCenter="0" />
                </s:ItemRenderer>
            </fx:Component>
        </s:itemRenderer>
        <s:dataProvider>
            <s:ArrayCollection>
                <fx:String>1</fx:String>
                <fx:String>2</fx:String>
                <fx:String>3</fx:String>
                <fx:String>4</fx:String>
                <fx:String>5</fx:String>
                <fx:String>6</fx:String>
                <fx:String>7</fx:String>
                <fx:String>8</fx:String>
                <fx:String>9</fx:String>
                <fx:String>10</fx:String>
                <fx:String>11</fx:String>
                <fx:String>12</fx:String>
                <fx:String>13</fx:String>
                <fx:String>14</fx:String>
                <fx:String>15</fx:String>
            </s:ArrayCollection>
        </s:dataProvider>
    </s:List>
</s:Application>

Similar Messages

  • Displaying images in their own format.

    I wrote the following code to store a path of an image into a textbox:
    declare
    filename VARCHAR2(255);
    begin
    filename := GET_FILE_NAME(NULL,NULL,'All Files (*.*)|*.*|');
    :infiles.letterpath := filename;
    end;
    Then,
    I used the following code to read an image(bath) from "letterpath" textbox and display it into an image item:
    Read_image_file(:infiles.letterpath, 'gif', 'infiles.letter_image');
    Now, what i want is to show images in their own format, not to dispaly them into an image item.
    Can someone please tell me how i can display images in their own format.
    For example: lets say i store a path of a word document in a textbox then when i click an open button, i want that document to be displayed in MS Word.
    Thanks in advance.

    Hi,
    you could use an OLE container in Forms and associate this with the externmal viewer that you would like to show the source. This however works for c/s and immediately stops working once moving your app to the Web. There you would need to investigate in a Java Bean solution to do this.
    Frank

  • Display image from byte array

    Hello Everybody,
    I need to display an image given in a byte array, how can I show this image in a JFrame?
    1. I tryied saving the image in a .jpg file,
         File file1 = new File("Path to my destination image");2. then I use a FileOutputStream to save the image in the path:
            FileOutputStream fos1 = new FileOutputStream(docu);
            fos1.write(ImageInbyteArray);
            fos1.close();3. Once I have the image in a file I'm trying to load it using a JButton, but the JButton doesn't display the image. I think that for some unknown (at least for me ;-) reason the file isn't still available to be used in the ImageIcon, this is my code:
            imgIconDocu = new ImageIcon("Path to my destination image");
            jBtnDocu = new JButton(imgIconDocu);What's wrong here?
    Thanks a lot

    Does the byte array contain a JPEG image? Where did
    you get the contents of the byte array?yes the array contains the JPEG image, I have a database in PostgreSQL, and the images are stored in blob in the database. I have to call a service in the server and in return it gives me the 3 images as byte arrays, that's the reason I only have the byte arrays. so I tryed saving the images as jpeg files in my hard disk to show them, but it appears that they are not available to show them in Swing after saving them. I can only show the images if I close my application and start it again :-(
    I tryed flushing and closing the FileOutputStream after the writting process (fos.write(bytearrayImage);
    fos.flush();
    fos.close();)
    Y also tryed:
    fos.write(bytearrayImage);
    fos.close();
    fos.flush();But it doesn't work either :-(
    What do you recommend me?.
    Thanks a lot,
    Johnny G L

  • How to display Image by using Array?

    Hi all, I know to how to display the image in MXML by using
    AS 3.0
    like this:
    <?xml version="1.0"?>
    <mx:Application xmlns:mx="
    http://www.adobe.com/2006/mxml"
    width="100" height="80" borderStyle="solid">
    <mx:Script>
    <![CDATA[
    [Embed(source="logo.gif")]
    [Bindable]
    public var imgCls:Class;
    ]]>
    </mx:Script>
    <mx:Image source="{imgCls}"/>
    <!--OR-->
    <mx:Image source="@Embed('assets/Nokia_6630.png')"/>
    </mx:Application>
    But the thing is I am building a list for display the images,
    the values is come from the Array. I am trying a different way for
    display it but no working, here is my code:
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="
    http://www.adobe.com/2006/mxml">
    <mx:Script>
    <![CDATA[
    public var PICTURE_ARRAY:Array = [{label:"FileA",
    icon:"@Embed('upload/myjpg.jpg')"},
    {label:"FileC", icon:"@Embed('upload/myjpg.jpg')"},
    {label:"FileB", icon:"@Embed('upload/myjpg.jpg')"}]
    ]]>
    </mx:Script>
    <mx:Tile id="pictureSelection" height="180" width="500"
    borderStyle="solid">
    <mx:Repeater id="picRP"
    dataProvider="{PICTURE_ARRAY}">
    <mx:VBox horizontalAlign="center" verticalAlign="middle"
    verticalGap="0" borderStyle="none" width="100" height="100">
    <mx:Image width="80" height="80"
    source="{picRP.currentItem.icon}"
    toolTip="{picRP.currentItem.icon}"/>
    <!--
    I also tryed this as well:
    set the icon value as picture location like: "A.jpg" or
    "B.jpg"
    then
    <mx:Image width="80" height="80"
    source="@Embed('upload/{picRP.currentItem.icon}')" />
    -->
    <mx:Label text="{picRP.currentItem.label}" width="100"
    textAlign="center"/>
    </mx:VBox>
    </mx:Repeater>
    </mx:Tile>
    </mx:Application>
    Can anyone tell how to display the array value into Image
    tag? Thanks

    In your data you have this:
    {label:"FileC", icon:"@Embed('upload/myjpg.jpg')"},
    change it to this:
    {label:"FileC", icon:"upload/myjpg.jpg"}, // this is just the
    filename, not embedded
    In your Repeater you have this Image tag:
    <mx:Image width="80" height="80"
    source="{picRP.currentItem.icon}"
    toolTip="{picRP.currentItem.icon}"/>
    which is fine, except for the toolTip. The toolTip uses a
    string, not an image. If you want to show an image in the toolTip,
    you'll need to write your own toolTip class.
    Now the source property of the image will be given the URL to
    the image which will then be requested from the server and
    downloaded at runtime - it is not embedded.
    If you need to embed the images, then your dataProvider
    should have the variable name associated with the embedded
    image.

  • How to make mouse click event to display image on 2D array?

    Hi! beginner programmer here looking for some guidance, hints and tips.
    I'm making a game of "Connect 4" and using a 2D array to display the board which is 7x6 in size.
    What i want to do is that when the player clicks on one of the squares, one of the 2 game pieces(red.png or yellow.png) will appear on the respective coordinates of the 2D array and check if the square in the first row is empty and if true, places/display
    the game piece, else it places the piece on the first empty square.
    Since i've never worked with WinForms or 2d arrays before i'm not sure how to initiate it.
    What i was considering in pseudocode was:
    pb_Mouseclick(object sender, MouseEventArgs e)
    if(e.Button==MouseButtons.Left)
    Picturebox pb=(Picturebox)sender;
    clickLocation.X= e.Location.X + pb.Location.X, pieceArray[row];
    clickLocation.Y=e.Location.Y + pb.Location.Y, pieceArray[col];
    if(pieceArray[row, col] == null)
    if(player1.IsStarter==true) selectedimage(@"yellow.png")
    else
    selectedimage(@"red.png")
    else {
    bool empty= false;
    for(int row=0; row<height - 1; row++)
    for(int col=0; col<width; col++)
    if(pieceArray[row, col] ==null)
    empty=true;
    (Add gamepiece)
    This is what i've come up with so far, but it's just some theorycrafting, not sure if i should use a while-loop instead...
    Hope anyone can give me some insight on how to make it work and if the logic of my pseudocode is correct for what i want according to my earlier explanation.
    Many thanks in advance!
    Regards
    Gabbelino
    Student at the University of Borås, Sweden

    Hi Gabbelino,
    I could not understand your game rule clearly, and could you make explanation for me?
    1.>> when the player clicks on one of the squares
    What were the squares? Did it like dice or anything else?
    2.>> one of the 2 game pieces(red.png or yellow.png) will appear on the respective coordinates of the 2D array
    What is the 2 game pieces? Could you show us the two pictures?
    3.>> check if the square in the first row is empty and if true, places/display the game piece, else it places the piece on the first empty square
    Could you show us where places/display the game piece?
    Best Regards,
    Tony
    Help each other

  • 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.

  • Hierarchy  column display image(Triangle) format need to be changed in obiee11g

    Hi ALL,
    Hierarchy  column display image(Triangle) format need to changed
    For Mobile users of obiee11g, the triangle symbol image is big in size while viewing in mobile phone,i have two issues
    1. I need to reduce the size of triangle image
    2.Need to reduce the spacing between triangle image and the text
    Expecting the  the response ASAP
    Thanks,
    Bala

    Hi ALL,
    Hierarchy  column display image(Triangle) format need to changed
    For Mobile users of obiee11g, the triangle symbol image is big in size while viewing in mobile phone,i have two issues
    1. I need to reduce the size of triangle image
    2.Need to reduce the spacing between triangle image and the text
    Expecting the  the response ASAP
    Thanks,
    Bala

  • Pb displaying image in a canva with jpg format

    I have an applet that displays images in a canva by pushing buttons. It works very well with gif image but bad with jpg image.
    Coincidence or not ? I don't know.
    What I know that I use the same method painting jpg or gif image
    (first changing image name then calling mycanva.validate() and mycanva.repaint() and of course mycanva paint method contains g.drawimage(myimage,0,0,200,200,this) )
    With jpg image what happens is the image is not completly painted (sometime half painted, sometime less than half painted) and if I do reload the browser the image is very well displayed...
    has someone an idea ?
    many thanks

    try your app on another computer and see if it does the same thing. I had a very similar problem and it turned out to be my video driver was not driving my video properly. I changed/updated the video driver and my problems were totally solved.

  • Display image in JPanel without saving any file to disk

    Hi,
    I am fetching images from database. I am saving this image, display in JPanel and delete it. But this is not actually I want.
    I wish to fetch this image as stream , store in memory and display in JPanel without saving any fiel in disk.
    I wonder if it is Possible or any used implementation that I can use in my project. Any idea or experienced knowledge is enough.
    Thanks

    In what format is the image coming to you from the database? If it's an InputStream subclass, just use javax.imageio.ImageIO:
    InputStream in = getImageInputStream();
    BufferedImage image = null;
    try {
       image = ImageIO.read(in);
    } finally {
       in.close();
    // ... Display image in your JPanel as you have beenIf you receive the image as an array of bytes, use the same method as above, but with a ByteArrayInputStream:
    byte[] imageData = getImageData();
    ByteArrayInputStream in = new ByteArrayInputStream(imageData);
    BufferedImage image = null;
    try {
       image = ImageIO.read(in);
    } finally {
       in.close();
    // ... Display image in your JPanel as you have been

  • How to create a report in Form line Style and can display Image field?

    Hi,
    In Report builder 10g, I would like to create a Report with Form Line Style and this report included a Image field.
    I can choose this Style only when Select Report type is Paper Layout. Because, If I choose Create both Web & Paper Layout or Create Web Layout only then in the next Style tab 03 option Form, Form letter and Mailing Label be Disabled.
    But in Paper Layout, my report can not display Image field.
    I tried with Web layout and all the other Styles (Except 03 mentioned be Disabled) then all Styles are displayed Imager field OK.
    How to create a report in Form line Style and can display Image field?
    I was change File Format property of my Image field from text to Image already in Property Inspector. But report only showed MM for my Image field.
    Thanks & regards,
    BACH
    Message was edited by:
    bachnp

    Here you go..Just follow these steps blindly and you are done.
    1) Create a year prompt with presentation variable as pv_year
    2) Create a report say Mid report with year column selected 3 times
    - Put a filter of pv_year presentation variable on first year column with a default value say @{pv_year}{2008}
    - Rename the second time column say YEAR+1 and change the fx to CAST(TIME_DIM."YEAR" AS INT)+1
    - Rename the second time column say YEAR-1 and change the fx to CAST(TIME_DIM."YEAR" AS INT)-1
    Now when you will run Mid Report, this will give you a records with value as 2008 2009 2007
    3) Create your main report with criteria as Year and Measure col
    - Change the fx for year column as CAST(TIME_DIM."YEAR" AS INT)
    - Now put a filter on year column with Filter based on results of another request and select these:
    Relationship = greater than or equal to any
    Saved Request = Browse Mid Report
    Use values in Column = YEAR-1
    - Again,put a filter on year column with Filter based on results of another request and select these:
    Relationship = less than or equal to any
    Saved Request = Browse Mid Report (incase it doesn't allow you to select then select any other request first and then select Mid Report)
    Use values in Column = YEAR+1
    This will select Year > = 2007 AND Year < = 2009. Hence the results will be for year 2007,2008,2009
    This will 100% work...
    http://i56.tinypic.com/wqosgw.jpg
    Cheers

  • Display image in sub_VI

    I am running a Linux (no NI Vision support) LabVIEW application where I have a “main” DAQ VI collecting raw u8 data. I want to be able to display the data as an image in a sub-VI. The first time I call the sub-VI to display the first image everything works fine, however, on the second and subsequent calls to the sub-VI I get an error saying that the sub-Vi is already open and needs to be closed before being called. I don’t have the screen space to adequately display images in the main VI and still have the DAQ controls visible.
    Is there a way to have one VI continuously collect and format image data and then display the data in a second VI?
    Thanks in advance

    Thank you for the reply
    In the example you provided the sub-VI is called, executes, and terminates. I need to be able to repeatedly call a sub-VI that does not terminate. I need to do this so that I can update an image and allow an operator to view the image (and perform event functions on the image such as mouse click).
    Is there a way for a main VI to call a sub-VI and not have to pend (wait) for the sub-VI to complete execution?
    Is there a way to call (i.e. pass data) to a sub-VI that is already running?
    Thank you again for your help

  • Efficiency of decoding and displaying image files?

    BRIEF SUMMARY
    My question is this: can Flash Player download JPG and GIF
    files from a server and rapidly open/decode them, ready for
    display, efficiently and
    entirely 'in memory'?
    Would Flex be a good choice of language for developing a RIA
    that needs to continually download lots of JPG and GIF images
    on-the-fly from the server and render them on the screen? I *don't*
    want my application to thrash the hard disc.
    BACKGROUND
    I am designing a 'rich' web app, and I'm investigating
    whether Flex is the right tool for the job.
    Although Flash's animation features are an obvious selling
    point for implementing my user interface, I also need to do some
    server-side rendering. What I want to do is perhaps a little
    unorthodox: I will be generating lots of GIF and JPG files on the
    fly and these will be streamed to the client (along with other
    application data, e.g. in XML format) to update different parts of
    the on-screen document. In need this to happen very quickly (in
    some cases, creating the effect of animation).
    It happens that JPGs and 16-colour GIFs will be, by far, the
    most efficient formats for streaming the images, because of the
    nature of the application. I could of course send the images in
    some proprietary format, geared for my application, but presumably
    decoding the images would be slow as I would have to implement this
    myself in ActionScript, and so I would be limited by the speed of
    Flex 'bytecode'. (I realise Flash is a lot more optimised than it
    once was, but I am hoping to see a gain from using image formats
    that Flash natively understands!)
    Naturally the internet bandwidth should (in principle) be the
    bottleneck. However, assuming I can get my image files to the
    client on time, want I want to know is:
    how efficient is Flash at loading such files?
    Bearing in mind that I'm not just displaying the occasional
    image -- I will be doing this continuously. Most of the images
    won't be huge, but there will be several separate images per
    second.
    The image files will be a mixture of normal colour JPGs and
    4-bit colour GIFs (LZW-compressed). I know that Flash natively
    supports these formats, but depending on how Adobe have implemented
    their LZW/Huffman decoding and so on, and how much overhead there
    is in opening/processing downloaded image files before they are
    ready to 'blit' to the screen, I imagine this could be pretty fast
    or pretty slow!
    If my client only has a modest PC, I don't want the JPG/GIF
    decoding alone to be thrashing his CPU (or indeed the disc) before
    I've even got started on 'Flashy' vector stuff.
    I'm new to Flash, so are there any 'gotchas' I need to know
    about?
    E.g. Would it be fair to assume Flash Player will do the
    decoding of the downloaded image entirely 'in memory' without
    trying to do anything clever like caching the file to disc, or
    calling any libraries which might slow down the whole process? It
    would be no good at all if the images were first written to the
    client's hard disc before being ready to display, for example.
    Further, if I'm doing something a little out-of-the-ordinary,
    and there is no 'guarantee' that images will be loaded quickly,
    what I'm doing might be a bad idea if a later version of Flash
    Player may (for example) suddenly start doing some disc access in
    the process of opening a newly downloaded image. So, while I could
    just 'try it and see', what I really need is some assurance that
    what I'm doing is sensible and is likely to carry on working in
    future.
    Finally, I imagine JPG/GIF decoding could be something that
    would vary from platform to platform (e.g. for the sake of
    argument, Flash Player for Windows could use a highly-optimised
    library, but other versions could be very inefficient).
    This could be the 'make or break' of my application, so all
    advice is welcome! :) Thanks in advance.

    You need a servlet/jsf component to render the image in the response.
    Look at this: http://www.irian.at/myfaces-sandbox/graphicImageDynamic.jsf

  • Display Image in Power View and Power BI

    Hi all,
    I need to create a report in power view where i need to display images in tile. I have found one solution to do so, to store the images as a binary data in data model table using the following link
    http://www.sharepointanalysthq.com/2014/09/adding-data-bound-images-to-power-view-with-power-query/comment-page-1/#comment-87049
    I tried this but still not able to show the images.
    Please anyone can help me with solution in detail.
    Thanks,
    Piyush Jain

    Hi Piyush,
    are you storing your Data in an Excel Power Pivot model?
    Make sure to follow step marking the column containing the Pictures as Data Type Binary.
    Are you using jpeg or another picture format?
    Best,
    Mark

  • Display image in reports6i

    Hi all:
    I store signature as images in my database , this column is LONG ROW,
    when i design the report i use a formula column and i set the follwing attributes:
    column type=formula
    datatype=character
    width=100
    read from file=yes
    file format=image
    pl/sql formula:
    function testFormula return Char is
    lsign long row;
    begin
    select signature into lsignature from TABLE_NAME;
    return lsign;
    end;
    but when the report is generated it display nothing!!!! what is the solution?
    thanks alot.

    I am not sure about LONG RAW, but this certainly works for BLOB columns.
    Add the column in your query.
    Create a field in your layout and select the image column as the source.
    In the item property palette choose Image for the file format (if this is not already the case).

  • Report - Unable to display image stored on External server

    Hi
    I need to display image on report that is on different instance for that i had put a formula column (in report 10g) and for that coloum i made file format as image and read from file as Yes and giving it the URL of Image stored on different server . but at run time for PDF output i am getting error like REP-1295: Data format of column 'CF_1' is unsupported
    Please help me , Thx in advance.
    Ranga

    From the documentation:
    URL Reference
    1.Insert a dummy image in your template.
    2.In Microsoft Word's Format Picture dialog box select the Web tab. Enter the following syntax in the Alternative text region to reference the image URL:
    url:{'http://image location'}
    For example, enter: url:{'http://www.oracle.com/images/ora_log.gif'}
    Element Reference from XML File
    1.Insert a dummy image in your template.
    2.In Microsoft Word's Format Picture dialog box select the Web tab. Enter the following syntax in the Alternative text region to reference the image URL:
    url:{IMAGE_LOCATION}
    where IMAGE_LOCATION is an element from your XML file that holds the full URL to the image.
    You can also build a URL based on multiple elements at runtime. Just use the concat function to build the URL string. For example:
    url:{concat(SERVER,'/',IMAGE_DIR,'/',IMAGE_FILE)}
    where SERVER, IMAGE_DIR, and IMAGE_FILE are element names from your XML file that hold the values to construct the URL.
    This method can also be used with the OA_MEDIA reference as follows:
    url:{concat('${OA_MEDIA}','/',IMAGE_FILE)}
    Edited by: stevencallan on Feb 13, 2009 3:50 PM

Maybe you are looking for

  • Too many bugs to isolate a bug when swithching from Alt-F1 to Alt-F7

    First, I consider Linux to be the less buggy OS out there. Well, Windows would be less buggy, but it does not really exist, since you have to pay to use it. Still, I use to consider Linux very buggy. This opinion I hold true more than ever. Here is m

  • Java.sql.connection problems

    Hi, I hav got this problem: PRB 1 I have got the JDBC connection established with the OracleDataSource instance on my java application I wonder if there is a way to check the connection if it is still alive. any hint? i tried connection.isClosed() bu

  • Just the phone thru apple bluetooth headset?  No BT for the iphone's ipod?

    Does anyone know how I can hear the ipod option of the iphone thru my apple bluetooth headset? It comes on briefly when swithing to the phone, but I don't know how to make it stay on.

  • Intercompany Sale

    Dear Experts, Scenario is Customer located in Germany One Company located in Korea Second company located in Germany We want to implement intercompany sale process for the below scenario ,Please suggest pros and cons Sales order on in Korea company =

  • Download from disk Elements 10

    I can't download Photoshop Elements 10 from Disk.  I am getting no usable instructions or prompts to use to unstal  the 3 disks.  I am very disapointed in instructions.