graphics.setClip(null)

Discussion in 'Java' started by Martijn Mulder, Mar 1, 2006.

  1. When I am done clipping the java.awt.Graphics object, is it ok to call
    Graphics.setClip(null) to remove all previous clipping areas and restore the
    Graphics object to its original state?
     
    Martijn Mulder, Mar 1, 2006
    #1
    1. Advertising

  2. Martijn Mulder

    Paul Hamaker Guest

    docs :getClipBounds()
    '..... If no clip has previously been set, or if the clip has been
    cleared using setClip(null), ....' would suggest that that's okay.
    --------------------
    Paul Hamaker, SEMM, teaching ICT since 1987
    http://javalessons.com
     
    Paul Hamaker, Mar 1, 2006
    #2
    1. Advertising

  3. Martijn Mulder

    Paul Hamaker Guest

    docs :getClipBounds()
    '..... If no clip has previously been set, or if the clip has been
    cleared using setClip(null), ....' would suggest that that's okay.
    --------------------
    Paul Hamaker, SEMM, teaching ICT since 1987
    http://javalessons.com
     
    Paul Hamaker, Mar 1, 2006
    #3
  4. Martijn Mulder wrote:
    > When I am done clipping the java.awt.Graphics object, is it ok to call
    > Graphics.setClip(null) to remove all previous clipping areas and restore the
    > Graphics object to its original state?


    This assumes that there was previously no clipping set. If there was a
    clipping set, then setClip(null) of course doesn't reset the object to
    its original state.

    /Thomas
    --
    The comp.lang.java.gui FAQ:
    ftp://ftp.cs.uu.nl/pub/NEWS.ANSWERS/computer-lang/java/gui/faq
    http://www.uni-giessen.de/faq/archiv/computer-lang.java.gui.faq/
     
    Thomas Weidenfeller, Mar 1, 2006
    #4
  5. On 2006-03-01, Martijn Mulder penned:
    > When I am done clipping the java.awt.Graphics object, is it ok to
    > call Graphics.setClip(null) to remove all previous clipping areas
    > and restore the Graphics object to its original state?
    >


    You can always save off the previous clip, then use Graphics.setClip()
    to put it back after you're done.

    --
    monique

    Ask smart questions, get good answers:
    http://www.catb.org/~esr/faqs/smart-questions.html
     
    Monique Y. Mudama, Mar 1, 2006
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Kivak Wolf
    Replies:
    2
    Views:
    10,106
    Kivak Wolf
    Jun 28, 2005
  2. vizlab
    Replies:
    3
    Views:
    4,256
    Michael Bar-Sinai
    Oct 17, 2007
  3. Seref Arikan
    Replies:
    3
    Views:
    2,413
    Andrew Thompson
    Jan 29, 2005
  4. Replies:
    5
    Views:
    27,260
    Mike Schilling
    Mar 29, 2006
  5. bob8000

    Graphics g = null

    bob8000, Mar 17, 2007, in forum: Java
    Replies:
    4
    Views:
    640
    Tor Iver Wilhelmsen
    Mar 22, 2007
Loading...

Share This Page