欢迎来到毕设资料网! | 帮助中心 毕设资料交流与分享平台
毕设资料网
全部分类
  • 毕业设计>
  • 毕业论文>
  • 外文翻译>
  • 课程设计>
  • 实习报告>
  • 相关资料>
  • ImageVerifierCode 换一换
    首页 毕设资料网 > 资源分类 > DOC文档下载
    分享到微信 分享到微博 分享到QQ空间

    外文翻译----浅谈SWT 图像

    • 资源ID:130774       资源大小:1.09MB        全文页数:47页
    • 资源格式: DOC        下载积分:100金币
    快捷下载 游客一键下载
    账号登录下载
    三方登录下载: QQ登录
    下载资源需要100金币
    邮箱/手机:
    温馨提示:
    快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。
    如填写123,账号就是123,密码也是123。
    支付方式: 支付宝   
    验证码:   换一换

     
    账号:
    密码:
    验证码:   换一换
      忘记密码?
        
    友情提示
    2、PDF文件下载后,可能会被浏览器默认打开,此种情况可以点击浏览器菜单,保存网页到桌面,就可以正常下载了。
    3、本站不支持迅雷下载,请使用电脑自带的IE浏览器,或者360浏览器、谷歌浏览器下载即可。
    4、本站资源下载后的文档和图纸-无水印,预览文档经过压缩,下载后原文更清晰。

    外文翻译----浅谈SWT 图像

    1、 1 Taking a look at SWT Images Summary SWTs Image class can be used to display images in a GUI. The most common source of images is to load from a standard file format such as GIF, JPEG, PNG, or BMP. Some controls, including Buttons and TreeItems, are able to display an Image directly through the se

    2、tImage(Image) method, but any controls paint event allows images to be drawn through the callbacks graphic context. SWTs ImageData class represents the raw data making up an SWT Image and determines the color for each pixel coordinate. This article shows the correct uses of ImageData and Image, show

    3、s how to load images from files, and how to achieve graphic effects such as transparency, alpha blending, animation, scaling, and custom cursors. By Joe Winchester, IBM September 10th, 2003 This first section of this article gives an introduction to colors and shows how an image records the color va

    4、lue of each pixel. Introduction Image lifecycle ImageData Color PaletteData o Indexed palette o Direct palette The next section describes image transparency, alpha blending, animation, and how to scale images. Transparency Manipulating ImageData Saving Images Blending o Single alpha value o Differen

    5、t alpha value per pixel Image effects GIF animation Scaling Finally, the article shows how to create cursors from images, by using a source image together with a mask. Cursors o Platform cursors o Custom cursors Introduction The simplest way to create an SWT Image is to load it from a recognized gra

    6、phic file format. This includes GIF, BMP (Windows format bitmap), JPG, and PNG. The TIFF format is also supported in more recent Eclipse releases. Images can be loaded from a known location in the file system using the constructor Image(Display display, String fileLocation): 2 Image image = new Imag

    7、e(display, C:/eclipse/eclipse/plugins/org.eclipse.platform_2.0.2/eclipse_lg.gif); Instead of hard-coding the location of the image, its more common to load the Image from a folder location relative to a given class. This is done by creating an InputStream pointing to the file with the method Class.g

    8、etResourceAsStream(String name), and using the result as the argument to the constructor Image(Display display, InputStream inputStream). The Eclipse package explorer below shows the class com.foo.ShellWithButtonShowingEclipseLogo and the eclipse_lg.gif in the same folder. To following code would lo

    9、ad the graphic from its location relative to the class. Image image = new Image(display, ShellWithButtonShowingEclipseLogo.class.getResourceAsStream( eclipse_lg.gif); Once the image has been created it can be used as part of a control such as a Button or Label that is able to render the graphic as p

    10、art of their setImage(Image image) methods. Button button = new Button(shell,SWT.PUSH); button.setImage(image); 3 Images can be drawn onto using a graphics context that is created with the constructor GC(Drawable drawable) with the Image as the argument. GC gc = new GC(image); gc.setForeground(displ

    11、ay.getSystemColor(SWT.COLOR_WHITE); gc.drawText(Ive been drawn on,0,0,true); gc.dispose(); Using a GC to draw onto an Image permanently alters the graphic. More information on how to use a GC is covered in the article Graphics Context - Quick on the draw. Image lifecycle When an image is loaded, the

    12、 first step is to create device independent ImageData represented by the class org.eclipse.swt.graphics.ImageData. Following this, the data is prepared for a specific device by creating an actual Image instance. As well as loading an Image directly from a file, you can separately create the ImageDat

    13、a object and then construct the Image using Image(Device device, ImageData imageData). The data for an existing Image can be retrieved using getImageData(), although this will not be the same object that was used to create the image. This is because when preparing an image to be drawn onto a screen,

    14、 properties such as its color depth might be different from the initial image data. Instances of Image represent an underlying resource that has been prepared for a specific device and they must be disposed when they are no longer required to free up the allocated resource. There is no finalization

    15、of resources in SWT when an object is garbage collected. For more information see SWT: The Standard Widget Toolkit: Managing Operating System Resources. ImageData ImageData can be thought of as the model for an image, whereas the Image is the view thats been prepared for output onto a specific devic

    16、e. The ImageData has a width and height, and a pixel value for each coordinate. The raw data of the image is a byte, and the depth of the image specifies the number of bits that are used for each coordinate. An image depth of 1 can store two possible values for each pixel (0 and 1), a depth of 4 can store 24=16, a depth of 8 can store 28=256 values and a depth of 24 can represent 224=16 million different values per pixel. The larger the depth of an


    注意事项

    本文(外文翻译----浅谈SWT 图像)为本站会员(泛舟)主动上传,毕设资料网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请联系网站客服QQ:540560583,我们立即给予删除!




    关于我们 - 网站声明 - 网站地图 - 资源地图 - 友情链接 - 网站客服 - 联系我们
    本站所有资料均属于原创者所有,仅提供参考和学习交流之用,请勿用做其他用途,转载必究!如有侵犯您的权利请联系本站,一经查实我们会立即删除相关内容!
    copyright@ 2008-2025 毕设资料网所有
    联系QQ:540560583