Programming Guide : Working with Images and Text Strings : How You Can Work with Images : Image Fields
 
Share this page          
Image Fields
An image field is a rectangular boundary, like a picture frame, in which you can display bitmap images that are stored either in files or in the database. Image fields differ from most other field types in the way they store data.
For most field types, the data to be displayed in the field is contained in the variable that is associated with the field. For example, the integer variable associated with a slider field contains the current value for the slider. However, the data for an image field consists of bitmap images.
Instead of actually containing the data for the field, the reference variable associated with the image field points to an object of the BitmapObject class. In addition to containing the bitmap image that is the current data for the field, the bitmap object referenced by the image field's variable provides attributes and methods that enable:
Loading an image from a file into OpenROAD
Updating the images in the database or files
How You Can Load a Bitmap Image into an Image Field
To load a bitmap image that is stored in a file into OpenROAD and display it in an image field, set the FileHandle attribute of the BitmapObject, for example:
bmo.FileHandle = file_name.Value;
For more information about using the BitmapObject system class, see BitmapObject Class.
Relationship Between BitmapObject and ImageField Object
Although the BitmapObject object has information about the image displayed in the image field, the ImageField object has information about the field itself, such as the size of the field. The most important attribute of the ImageField class is the DisplayPolicy attribute, which determines how the image fits into the field. For more information about the DisplayPolicy attribute, see ImageField Object.
The following illustration of an ImageField and a BitmapObject displays the relationship between the two variables associated with the image field, the BitmapObject and the ImageField. For more information about using the ImageField system class, see ImageField Object.