Importing a pic
Author |
Message |
xHoly-Divinity
|
Posted: Sat Oct 29, 2005 1:44 pm Post subject: Importing a pic |
|
|
Suppose I had a pic name "box.gif" and I am using hsa console (our teacher wants us to use it), how would I import this box image. Could someone give me an example of how to draw it. |
|
|
|
|
![](images/spacer.gif) |
Sponsor Sponsor
![Sponsor Sponsor](templates/subSilver/images/ranks/stars_rank5.gif)
|
|
![](images/spacer.gif) |
rizzix
|
Posted: Sat Oct 29, 2005 2:21 pm Post subject: (No subject) |
|
|
code: | BufferedImage img = javax.imageio.ImageIO.read(new File("/path/to/image.gif"));
g.drawImage(img, x, y, null); |
where g is ur graphics2d object |
|
|
|
|
![](images/spacer.gif) |
[Gandalf]
![](http://compsci.ca/v3/uploads/user_avatars/189297994e4c716fec7f1.png)
|
Posted: Sun Dec 28, 2008 11:47 pm Post subject: RE:Importing a pic |
|
|
In the future, don't necro post in old topics, especially ones over 3 years old like this one. Also, you can google the class in the future to find out what package it's located in:
Searching for: "java BufferedImage" gives you this as the first result, which tells you that BufferedImage is in java.awt.image. |
|
|
|
|
![](images/spacer.gif) |
TheHobbit
|
Posted: Sun Dec 28, 2008 11:57 pm Post subject: Re: Importing a pic |
|
|
haha, oh jeez, i didnt even look at the time stamps, my bad ![Surprised Surprised](http://compsci.ca/v3/images/smiles/icon_surprised.gif) |
|
|
|
|
![](images/spacer.gif) |
|
|