如何获取相机的屏幕尺寸
我有一个应用程序,可以在相机拍摄的位图上添加效果。它在我的 Galaxy 门户上运行良好,但在 HTC Desire 上尝试该应用程序时,jpeg 图像很小。如何设置最终显示的图片尺寸为全屏尺寸?在 Galaxy 上,我使用了 BitmapFacory.Options 样本大小=1,这使得图像与捕获的图像大小相同,但在不同的手机上,这不起作用。谢谢。
I've an app that places an effect on a bitmap from a camera shot. it works fine on my Galaxy portal but when trying the app on HTC Desire the jpeg image is small. How can i set the picture size that is ultimately displayed to the full size of the screen? On the Galaxy i've used BitmapFacory.Options sample size=1, this makes the image the same size as the one captured, but on different phones this doesn't work. thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
捕获尺寸和预览尺寸之间存在差异(屏幕尺寸永远不会改变,这是特定于设备的),所以我假设您正在谈论捕获尺寸。
您只能选择相机支持的拍摄尺寸选择支持的图像尺寸 所以我想您可以选择相机支持的最大尺寸,但如果您想标准化尺寸(在每个相机上制作相同的尺寸),那么您必须根据需要向上或向下缩放生成的图像。
但我想知道这是否是您真正想要的,或者您是否试图将图像放置在特定位置(例如捕获图像的中心)并可能将覆盖图像缩放到捕获图像的百分比?
There is a difference between the capture size and the preview size (the screen size never changes that's device specific) so I am assuming you are talking about the capture size.
You can only select a capture size that is supported by the camera Selecting Supported Image Sizes so I suppose you could select the highest size that a camera supports, but if you want to normalize the size (make same on each camera) then you would have to scale the resulting image up or down dependent.
But I am wondering if this is what you are really after, or are you trying to place the image in a specific location (like the center of the captured image) and possibly scaling the overlaid image to a percentage of the captured image?