[660] in java-interest

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

Re: novice DIBitmap question

daemon@ATHENA.MIT.EDU (Phil Andrews)
Wed Jul 12 12:57:10 1995

Date: Wed, 12 Jul 1995 11:38:30 -0400
From: andrews@ajax.psc.edu (Phil Andrews)
To: masek@GEOLOGY.GEO.CORNELL.EDU
Cc: java-interest@java.Eng.Sun.COM


 From: masek@GEOLOGY.GEO.CORNELL.EDU (jeff masek)
> Subject: novice DIBitmap question
 
> This is a fairly simple problem, but I can't seem to get it to
> work...Having created a valid DIBitmap object, how do I get it to display
> on the screen?
> 
> Right now I've got the following (unsucessful code) in an update method:
>         
>                 im = createImage(500,500);
>                 myDisplayItem = new ImageDisplayItem(im);
>                 myDisplayItem.setImage(myBitMap); 
>                 myDisplayItem.paint(im.win,0,0);

I went through a similar process and ended up displaying a DIBitmap by 
delaying the creation of the image until the paint method handed me a Graphics 
object g. I then created an image with 
	if (myImage == null) myImage = g.drawSurface.createImage(myDIBitmap);
and displayed it with 
	g.drawImage(myImage, x, y);
then storing it away for the next time paint was called.
No idea if it's a recommended procedure, but it's presently working.

-Phil Andrews, andrews@psc.edu
-
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