8. Working with Images and Text Strings : How You Can Work with Images : BitmapObject Class
 
Share this page                  
BitmapObject Class
The BitmapObject class provides attributes and methods that enable you to manipulate the images displayed in an image field. For example, when you create an image field on a form, it is similar to an empty picture frame. To display an image in that picture frame, use the BitmapObject's FileHandle attribute to display an image stored in a file.
Setting a BitmapObject attribute does more than change the image field's value. Each time you change the value, OpenROAD executes the implied procedures. For example, when you set the FileHandle attribute to a new value and the BitmapObject is associated with an image field, OpenROAD displays the new image in the field. This simplifies your coding, because you only need to set the attribute.
The BitmapObject class lets you store images either in standard files or in a database. Using your native file system to store images in standard files provides performance advantages. You can use SQL to store and retrieve the file names in a database table. You can then use the BitmapObject attributes and methods that deal with files to manipulate the images from your application.
The disadvantage of storing images in files is that you are responsible for maintaining them (because the images are stored outside of the system). You must ensure that any files you reference from the application actually exist, and you must back up and update the files appropriately. In addition, if you are creating a portable application or using a network, your program must take into account the different conventions for file specifications.
Storing images in the database enables you to take advantage of the DBMS recovery and transaction facilities. In addition, when you use networks, there are no file name transparency problems. However, this approach also has its disadvantages. When images are stored in a database, it is difficult for other programs to access the images and there is extra overhead in using the database instead of the native file system.
For more information about these two BitmapObject features, see Store Images in a Database (see How You Can Store Images in a Database) and How You Can Store Images in Files (see How You Can Store Images in Files).