Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Graphics.clipRect() question

Posted on 1997-07-04
1
Medium Priority
?
282 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
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses

972 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