I have a java applet that draws top left x,y(0,0) to bottom right x,y(500,500). How would I go about having that same applet draw what is located in top left x,y(500,0) to bottom right x,y(1000,500)?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You have alot of methods available in the Graphics class called drawImage.
I believe this is the one you are after which is able to draw a particular part of an image at a particular place on a canvas.
Edit: Based on your comment I would suggest that you draw your map to an Image and then use the drawImage method to draw the image from a specified offset. Every time your offset is changed, draw the image from that location instead.