Results 1 to 8 of 8
  1. #1
    dorairaj is offline Member
    Join Date
    Jan 2009
    Location
    Hyderabad,India.
    Posts
    13
    Rep Power
    0

    Default Rotated Shape Object Line weight is not retaining properly in printing

    Hi All,

    I have two rectangle objects one has rotated with 45 degrees another one is without rotation both are have double line thickness. while printing ,the one which is not rotated is printing correctly and another one(rotated shape) is printing thin lines.
    Pls suggest me to overcome this issue.

    Thanks in Adance.
    Last edited by dorairaj; 10-06-2009 at 05:59 AM.

  2. #2
    r035198x is offline Senior Member
    Join Date
    Aug 2009
    Posts
    2,388
    Rep Power
    8

    Default

    ... and we are supposed to guess what the problem is without seeing any code?

  3. #3
    dorairaj is offline Member
    Join Date
    Jan 2009
    Location
    Hyderabad,India.
    Posts
    13
    Rep Power
    0

    Default

    The following code snipet i have used.

    Rectangle2D rect = new Rectangle2D.Double(
    200, 200, 100, 100);
    graphics2DArg.setStroke(new BasicStroke(
    2));
    graphics2DArg.draw(rect);
    Rectangle2D rotatedRect = new Rectangle2D.Double(
    200, 200, 100, 100);
    double localTheta = 45;
    AffineTransform affinTransform = graphics2DArg.getTransform();
    localTheta = Math.toRadians(localTheta);
    graphics2DArg.rotate(localTheta, rotatedRect.getCenterX(), rotatedRect
    .getCenterY());

    graphics2DArg.draw(rotatedRect);
    graphics2DArg.setTransform(affinTransform);


    The One which is not rotated appears normally (double line thickness), and the one which is rotated appears thin(Happening in only printing).
    Last edited by dorairaj; 09-07-2009 at 05:51 AM.

  4. #4
    dorairaj is offline Member
    Join Date
    Jan 2009
    Location
    Hyderabad,India.
    Posts
    13
    Rep Power
    0

    Default

    Hellow,
    Pls any one can suggest me....

  5. #5
    dorairaj is offline Member
    Join Date
    Jan 2009
    Location
    Hyderabad,India.
    Posts
    13
    Rep Power
    0

    Default

    Tiil now this question has no answer....
    Where is the Experts?.....
    Pls suggest....

  6. #6
    zweibieren is offline Senior Member
    Join Date
    Aug 2009
    Location
    Pittsburgh, PA
    Posts
    284
    Rep Power
    6

    Default

    I've often found that diagonal lines appear thinner than orthogonals of the same width.

    The API for BasicStroke says this:
    When a line is diagonal, the exact width depends on how the rendering pipeline chooses which pixels to fill as it traces the theoretical widened outline. The choice of which pixels to turn on is affected by the antialiasing attribute because the antialiasing rendering pipeline can choose to color partially-covered pixels.
    java.sun.com/j2se/1.5.0/docs/api/java/awt/BasicStroke.html

    You might try setting the width to something like 2.4. On orthogonal lines this might round down to 2 whereas it could round up on diagonal lines.

  7. #7
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,423
    Rep Power
    20

  8. #8
    dorairaj is offline Member
    Join Date
    Jan 2009
    Location
    Hyderabad,India.
    Posts
    13
    Rep Power
    0

    Default

    I did't get the solutions, i tried alot as my best
    any solution around this will deeply appriciated.

Similar Threads

  1. how to select Shape object after rotation.
    By dorairaj in forum AWT / Swing
    Replies: 5
    Last Post: 08-14-2009, 03:28 PM
  2. Log4j not printing out file and line number
    By devin in forum Java Servlet
    Replies: 2
    Last Post: 03-05-2009, 03:16 PM
  3. Replies: 4
    Last Post: 01-10-2009, 12:17 AM
  4. Issue with printing line
    By Azndaddy in forum Advanced Java
    Replies: 1
    Last Post: 04-04-2008, 07:37 PM
  5. Printing command line arguments
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 12-03-2007, 09:27 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •