Solved

Graphics.clipRect() question

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

Independent Software Vendors: 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

Suggested Solutions

Title # Comments Views Activity
printf performancy 11 84
Is there a simpler dropbox system? 10 44
IBM TS2900 (3572) Tape Autoloader Java? 12 59
Java array sort 10 31
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
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 tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.

749 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