问题描述
|
在LWUIT的文档中,有一个createImage方法,该方法从MIDP本机图像(公共静态图像createImage(java.lang.Object nativeImage))创建LWUIT Image对象。
我想知道如何实现java.lang.Object参数,以便将MIDP本机图像设置为方法的参数?例如,我从相机(
byte[] rawImage = myVideoControl.getSnapshot(null);
)捕获照片,并在文件系统中创建图像文件:
myFileConnection = (FileConnection) Connector.open(\"file:///\"+pRoot+photoDirectory+\"/\"+photoName);
myFileConnection.openOutputStream().write(rawImage);
。那么如何将Object参数传递给createImage方法呢?
解决方法
Image img = Image.createImage(myFileConnection.openInputStream());
编辑:
看到
javax.microedition.lcdui.Image img = javax.microedition.lcdui.Image.createImage(\"/images/card.png\");
com.sun.lwuit.Image ii = com.sun.lwuit.Image.createImage(img);