setClip and drawImage draws over parent

Discussion in 'Java' started by Seref Arikan, Jan 24, 2005.

  1. Seref Arikan

    Seref Arikan Guest

    Hi,
    I am currently experimenting with java 2d, and my simple test program shows
    odd behaviour (maybe my fault?).
    I am using double buffering, and when i use drawimage to draw the offscreen
    image to real screen, the image is drawn "over" the parent jscrollpane. The
    GUI is structured like this: there is a jframe which contains a jscrollpane,
    which contains a jpanel (actually a custom class that's inherited from
    jpanel ). I am drawing on jPanel, and if i use setclip to copy only the
    shape from offscreen image, the shape is drawn over scrollbars.
    If i use getSubImage to take only a part of offscreen image, and NOT use
    clipping for the jPanel, i don't have any problems, and i get rid of the
    flickering.
    So my question is, why setClip uses all area on screen, painting even on
    parent control ? How do i avoid it ?
    Best Regards
    Seref Arikan, Jan 24, 2005
    #1
    1. Advertising

  2. Andrew Thompson, Jan 25, 2005
    #2
    1. Advertising

  3. Seref Arikan

    Seref Arikan Guest

    Hi,
    You're right, that was not a proper way to ask for help. Sorry, i was really
    tired. I'll post again with some example code.
    Thanks for the links by the way
    Regards.

    "Andrew Thompson" <> wrote in message
    news:16isl0gn4u2e7.1mod4kk3jz9fd$...
    > On Mon, 24 Jan 2005 17:58:23 +0200, Seref Arikan wrote:
    >
    >> The GUI is structured like this:

    >
    > The best way to describe it is like this
    > <http://www.physci.org/codes/sscce.jsp>
    >
    > [ And c.l.j.gui the best goup for this type of question
    > <http://www.physci.org/codes/javafaq.jsp#cljg> ]
    >
    > --
    > Andrew Thompson
    > http://www.PhySci.org/codes/ Web & IT Help
    > http://www.PhySci.org/ Open-source software suite
    > http://www.1point1C.org/ Science & Technology
    > http://www.LensEscapes.com/ Images that escape the mundane
    Seref Arikan, Jan 25, 2005
    #3
  4. On Tue, 25 Jan 2005 17:51:25 +0200, Seref Arikan wrote:

    > You're right, that was not a proper way to ask for help.


    I would actually not call it 'improper' with all the baggage that
    expression carries. Simply 'not the optimal way to obtain assistance
    on a technical problem'.

    >..Sorry, i was really tired.


    Get some sleep. You have to look after your health first.

    >..I'll post again with some example code.


    I look forward to it.

    > Thanks for the links by the way


    You're welcome, I hope it helps to guide you to a resolution.

    --
    Andrew Thompson
    http://www.PhySci.org/codes/ Web & IT Help
    http://www.PhySci.org/ Open-source software suite
    http://www.1point1C.org/ Science & Technology
    http://www.LensEscapes.com/ Images that escape the mundane
    Andrew Thompson, Jan 29, 2005
    #4
    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. Michele Puccini
    Replies:
    0
    Views:
    385
    Michele Puccini
    Nov 9, 2003
  2. Inertia_sublimation
    Replies:
    5
    Views:
    2,101
    Inertia_sublimation
    Jan 3, 2004
  3. Martijn Mulder

    graphics.setClip(null)

    Martijn Mulder, Mar 1, 2006, in forum: Java
    Replies:
    4
    Views:
    831
    Monique Y. Mudama
    Mar 1, 2006
  4. MarionEll
    Replies:
    0
    Views:
    417
    MarionEll
    Dec 1, 2003
  5. Bernhard Walle

    [OT] Perl Code which draws camel

    Bernhard Walle, Feb 1, 2005, in forum: Perl Misc
    Replies:
    7
    Views:
    290
Loading...

Share This Page