This example shows how to get the actual height and width of the image to use in scaling the image under java program control. |
import java.awt.* |
public void class Drawleaf extends java.applet.Applet |
{ Image leafimg; |
public void init ( ) |
{ leafimg = getImage(getCodeBase( ),"images/Leaf.gif"); |
} |
public void paint ( Graphics g ) |
{ g.setFont ( theFont ); |
g.drawString ( theDate.toString ( ), 10, 50 ); |
} |
} |