Results 1 to 2 of 2
  1. #1
    dialuppro is offline Member
    Join Date
    May 2010
    Rep Power

    Default How to draw 1/2 or 1/4 of a path2d.double

    I have a path2d.double that I am drawing on a JPanel with the simple


    Is there a way where I can draw 1/2 and 1/4 of this path only?
    Last edited by dialuppro; 05-05-2010 at 07:18 AM.

  2. #2
    rtc1 is offline Member
    Join Date
    May 2010
    northern california
    Rep Power

    Default PathIterator or Graphics2D.clip()

    I don't know how precisely you want to control the fraction of your path which is drawn, but two approaches that come to mind include:

    1) Using a PathIterator to sequence through the path's segments and drawing only those you wish to draw, and

    2) Clipping the current graphics context using Graphics2D.clip() or Graphics.clipRect() prior to drawing. Shapes, and in particular, Areas (which is-a Shape) are used to specify the region that will not be drawn.

Similar Threads

  1. double a * double b = weird output
    By GPB in forum New To Java
    Replies: 3
    Last Post: 03-26-2010, 11:40 AM
  2. Check if double is double
    By marshalthrone in forum New To Java
    Replies: 8
    Last Post: 09-30-2009, 03:51 PM
  3. how to draw an arc
    By Baker in forum New To Java
    Replies: 1
    Last Post: 04-16-2009, 10:05 PM
  4. Replies: 5
    Last Post: 03-21-2009, 10:32 PM
  5. Double.valueOf() vs Double.parseDouble()
    By greenbean in forum New To Java
    Replies: 10
    Last Post: 01-12-2009, 09:39 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