Solved

Graphics.clipRect() question

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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
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…
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.

635 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