| <!doctype html public "-//w3c//dtd html 4.0 transitional//en"> | |
| <html> | |
| <head> | |
| <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> | |
| <title>SWT - Image Analyzer Example</title> | |
| </head> | |
| <body> | |
| <h2>SWT Standalone Example - Image Analyzer</h2> | |
| <p> | |
| The ImageAnalyzer opens image files and displays the visual contents of the file along with a | |
| summary of the data in the image file. | |
| The user can make adjustments to various elements of the image such as scaling and Alpha | |
| blending and can save these changes to a file. | |
| </p> | |
| <p> | |
| The ImageAnalyzer will load and display image files of type GIF, JPEG, BMP, ICO, and PNG. | |
| To open a file, use the File --> Open... menu item, and select the image file in the FileDialog. | |
| If the file is an interlaced GIF or PNG or a progressive JPEG, and Incremental Display is selected, | |
| then the ImageAnalyzer displays the image increments as they are being loaded. | |
| If the file contains an animated GIF, then the Next, Previous, and Animate buttons become enabled, | |
| and they can be used to cycle through the images in the file, or animate them. If a GIF defines a background color, | |
| as many animated GIFs do, selecting Background will use the GIF's background color. | |
| If the image has transparency (possible with GIF, PNG, or ICO), then selecting Display Mask will draw the image's transparency | |
| mask to the right of the image. You can change the background color of the ImageAnalyzer to see the transparency work. | |
| To turn off the transparency, deselect Display Transparency. | |
| After an image is loaded, it can be scaled or have alpha transparency applied, using the Scale and Alpha-K combos, | |
| and the Alpha menu. File --> Reopen restores scaling and Alpha to their default values and reloads the current image file. | |
| File --> Save As... can be used to save the currently loaded image to another type of image file. If the image has transparency, | |
| File --> Save Mask As... saves the image's transparency mask. | |
| </p> | |
| <p> | |
| When SWT loads an image file, an instance of org.eclipse.swt.graphics.ImageData is created. (In the case of an ICO file or | |
| multi-image GIF, an array of ImageData instances is created). The ImageAnalyzer displays all of the data stored in the ImageData | |
| instance(s) for the currently loaded image file, including the pixel data. Hovering over a pixel in the image display will show the RGB | |
| color data for that pixel. For certain images (particularly animated GIFs) additional data is stored in the org.eclipse.swt.graphics.ImageLoader | |
| instance used to load the image. The ImageAnalyzer displays this data as well. | |
| </p> | |
| <h3>Running the example</h3> | |
| <p> | |
| Follow the <a href="swt_manual_setup.html">Manual Setup</a> | |
| instructions to install and run the example from your workspace. | |
| </p> | |
| <p> | |
| The "Main" class is <code>org.eclipse.swt.examples.imageanalyzer.ImageAnalyzer</code>. | |
| </p> | |
| <p> | |
| This example can also be run using the <a href="swt_launcher_ex.html">Example Launcher</a>. | |
| Select the Image Analyzer item from the Standalone category and click Run. | |
| </p> | |
| <p><a href="hglegal2002.htm"><img SRC="ngibmcpy2002.gif" ALT="Copyright IBM Corporation and others 2000, 2002. All Rights Reserved." BORDER=0 height=14 width=324></a></p> | |
| </body> | |
| </html> |