?
Solved

Drawing Image at different axis

Posted on 2005-05-08
4
Medium Priority
?
293 Views
Last Modified: 2010-03-31
Hi guys, this is more of a theory question but I'm trying to figure out how to draw an image out of the 0,0 axis.

when i draw the image, it seems to draw it at the upper left most corner? is there any way to draw the image anywhere on the applet but also have the entire applet available for that image?

drawImage(int,x,y,observer) where x and y are both set to 0 and if i change those numbers to 300,300 on a 600,600 applet, it'll draw the image space won't exist in the upper left hand corner.

hope my question made a bit of sense.
0
Comment
Question by:fuzzyfluid
  • 3
4 Comments
 
LVL 86

Accepted Solution

by:
CEHJ earned 200 total points
ID: 13957988
If you set a transform on the Graphics instance, you can set the translation:

http://java.sun.com/j2se/1.5.0/docs/api/java/awt/geom/AffineTransform.html
0
 

Author Comment

by:fuzzyfluid
ID: 13962702
Thanks for the advice. I'm toying with the idea right now.

if it's not too much trouble, because i just want to make sure we understand each other --

with transform,translation,and scale -- i can draw an image starting at a different origin, and possibly even take a piece of the image and scale it up onto the whole canvas?
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 13963701
Yep
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 14015316
:-)
0

Featured Post

[Webinar] Kill tickets & tabs using PowerShell

Are you tired of cycling through the same browser tabs everyday to close the same repetitive tickets? In this webinar JumpCloud will show how you can leverage RESTful APIs to build your own PowerShell modules to kill tickets & tabs using the PowerShell command Invoke-RestMethod.

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…
Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
Suggested Courses
Course of the Month4 days, 13 hours left to enroll

601 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