harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Igor V. Stolyarov (JIRA)" <j...@apache.org>
Subject [jira] Created: (HARMONY-5044) [classlib][awt] Drawing Images with Affine Transformation on BufferedIame works incorrectly.
Date Tue, 30 Oct 2007 15:11:50 GMT
[classlib][awt] Drawing Images with Affine Transformation on BufferedIame works incorrectly.
--------------------------------------------------------------------------------------------

                 Key: HARMONY-5044
                 URL: https://issues.apache.org/jira/browse/HARMONY-5044
             Project: Harmony
          Issue Type: Bug
          Components: Classlib
            Reporter: Igor V. Stolyarov
         Attachments: Harmony.JPG, RI.JPG

Drawing Images with Affine Transformation on BufferedIame works incorrectly

Simple reproducer:
import java.io.*; 
import java.awt.*; 
import java.awt.geom.*; 
import java.awt.image.*; 
import javax.swing.*; 

public class TransformTest extends JFrame { 
    public BufferedImage im1, im2; 
    public static void main(String[] args){ 
        TransformTest aTest = new TransformTest(); 
        aTest.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); 
        aTest.setSize(400, 300); 
        aTest.setVisible(true);
    } 

    public TransformTest(){
        im1 = new BufferedImage(200, 200, BufferedImage.TYPE_INT_RGB);
        im2 = new BufferedImage(100, 100, BufferedImage.TYPE_INT_ARGB);
    } 

    public void paint(Graphics g){ 
       Graphics2D _g2d = im2.createGraphics();
       _g2d.setColor(new Color(255, 0, 0, 127));
       _g2d.fillRect(0, 0, 100, 100);
       Graphics2D g2d = im1.createGraphics();
       g2d.setColor(Color.white);
       g2d.fillRect(0, 0, 200, 200);
       AffineTransform at = new AffineTransform();
       at.setToRotation(Math.PI/4);
       g2d.setTransform(at);
       g2d.drawImage(im2, 50, 50, null); 
       g.drawImage(im1, 30, 30, null); 
    } 
}


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message