> This isn't strictly a Java2D question, but I thought someone here might know
> the answer ...
>
> I'm drawing grayscale images into an offscreen BufferedImage and then using
> drawImage to display them in the paint (or paintComponent) event.  I set the
> FORCEGRAYS environment variable to ensure the maximum number of grays in the
> palette.  I find that if I use a buffered image created as follows
>
>   m_image = new
>  java.awt.image.BufferedImage(xDim,yDim,
>  java.awt.image.BufferedImage.TYPE_BYTE_INDEXED,m_icm);
>
> performance is awful, but I get a gray ramp which makes use of all the
> available grays.

Which part of the performance is awful?  Drawing into the BufferedImage or
drawing the BufferedImage to the screen or both?


> When I create the BufferedImage as follows
>
>   m_image = new
>  java.awt.image.BufferedImage(xDim,yDim,
>  java.awt.image.BufferedImage.TYPE_BYTE_GRAY);
>
> performance is better by a factor of almost 4, but the ramp is streaky, since
> not all the available grays are used.

Do you have a sample test program?  What kind of video card are you using?


Jerry

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA2D-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to