Results 1 to 4 of 4

Thread: image display

  1. #1
    asmitarnd is offline Member
    Join Date
    Mar 2011
    Posts
    22
    Rep Power
    0

    Cool image display

    Hi frnds,
    i M TRYING TO DISPLAY MULTIPLE IMAGES ON A SINGLE FRAME BUT I M UNABLE TO DO THAT.I AM ABLE TO DISPLAY ONLY A SINGLE IMAGE.CAN ANYONE HELP ME TO DO THIS?
    I HAVE TRIED WITH THIS

    public void paint(Graphics g)
    {
    String [] files ={ "D:\\rnd\\testImages\\test.jpg","D:\\rnd\\testImag es\\test1.jpg" };

    BufferedImage[] images = new BufferedImage[files.length];
    int i;
    for(i = 0; i < files.length; i++)
    {
    try
    {

    images[i] = ImageIO.read(new File(files[i]));
    System.out.println("i m here");
    }


    catch(Exception e)
    {
    System.out.println("Cant find file " +files[i]);
    }
    }
    AffineTransform at = AffineTransform.getScaleInstance(currentRate, currentRate);
    g2=(Graphics2D)g;
    int i1;

    for( i1=0; i1<images.length;i1++)
    {
    //g2=images.createGraphics();
    g2.drawImage(images[i],at,null);
    }
    }


    FURTHER I HAVE CREATED ANOTHER CLASS WHERE I HAVE JUST CREATED FRAME AND INVOKED ABOVE CONSTRUCTOR.PLZ DO REPLY AS SOON AS POSSIBLE

  2. #2
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,452
    Rep Power
    20

    Default

    WHAT'S WITH ALL THE CAPITAL LETTERS?

    How to ask questions the smart way

    DB

  3. #3
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,452
    Rep Power
    20

    Default

    Also, you already have a thread for the question.
    to display image

    Reporting this double post.

    db

  4. #4
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,315
    Blog Entries
    1
    Rep Power
    26

Similar Threads

  1. to display image
    By asmitarnd in forum AWT / Swing
    Replies: 6
    Last Post: 04-07-2011, 12:17 PM
  2. Display image from filesystem
    By Pmarcoen in forum CLDC and MIDP
    Replies: 2
    Last Post: 08-31-2009, 12:00 PM
  3. how to read an image and display
    By santhosh_el in forum AWT / Swing
    Replies: 2
    Last Post: 04-04-2009, 01:43 PM
  4. How to display image ?
    By Birkoff in forum AWT / Swing
    Replies: 7
    Last Post: 06-09-2008, 08:58 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •