Do you have a specific question or do we need to guess?
If you want further help post a Short, Self Contained, Compilable and Executable, Example Program ([url http://homepage1.nifty.com/algafield/sscce.html]SSCCE[/url]) that demonstrates the problem.
And don't forget to use code formatting when posting code
http://forum.java.sun.com/help.jspa?sec=formatting
Graphics2D bufferGraphics;
Image offscreen;
offscreen=getImage(getDocumentBase(),"india.gif");
bufferGraphics = (Graphics2D)offscreen.getGraphics();
bufferGraphics.drawString(..)
bufferGraphics.drawLine(..)
--
But how to ?
--
bufferGraphics.drawImage(?)?
Thanks in advance
You need to create a Graphics object
import java.awt.*;
import java.applet.*;
public class This extends Applet
{
Image offscreen;
Graphics2D bg2;
public void init()
{
setSize(800, 600);
offscreen = createImage(getWidth(), getHeight());
bg2 = (Graphics2D)offscreen.getGraphics();
}
public void paint(Graphics g)
{
bg2.fillOval(50,50,500,500);
g.drawImage(offscreen,0,0,this);
}
}
Message was edited by:
keseldude
> Graphics2D bufferGraphics;
> Image offscreen;
>
>
> offscreen=getImage(getDocumentBase(),"india.gif");
> bufferGraphics =
> (Graphics2D)offscreen.getGraphics();
>
> i m able to draw only shapes but not image in this
>
> so how can i ?
try it thusly
Image indiaImage = getAppletContext().getImage(new URL(getCodeBase(),"india.gif") );
Then try drawing it.
(T)