- Import the required classes and interfaces:
import net.rim.device.api.system.*;
import net.rim.device.api.ui.*;
import net.rim.device.api.ui.component.*;
import net.rim.device.api.ui.extension.container.*;
-
Create the application framework by extending the UiApplication class. In main(), create an instance of the new class and invoke enterEventDispatcher() to enable the application to receive events. In the constructor, create an EncodedImage using a resource in your project, create aZoomScreen with the EncodedImage, and invoke pushScreen() to display the image for zooming and panning.
public class ZoomableImageApp extends UiApplication
{
public static void main(String[] args)
{
ZoomableImageApp theApp = new ZoomableImageApp();
theApp.enterEventDispatcher();
}
public ZoomableImageApp()
{
EncodedImage myImg = new EncodedImage("myImg.jpg");
ZoomScreen zoomableImg = new ZoomScreen(myImg);
pushScreen(zoomableImg);
}
}
Code sample: Displaying an image for zooming and panning
import net.rim.device.api.system.*;
import net.rim.device.api.ui.*;
import net.rim.device.api.ui.component.*;
import net.rim.device.api.ui.extension.container.*;
public class ZoomableImageApp extends UiApplication
{
public static void main(String[] args)
{
ZoomableImageApp theApp = new ZoomableImageApp();
theApp.enterEventDispatcher();
}
public ZoomableImageApp()
{
EncodedImage myImg = new EncodedImage("myImg.jpg");
ZoomScreen zoomableImg = new ZoomScreen(myImg);
pushScreen(zoomableImg);
}
}
分享到:
相关推荐
Zooming and Panning an Orthographic Projection对OpenGL图形进行缩放和panning操作(6KB)
Zooming and Panning an Orthographic Projection(62KB)
Panning zooming and rotation in OpenGL 一段opengl的简单示例程序,包括旋转和缩放。
This is a program for display bitmaps with zooming and scrolling using windows API.
Zooming and Shrinking
zooming an image by using two methods
本实验是一个采用基于像素复制的方式来进行图像缩放的程序,它分别由两个小程序组成,图像缩小和图像放大,程序的输入为一个图像矩阵和缩放因子(为整数)。图像的缩放是对图像进行的一种几何变换,通过对图像对应...
% Panning is achieved by clicking and dragging on the image. Double-click % to center view. Right click and drag to zoom in and out. In addition, % there are keyboard shortcuts for zooming: % <a> - ...
Image zooming using directional cubic convolution interpolation
L1 and Huber ROF, image restoration like deconvolution, image zooming, image inpainting,optical flow for motion estimation and Mumford-Shah multi-label image segmentation problem. these codes are base...
Extensive range of canvas methods for drawing to the page Customisible page headers and footers Display fully customizable page thumbnails Preview & print TStringGrids, TTreeView & TRichEdit ...
image-zooming 图片放大镜 例子见 #使用方法案例: 始终显示放大镜 只在点击触摸时显示放大镜 [removed][removed] [removed][removed] [removed] $('#img1').ImageZooming({ times: 2, always: true, callback: ...
一个实现任意比例缩放的纯c的算法。该程序本人调试过,绝对可用。
support for zooming and rotating objects, switching between multiple views of an object, integration of pen input with interpreters, libraries for manipulating ink strokes, widgets optimized for pens...
Included is support for all standard and many advanced chart types, drilldown functionality, full Visual Studio Integrated help, a variety of different image formats and intuitive samples and ...
Load arbitrary PDF documents with support for smooth page navigation and zooming. Reuse Your Code Reuse Your Code Leverage your WPF, Silverlight, and Windows Phone knowledge to build modern ...
Image-zooming is a technique of producing a high-resolution image from its low-resolution counterpart. It is also called image interpolation because it is usually implemented by interpolation. Keys&#...
Create custom geographic maps with panning, zooming, labels, and tooltips Walk through the creation of a complete visualization project, from start to finish Explore inspiring case studies with nine ...
Zooming 是一款纯 javascript 图片缩放库,主要特点有: 不依赖其他库,纯 JavaScript 实现,支持移动设备; 流畅的动画; 可缩放高清图像; 易于集成和定制。
Load arbitrary PDF documents with support for page navigation and zooming. MVVM Support Customize the controls in your preferred method: XAML, C# or VB.NET code-behind, or both. Use the latest ...