Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Graphics.clipRect() question

Posted on 1997-07-04
1
Medium Priority
?
275 Views
Last Modified: 2012-06-21
Quote from Visual J++ documentation for Graphics.clipRect():

clipRect(int  x, int  y, int  width, int  height)

Sets a clipping rectangle for this graphics context. The resulting clipping area is the intersection of the current clipping area and the specified rectangle.

[end of quote]
If the above is true, then it means once you set a clipping area, you cannot make it bigger, only smaller.  Is there a way to reset the clipping area of an existing Graphics object ?
0
Comment
Question by:byang
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 1

Accepted Solution

by:
mann061997 earned 30 total points
ID: 1222669
Under jdk 1.02, you have to .create() a new Graphics for the smaller
area and dispose it when you need to paint a larger region (and go back
and use the not-so-clipped Graphics), because there is no way to make it
larger.

Under jdk 1.1, you can use setClip, which unlike clipRect, does not
intersect the specified bounds (or shape) with the previous bounds, so
you can use it to expand the region as well as contracting it.
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
The viewer will learn how to implement Singleton Design Pattern in Java.
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
Suggested Courses

670 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question