`
wuhua
  • 浏览: 2106231 次
  • 性别: Icon_minigender_1
  • 来自: 广州
社区版块
存档分类
最新评论

Display an image for zooming and panning

阅读更多

  1.  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.*;
  2.  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图形进

    在“Zooming and Panning an Orthographic Projection”这个主题中,我们将深入探讨如何在OpenGL环境中实现正交投影的缩放(Zooming)和平移(Panning)操作。 正交投影与透视投影不同,它提供了一个等比例的视图,...

    Zooming and Panning an Orthographic Projection(62KB)

    在用户界面设计中,正交投影也常用于实现3D视图的控制,如Zooming(缩放)和Panning(平移)功能,以帮助用户更好地观察和操作虚拟场景。本篇文章将深入探讨正交投影中的缩放和平移操作,并通过实际源码分析来增强...

    Panning zooming and rotation in OpenGL

    1. 平移(Panning): 平移操作是在三维空间中移动视点或场景,使得物体看起来像是在移动。在OpenGL中,平移通常是通过矩阵变换实现的,通过将模型视图矩阵乘以一个平移向量来完成。例如,如果要向右平移x单位,...

    DIP lab3 Zooming and Shrinking Images by Pixel Replication

    Zooming and Shrinking

    This is a program for display bitmaps with zooming and scrol

    标题中的“Bitmaps with zooming and scrolling”是指一个程序,它的功能是显示位图(Bitmaps),并提供了缩放和滚动的功能。在计算机图形学中,位图是一种常见的图像格式,由像素阵列组成,每个像素都有自己的颜色...

    Zooming and Shrinking Images by Pixel Replication

    本实验是一个采用基于像素复制的方式来进行图像缩放的程序,它分别由两个小程序组成,图像缩小和图像放大,程序的输入为一个图像矩阵和缩放因子(为整数)。图像的缩放是对图像进行的一种几何变换,通过对图像对应...

    zooming.rar_image zooming

    在IT领域,图像缩放(Image Zooming)是一项常见的任务,尤其在网页设计、图形处理软件和移动应用中。本文将深入探讨两种图像缩放方法:最近邻插值(Nearest Neighbor Interpolation)和双线性插值(Bilinear ...

    image_zooming

    "image_zooming"项目就是针对这一需求而设计的一个纯C语言实现的图像任意比例缩放算法。这个程序经过了调试,确保其功能的可靠性和可用性。 在计算机图形学中,图像缩放是一项基本操作,用于调整图像的大小,可以是...

    【MATLAB源码】图片数据点提取.zip

    % 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> - ...

    primal dual algorithms for image processing

    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...

    GmPrintSuite 2.96.6

    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 ...

    Zooming – JavaScript图片缩放库

    Zooming是一款专为网页设计开发的JavaScript图片缩放库,其核心优势在于提供了一种高效、灵活的方式来增强用户的图片查看体验。这款库以其简洁的代码结构、无依赖性以及对移动设备的良好支持而受到青睐。下面我们将...

    image-zooming:图片放大镜

    image-zooming 图片放大镜 例子见 #使用方法案例: 始终显示放大镜 只在点击触摸时显示放大镜 [removed][removed] [removed][removed] [removed] $('#img1').ImageZooming({ times: 2, always: true, callback: ...

    Dundas.Chart.for.Winform.Enterprise.v7.1.0.1812.for.VS2008

    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 ...

    DCC.rar_cubic_dcc_zooming image

    在图像处理领域,"DCC.rar_cubic_dcc_zooming image"这个标题暗示了一个关于图像缩放的技术,它使用了方向立方卷积插值(Directional Cubic Convolution Interpolation)。这种技术是一种高级的图像放大方法,旨在...

    ANSYS SpaceClaim 2016 User Guide

    - **Orienting Designs**: Provides tools for rotating, panning, and zooming to explore different perspectives. - **Graphics Style**: Applies different styles to enhance the visual appearance of the ...

    ComponentOne Studio for WinRT XAML 2013 v1

    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 using directional cubic convolution interpolation

    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&#...

    Interactive Data Visualization for the Web(O'Reilly,2ed,2017)

    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 ...

    ComponentOne Studio for WinRT XAML2012 v3

    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 ...

Global site tag (gtag.js) - Google Analytics