The Artima Developer Community
Sponsored Link

Java Answers Forum
graphics

2 replies on 1 page. Most recent reply: May 19, 2004 6:31 AM by Charles Bell

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 2 replies on 1 page
John

Posts: 1
Nickname: scias
Registered: May, 2004

graphics Posted: May 16, 2004 11:33 AM
Reply to this message Reply
Advertisement
Hi, I'm doing a project for school and am using graphics for it. I've created a large JPEG and my question is, is there a class with method that will allow me to display PART of the JPEG instead of the whole thing? Maybe a method that takes in some coordinates and displays a rectangle using part of the JPEG? Any answers are greatly appreciated. Thank you.


Daniel Ray

Posts: 53
Nickname: budoray
Registered: Oct, 2002

Re: graphics Posted: May 18, 2004 4:18 PM
Reply to this message Reply
Look at Graphics2D. There are ...clip methods and a copyArea that should help you.

Charles Bell

Posts: 519
Nickname: charles
Registered: Feb, 2002

Re: graphics Posted: May 19, 2004 6:31 AM
Reply to this message Reply
The Graphics class has a method for doing that:

drawImage(Image img, int x, int y, int width, int height, ImageObserver observer)

You get complete control of what gets drawn.

Flat View: This topic has 2 replies on 1 page
Topic: Problem with dynamic class generation... Previous Topic   Next Topic Topic: Could anyone help  me: table staff?

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use