What's the difference between drawIamge and drawString?
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Ajonbin_Huang
Posted On:   Saturday, May 24, 2003 09:51 AM

hi all: public void run() { m_graphics = m_imgGame.getGraphics(); m_graphics.drawImage(m_image,m_startx,m_starty,m_graphics.TOP|m_graphics.LEFT); m_startx ++; m_starty ++; m_canvas.repaint(m_startx ,m_starty,15,15); try { Thread.sleep(10); } catch(Exception e) { } } public void paint() { g.setColor(0x00ffffff); g.fillRect(0,0,getWidth(),getHeight()); g.drawImage(m_imgGame, 0,0, g.TOP|g.LEFT); }    More>>

hi all:


public void run()


{


m_graphics = m_imgGame.getGraphics();



m_graphics.drawImage(m_image,m_startx,m_starty,m_graphics.TOP|m_graphics.LEFT);
m_startx ++;


m_starty ++;


m_canvas.repaint(m_startx ,m_starty,15,15);


try


{


Thread.sleep(10);


}


catch(Exception e)


{


}


}


public void paint()


{


g.setColor(0x00ffffff);


g.fillRect(0,0,getWidth(),getHeight());


g.drawImage(m_imgGame,


0,0,


g.TOP|g.LEFT);


}



I suppose that the m_image I drawn at the first position won't be erased,because I dont clean the m_imgGame.But it seem the m_image drawn was erased.


But if I call drawSting("hello",m_startx,m_starty,m_graphics.TOP|m_graphics.LEFT),the "hello" drawn was not erased. why ??


what's the difference between drawString and drawImage?

   <<Less
About | Sitemap | Contact