Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Graphics .setClip()

Status
Not open for further replies.

borbjo

Programmer
Mar 29, 2002
33
NO
I have a Graphics2D object that has a clip set. If I do a System.out.println(g2d.getClip()) I get this:

java.awt.geom.Rectangle2D$Float[x=0.0,y=0.0,w=594.0,h=841.0]

The graphics object is also scaled.

The image I am drawing using g2d.drawImage(image,x,y,this) is larger than the clip.

I expect everything outside the clip not to be drawn. This does not happen - the image is drawn outside the clip.

Why doesn't drawImage() care about the clip?

The image is located in a JInternalFrame.

If I do a tab to switch from the java application to another app, and then go back, the image is drawn even outside the JInternalFrame.

It seems to behave very strange. Any hints on what to look into here?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top