Android 如何绘制位图?
我有一个应用程序可以处理相机图像并在位图上放置鱼眼效果。它工作正常,但一开始非常慢,直到效果出现在位图上,然后随后调用添加更多失真并更新图像就相当快了。我首先将相机图像绘制为背景位图。然后,我根据屏幕上的触摸事件创建该图像的 2 个子集。然后,这 2 个子集位图通过处理方法,然后使用原始 xy 线作为叠加层放置在背景图像上。我已经做了一些记录,因为位图是在 onDraw 方法中绘制的,并记录了图像处理循环的开始/结束时间。似乎在扭曲方法的循环完成之前就完成了drawBitmap()方法的执行?图像循环完成后,屏幕将重新绘制。我本以为在执行drawBitmap方法后屏幕会更新。有什么想法吗?谢谢。
I've an app that processes a camera image and places a fisheye effect on a Bitmap. it works fine but is very slow at first until the effect is on the bitmap then subsequent calls to add more distortion and update the image are then quite fast. I first of all paint the camera image as a backgraound bitmap. I then create 2 subsets of that image from touchevents on the screen. these 2 subset bitmaps are then passed through a processing method then placed as overlays using the original xy cords over the background image. i've done some logging as the bitmaps are painted in the onDraw method and logged the start/end time of the image processing loop. it seems to finish executing the drawBitmap() method before the looping through the distortion method has finished? the screen is then repainted once the image looping has finished. i would have thought the screen would update after the drawBitmap method has executed. any ideas anyone? thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论