Solved

Graphics.clipRect() question

Posted on 1997-07-04
1
228 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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
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…
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …

744 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now