2011-01-05 67 views

回答

4

在J2ME中,你可以在以下兩種方式顯示圖像:

Image image = Image.createImage(path_to_img+"/img.PNG"); 

g.drawImage(image, x, y, Graphics.TOP | Graphics.LEFT); // 1) Use drawImage function. 

Sprite mainSprite = new Sprite(image); // 2) Use Sprite to display your image. 
mainSprite.setRefPixelPosition(x, y); 
mainSprite.paint(g); 

希望這有助於。

+0

請問這是一樣的這個myImage = graphics.Image.open(jobDirectory +「\」+ name)? – JohnDoe4136 2011-01-05 05:16:50

+0

什麼是「myImage = graphics.Image.open(jobDirectory +」\「+ name)」的確如此?在J2ME中,通過如上所述的圖像將在屏幕上顯示在特定的x,y位置。 – 2011-01-05 05:28:46

+0

它只是打開一個靜止圖像文件,而沒有實際處理,因爲它們是故意突變的。 – JohnDoe4136 2011-01-05 05:34:43