如何在使用 LWUIT 时使用 MMAPI 在 J2me 中拍摄快照

发布于 2024-11-29 07:18:16 字数 408 浏览 4 评论 0原文

我想制作一个从相机拍摄快照并将其发送到服务器的应用程序。我可以使用 MediaPlayer 在 Highlevel UI 中轻松完成此操作,但似乎我无法在 LWUIT 中使用相同的代码。

VideoControl vc;

Item videoItem = (Item) vc.initDisplayMode(vc.USE_GUI_PRIMITIVE, null);

由于它不起作用,我使用了 MediaComponent。

MediaComponent videoItem =  (MediaComponent) vc.initDisplayMode(vc.USE_GUI_PRIMITIVE, null);

但它也不起作用。抛出类转换异常。您能告诉我如何实施吗?

I want to make an application that takes a snapshot from Camera and send it to the server. I can do this pretty easily in Highlevel UI using MediaPlayer but it seem that I can't use the same code in LWUIT.

VideoControl vc;

Item videoItem = (Item) vc.initDisplayMode(vc.USE_GUI_PRIMITIVE, null);

Since it didn't work I used the MediaComponent.

MediaComponent videoItem =  (MediaComponent) vc.initDisplayMode(vc.USE_GUI_PRIMITIVE, null);

but it didn't work either. A class cast exception is thrown. Can you please tell me how to implement it.

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

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

发布评论

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

评论(1

剩一世无双 2024-12-06 07:18:16

您不需要为 LWUIT 调用 initDisplayMode。这是由 LWUIT 在内部调用的,只需将视频项添加到 LWUIT 表单中,initDisplayMode 方法就会为您调用。

You don't need to call initDisplayMode for LWUIT. This is invoked internally by LWUIT, just add the video item to the LWUIT Form and the initDisplayMode method will be invoked for you.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文