在 javaME 中仅从取景器获取缩略图而不是整个照片
我有一个 JavaME 中的应用程序,可以使用 VideoControl 显示来自取景器的提要,
Item videoItem = (Item)vidc.initDisplayMode(VideoControl.USE_GUI_PRIMITIVE, null);
并使用适当的方法拍摄快照。但是,我不想拍摄整张照片,而只想拍摄取景器中的缩略图。数据被传送到设备的显示屏上,因此它们就在某个地方。但是我是否可以获取 videoItem 中可以看到的原始数据,而不是调用 getSnapshot 方法,该方法已经引入了一些编码,需要权限并且需要花费大量时间?
提前致谢。
I have an application in JavaME that can display the feed from viewfinder using the VideoControl
Item videoItem = (Item)vidc.initDisplayMode(VideoControl.USE_GUI_PRIMITIVE, null);
and take a snapshot using the appropriate method. However, I don't wish to capture the whole photo, but just the thumbnail from the viewfinder instead. The data is feeded to the device's display, so they are there somewhere. But can I get the raw data that can be seen in the videoItem instead of calling the getSnapshot method, that already introduces some encoding, needs permissions and takes a lot of time?
Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
恐怕没有办法做到这一点。除了通过 getSnapshot() 之外,您无法使用取景器的图像,正如您所说,由于编码和权限,这不是即时的。
事实上,取景器直接馈送到设备的显示屏上,这意味着它可以比将编码字节传递给 Java 更快地在本地实现。
如果您特别需要缩略图大小的图像,则需要手动调整 getSnapshot() 返回的图像大小。
I'm afraid there's no way to do this. The viewfinder's image isn't available to you except through
getSnapshot()
, which as you said is not instant due to encoding and permissions.The fact that the viewfinder is being fed directly to the device's display means it can be implemented natively far more quickly than passing the encoded bytes to Java.
If you specifically need a thumbnail size image, you'd need to perform manual resizing of the image returned by getSnapshot().