简体   繁体   English

Blackberry中的有效图像缩放

[英]Efficient image scaling in Blackberry

How to scale image ( Bitmap / EncodedImage ) efficiently in Blackberry (using OpenVG / OpenGL if hardware acceleration supported). 如何在Blackberry中有效地缩放图像( Bitmap / EncodedImage )(如果支持硬件加速,则使用OpenVG / OpenGL )。 Can something like VGField / GLField be used to achieve that? 可以使用VGField / GLField类的东西来实现吗?

I have already tried Bitmap.scaleInto(...) , EncodedImage.scaleImage32(..) and some naive algorithms (raw data manipulation). 我已经尝试过Bitmap.scaleInto(...)EncodedImage.scaleImage32(..)和一些幼稚的算法(原始数据操作)。 Also I can't use ZoomScreen because it is not possible (?) to change the image of an ZoomScreen instance dynamically. 我也不能使用ZoomScreen因为不可能(?)动态更改ZoomScreen实例的图像。

Need some idea about how the default image viewer application in BlackBerry device (eg Torch 9800) performs smooth pinch zooming. 需要一些有关BlackBerry设备(例如Torch 9800)中默认图像查看器应用程序如何执行平滑缩放的想法。

The usual technique is: 通常的技术是:

  • Step 1: scale the current thumbnail, so you get a rather blocky looking image, but has the advantage of working nearly instantaneously. 第1步:缩放当前缩略图,这样您可以获得看起来很块状的图像,但是具有几乎可以立即工作的优点。

  • Step 2: kick off the higher resolution image decoder on a separate thread. 步骤2:在单独的线程上启动更高分辨率的图像解码器。 When it is done, it sends the newly decoded image back to the UI thread to replace the approximate image that was used from step 1. 完成后,它将新解码的图像发送回UI线程,以替换从步骤1开始使用的近似图像。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM