how can i let picture rotate in my degree??
is it fullcanvas only can rotate in 90,180,270 ??
Printable View
how can i let picture rotate in my degree??
is it fullcanvas only can rotate in 90,180,270 ??
You need to use the com.nokia.mid.ui.DirectGraphics class to do that as it is not supported in MIDP 1.0:
[code]
import com.nokia.mid.ui.DirectGraphics;
import com.nokia.mid.ui.DirectUtils;
import javax.microedition.lcdui.Image;
// ....
// load the original image
Image originalImage = Image.createImage("/res/somepicture.png");
// create a mutable image to hold the rotated image
Image rotatedImage = Image.createImage(originalImage.getWidth(),originalImage.getHeight());
// get the reference to the new image's DirectGraphics object
DirectGraphics dg = DirectUtils.getDirectGraphics(rotatedImage.getGraphics());
// draw the original image using dg's image manipulation (the last parameter)
dg.drawImage(originalImage,0,0,Graphics.TOP|Graphics.LEFT,DirectGraphics.ROTATE_90);
[/code]