Home |
Images Page |
Images PageThe second tab of the Project window notebook is named Images. The Images Notebook page lists the BMP, GIF, JPG, and PNG image files included in the current project. Similar to the Source page, this information is presented in a PegTreeView. Each top level node of the tree is one PegBitmap image that can be used in your application program. Images are imported into your project by using the Project | Add Image command on the menu bar while viewing the Images notebook page. Images can be selected from any location on your local hard drive or a network drive. Window Builder will maintain relative path information to the image if the image is located on the same drive as the project file, allowing you to easily move entire projects from one computer to another. When an image is selected with the mouse or keyboard on this notebook page, a preview of the image is shown in the preview window. The image can be applied to a bitmap-based RTPEG-32 control by dragging the image from the preview window to the target control. You can display any image on the image page by selecting the image, or by using the up-down arrow keys to move up and down in the tree control. Each image is displayed in the Preview window as it is selected, allowing you to quickly scan through the images included in your project. Images are deleted by selecting the image in the Image notebook page and pressing the Delete key. Any objects that had been using a deleted image are re-configured to use a default bitmap. When the Target window is being used to layout a new window or dialog, PegBitmap images from the Images page can be directly dragged-and-dropped onto RTPEG-32 objects that support image display. For example, if you have created a PegBitmapButton as a child of the current window or dialog, you can simply drag a PegBitmap from the images preview onto the PegBitmapButton. This action causes the PegBitmap to be assigned to the PegBitmapButton. It is important to remember that before you can drag an image and drop it in the target window, you must add at least one child object to the target window which is capable of displaying an image. When you assign an image to certain types of objects by clicking on the image and dragging it to the object, Window Builder will ask you if you would like to re-size the object to fit the image. If you select yes, the target object is re-sized such that the image fits neatly within the object. If you select NO, the image is centered within the client area of the target object and the target object size is not modified. For other object types the resizing is done without question since this is the only mode of operation supported by that object type. If your target system supports 256 or more colors, Window Builder will scan each image in the project, create an optimal palette for displaying those images, remap the image colors back to the optimal palette, RLE encode each image, save the custom palette, and save each newly-encoded image file in C style source data structures. For 16 color targets, the Update Images command is slightly less complex. In this mode, window build dithers each image to a fixed orthogonal 16-color palette, RLE encodes the images for which this is memory efficient, and saves the resulting bitmaps in C style source data structures.
|