如何从 MIDP 本机映像创建 LWUIT Image 对象?

发布于 2024-11-16 16:42:50 字数 526 浏览 3 评论 0原文

在 LWUIT 的文档中,有 createImage 方法,它从 MIDP 本机映像创建 LWUIT Image 对象( public static Image createImage(java.lang.Object nativeImage) )。

我想知道如何实现 java.lang.Object 参数,以便将 MIDP 本机图像设置为该方法的参数?例如,我从相机捕获照片( byte[] rawImage = myVideoControl.getSnapshot(null); ),并在文件系统中创建图像文件:

myFileConnection = (FileConnection) Connector.open("file:///"+pRoot+photoDirectory+"/"+photoName);

myFileConnection.openOutputStream().write (原始图像);

.那么如何将Object参数传递给createImage方法呢?

In the documentation of LWUIT there is the createImage method which creates a LWUIT Image object from a MIDP native image ( public static Image createImage(java.lang.Object nativeImage) ).

I want to know how to implement the java.lang.Object parameter in order to set a MIDP native image as the parameter of the method ? For example I capture a photo from the camera ( byte[] rawImage = myVideoControl.getSnapshot(null); ) and I create the image file in the filesystem :

myFileConnection = (FileConnection) Connector.open("file:///"+pRoot+photoDirectory+"/"+photoName);

myFileConnection.openOutputStream().write(rawImage);

. So how to pass the Object parameter to the createImage method ?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

饭团 2024-11-23 16:42:50
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);
Image img = Image.createImage(myFileConnection.openInputStream());

EDIT:
see

javax.microedition.lcdui.Image img = javax.microedition.lcdui.Image.createImage("/images/card.png");
            com.sun.lwuit.Image ii = com.sun.lwuit.Image.createImage(img);
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文