获取快照始终产生相同的值
我有这段代码:
byte[] snap = ((VideoControl) player).getSnapshot("encoding=jpeg");
,它从相机获取快照。现在,经过一些处理后,它会生成正确的图像。奇怪的是,当我调试这行代码时,即使生成的图像不同,它在字段中始终具有相同的值。有什么想法吗?
问候修剪
I have this piece of code:
byte[] snap = ((VideoControl) player).getSnapshot("encoding=jpeg");
, which gets a snapshot from the camera. Now, after a little processing it produces correct image. The weird part is, that when I debug this line of code, it always has the same value in the field even when the resulting image is different. Any ideas why?
Regards Trim
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
确保您查看的数据位于数组内部,而不是数组的内存地址(不一定需要更改)。
我希望这有帮助,
祝你好运
Make sure the data you view is inside the array and not the memory address of the array (which doesn't need necessarily to change).
I hope this helps,
Good Luck
也许需要澄清一下……什么在什么“领域”具有“相同的价值”?
听起来就像您将字节数组转换为图像。然后,当您再次调用 getSnapshot 时,您会得到相同的字节数组但不同的图像吗?
也许尝试 getSnapshot(null)。
比如:
你如何“调试”?模拟器?设备上?什么设备?
上面的代码适用于我的 K800i。
Perhaps some clarity is needed... what has the 'same value' in what 'field'?
Sounds like you take that byte array and turn it into an image. Then when you call getSnapshot again you get the same byte array but a different image?
Perhaps try getSnapshot(null).
Something like:
How are you 'debugging'? Emulator? On-device? What device?
The above code works for me on a K800i.
您确定 getSnapshot() 返回 VideoControl 吗?仔细检查一下。
Are you sure getSnapshot() returns a VideoControl? Double check that.
经过广泛的搜索,我发现我错了,对于误导性的问题我深表歉意。然而,使用encoding=jpeg时,这些数组实际上只有一小部分不同,但使用其他编码时,它们确实有很大不同。再次,我对这个问题感到抱歉,因为我没有首先以困难的方式验证它。
After extensive search I have found I was wrong and I do apologize for misguiding question. However, with the encoding=jpeg those arrays really differ only in a small part, but with another encodings they do differ extensively. Again, sorry for this question when I didn't verify it the hard way first.