[133] in java-interest

home help back first fref pref prev next nref lref last post

awt.ImageDisplayItem bug?

daemon@ATHENA.MIT.EDU (Tejaswi Kasturi)
Sat May 27 21:20:00 1995

Date: Sat, 27 May 1995 17:52:38 -0700 (PDT)
From: Tejaswi Kasturi <kasturi@ccsf.caltech.edu>
To: java-interest@java.Eng.Sun.COM

I am having problems with ImageDisplayItem and DIBitmaps.  If I use its 
method ImageDisplayItem.setImage(DIBitmap dib), it doesn't seem to set 
the image at all.  For example, look at the following applet:

    import browser.Applet;    
    import java.lang.*;
    import awt.*;
    class HelloWorld extends Applet {
		Image aukie;
		ImageDisplayItem indaukie;
		DIBitmap bmpin;
		Image grayaukie;

             public void init() {
                resize(320,160);
		aukie = getImage("tinycitlogo.gif");
		bmpin = aukie.getDIBitmap();
		indaukie = new ImageDisplayItem(null);
		indaukie.resizeFromImage(aukie);
		indaukie.setImage(bmpin);
		grayaukie = indaukie.getImage();
		
             }
             public void paint(Graphics g) {
		g.drawImage(aukie,0,0);
		g.drawImage(grayaukie,160,0);
	     }
     }


This should load an image, convert the image to a DIBitmap, then load the 
DIBitmap into an ImageDisplayItem, then pull the Image out of the 
ImageDisplayItem into another Image, then display both side by side.  
However, it only displays the first image (which was loaded with 
getImage).  If I used indaukie.getImage(aukie), it works fine.

I want to use DIBitmaps so I can work with the raster image itself (so I can 
do image processing on images within hotjava).  If anyone has any better 
ways to do this, please tell me! (i.e., ways to edit the pixels in an 
Image without conversion to DIBitmaps, or ways to display DIBitmaps 
without conversion back to Images)  Thanks very much.

					/// Tej \\\\
----------------------------------
Tejaswi Kasturi    **      CACR Student Operator  **  kasturi@cacr.caltech.edu
Junior, Electrical Engineering Major ** The California Institute of Technology 
SGC: 94 SC1m AM A F S- C+ AB-- P+ SR L- AU+c 7K    **     User of OS/2 Warp v3
WWW Home Page: http://www.ccsf.caltech.edu/~kasturi

-
Note to Sun employees: this is an EXTERNAL mailing list!
Info: send 'help' to java-interest-request@java.sun.com

home help back first fref pref prev next nref lref last post