When you display an image, the following things come into play:
- Sizing and positioning the display.
- Adapting the image to the color resolution of the display device.
- Making other refinements that affect the display but not the image in memory.
The LEADTOOLS paint methods let you specify which part of an image to display, how big to make the display, and where to position the origin (for scrolling and zooming). In the ActiveX, the origin defaults to 0,0 and the size defaults to the image size. This is arbitrary, and even with automatic scroll bars, it is unlikely to be what a user wants to see. Instead, the typical user either wants to see the whole image or wants to select a portion of the image to view.
Fortunately, LEADTOOLS makes it easy to show the user exactly what he wants to see. LEADTOOLS lets you control the size and position of the display without resizing or trimming the image. In fact, it usually is best to think of the image size as a measure of resolution, rather than a measure of size. The larger the image, the more you can zoom in without losing detail.
As for adapting to the color resolution of the display device, if the color resolution of your device is greater than 256 colors, no adaptation is necessary. If the color resolution is higher than 256 colors, images are displayed using their own color values. Of course, if a 24-bit image is displayed on a 16-bit device, there is some loss, but there are still no programming issues, since the only remedy is to change the display mode.
If the color resolution of your display device is 256 colors or less, you have to make some programming decisions regarding dithering and palette selection. When displaying 16-, 24-, or 32-bit images, you can determine whether LEADTOOLS uses ordered dithering or error diffusion to handle the color reduction. (LEADTOOLS uses a fixed palette for these images.) When displaying 8-, 4-, or 1-bit images, you must decide whether to use a fixed palette or the individual image's palette. Using the fixed palette avoids palette shifting when more than one image is displayed at the same time. Using the image's original palette produces the best possible display of the image's colors.
Other LEADTOOLS methods let you determine how the new display interacts with whatever is already on the display device. For example, when displaying 1-bit images, you can set scale-to-gray or favor-black options that can improve the readability of scaled images (images that are zoomed in or out to fit the available space).
If the image is a 24 or 48-bit image it is possible to specify use of Reference Output Medium Metric (ROMM) BGR Color encoding. This is a wide-primary output-referred extended color-gamut BGR color encoding. This encoding is used by digital still picture imaging systems to manipulate, store, transmit, display and print digital images. Unlike sRGB color encoding, the range of colors is not limited to those colors that can be displayed on a CRT monitor, and unlike e-sRGB, these encodings do not use negative RGB colorimetry co-ordinates.
ROMM color order is supported by the CMP/JPEG/Exif JPEG/JTIF/TIFF CMP file formats. Because there are colors that can be represented in RGB, but not in ROMM as well as colors that can be represented in ROMM that cannot be represented in RGB, if you convert from one to the other you lose the colors that can be represented only in one of the colorspaces.
For displaying 12 to 16-bit grayscale images, LEADTOOLS provides methods for window-leveling. Window-leveling is only available in the Medical Imaging editions.