外文翻译----浅谈SWT 图像
《外文翻译----浅谈SWT 图像》由会员分享,可在线阅读,更多相关《外文翻译----浅谈SWT 图像(47页珍藏版)》请在毕设资料网上搜索。
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
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中设计图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 外文 翻译 浅谈 swt 图像 图象
