ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

Dispalying Image from pixel array

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Dispalying Image from pixel array

    Hai all,
    In my program I create and display image from a pixel array and the code works fine for images having size upto 800*800 , but larger images are not getting displayed correctly. When I try to display a larger image it is showing something like our TV Screen shows when some problems are there in telecast!
    My code looks like:

    image = createImage(
    new MemoryImageSource(maxX, maxY, pixels, 0, maxY));

    JFrame jf = new JFrame("image display");
    jf.setSize(maxX,maxY);
    jf.setLocationRelativeTo(null);
    jf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    Container parentpanel= jf.getContentPane();

    parentpanel.setLayout(null);
    ImageIcon icon = new ImageIcon(image);


    JLabel jl = new JLabel(icon);
    jl.setBounds(0,0,1500,800);
    parentpanel.add(jl);

    jf.setVisible(true);

    Anyone please help me . Itried to display the image with the paint method's drawImage method, the result was the same!

    Regards,
    Meera
Working...
X