display bmp images using JLabel

Discussion in 'Java' started by SJ L via JavaKB.com, Oct 7, 2005.

  1. Hello, I am trying to write a viewer that is able to read/display bmp, jpg,
    gif and png files. Currently, my program is unable to read bmp files! Help!

    ImageIcon ii = new ImageIcon(str);
    CustomScrollPane sp = new CustomScrollPane(new JLabel(ii));

    where did i go wrong... using the above code i am able to read jpg, gif and
    png!


    --
    Message posted via JavaKB.com
    http://www.javakb.com/Uwe/Forums.aspx/java-general/200510/1
    SJ L via JavaKB.com, Oct 7, 2005
    #1
    1. Advertising

  2. SJ L via JavaKB.com wrote:

    > Hello, I am trying to write a viewer that is able to read/display bmp, jpg,
    > gif and png files. Currently, my program is unable to read bmp files!


    PNG, JPEG and GIF are supported. BMP is not. To read
    Windows (and other more specialist) formats, you will
    need to turn to something like JAI.

    Of course, if you control the BMP's, you might convert
    them to one of the three formats that the core classes
    understand.
    Andrew Thompson, Oct 7, 2005
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Harry Simpson

    32 dpp BMP to 24dpp BMP??

    Harry Simpson, Oct 30, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    328
    Harry Simpson
    Oct 30, 2003
  2. Riri
    Replies:
    2
    Views:
    3,972
    Thomas Weidenfeller
    Jan 21, 2004
  3. Replies:
    5
    Views:
    3,009
    Andrew Thompson
    Dec 26, 2005
  4. Replies:
    0
    Views:
    270
  5. Niks

    Save BMP images through C

    Niks, Feb 13, 2006, in forum: C Programming
    Replies:
    4
    Views:
    819
Loading...

Share This Page