Results 1 to 3 of 3
Thread: [SOLVED] AffineTransform
- 03-24-2009, 04:58 PM #1
Member
- Join Date
- Feb 2009
- Posts
- 14
- Rep Power
- 0
[SOLVED] AffineTransform
Hello all,
I'm back with another problem. I cannot get the following method to compile. Can you help?
Java Code:public Picture shear(double xFactor, double yFactor) { // set up the shear transform AffineTransform shearTransform = new AffineTransform(); shearTransform.shear(xFactor,yFactor); Rectangle2D rect = getTranslationEnclosingRectangle(shearTransform); /* create a new picture object big enough to hold the * result */ Picture result = new Picture ( (int) (Math.ceil(rect.getWidth())), (int) (Math.ceil(rect.getHeight()))); // get the graphics 2D object from the result Graphics graphics = result.getGraphics(); Graphics2D g2 = (Graphics2D) graphics; /* save the current transformation and set up to * center the new image */ AffineTransform savedTrans = g2.getTransform(); AffineTransform centerTrans = new AffineTransform(); centerTrans.translate(0 - rect.getX(), 0 - rect.getY()); g2.setTransform(centerTrans); // draw the current MH onto the result image sheared g2.drawImage(this.getImage(),shearTransform,null); // g reason that2 transformation to the saved one g2.setTransform(savedTrans); return result; } //end of shear method
The error message in the interactions pane is:
Error: C:\Users\Jim\Documents\Heidelberg\Spring2009\myjav a\cps201\Picture.java:2122: cannot find symbol
symbol : method getTranslationEnclosingRectangle(java.awt.geom.Aff ineTransform)
location: class Picture
- 03-25-2009, 05:24 PM #2
Your compiler is saying it cannot find a method in the Picture class with the following signature:
Java Code:Rectangle2D getTranslationEnclosingRectangle(AffineTransform at)
- 03-25-2009, 05:54 PM #3
Member
- Join Date
- Feb 2009
- Posts
- 14
- Rep Power
- 0
Similar Threads
-
AffineTransform help
By tones in forum New To JavaReplies: 4Last Post: 12-19-2008, 07:24 AM -
AffineTransform demo
By Java Tip in forum java.awtReplies: 0Last Post: 06-22-2008, 10:59 PM -
affineTransform rotation
By MichYer in forum AWT / SwingReplies: 0Last Post: 07-18-2007, 08:55 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks