Hi,

Here is the code segment I have for painting images into
a subclass of JComponent.

It paints color images ok, but for grayscale images, the
contrast or brightness of the displayed image is altered.
The problem seems to be casued by the setToScale(  )
method since if it is left out.  The image contrast and
brightness remain intact.

Can anyone point out what the problem is and how to get
around it?  Thanks in advance,

Terry

//****************************************
    public void paintComponent(Graphics g){
      super.paintComponent(g);
      Graphics2D g2d=(Graphics2D)g;

      int x, y;
      x=//code to calculate x
      y=//code to calculate y
      AffineTransform origin=new AffineTransform();
      origin.translate(x,y);
      AffineTransform magx=new AffineTransform();
      magx.setToScale(magnify, magnify);
      //magnify declared and calculated elsewhere
      origin.concatenate(magx);

      g2d.drawRenderedImage(image, origin);
    }


__________________________________________________
Do You Yahoo!?
Get email alerts & NEW webcam video instant messaging with Yahoo! Messenger. 
http://im.yahoo.com

===========================================================================
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