10.07.2015 Views

Programming Guide - Actian

Programming Guide - Actian

Programming Guide - Actian

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

How You Can Work with ImagesbmpicoSpecifies BMP formatHow You Can Store Images in a DatabaseSpecifies ICO format for Windows icon filesIf you have an image stored in another format, you must use a conversionutility to convert the file into one of these valid formats before you use it withOpenROAD.To store images in a database, use OpenROAD to add them to a table.OpenROAD automatically creates a special bitmap storage table calledii_stored_bitmaps. However, you can create your own bitmap storage table toimprove distribution of the images in the database and avoid transactionbottlenecks. For more information about creating your own bitmap storagetable, see How You Can Create a Bitmap Storage Table (see page 285).Each image in the bitmap storage table is associated with a handle, called aDBHandle, which you use to access the image. For example, to display animage stored in the database, you can set the value of the DBHandle attributeto the DBHandle for that image. OpenROAD then displays the image that isassociated with that particular DBHandle. You must store the DBHandles forthe images in a separate table from the images themselves.Use the InsertIntoDB method to add the image to the database table. TheInsertIntoDB method adds the image to the table you specify or, if you do notspecify a table, to the system table. (To use a bitmap storage table other thanthe system table, you must set it up as described in How You Can Create aBitmap Storage Table (see page 285).)To add the images to the database, you would perform the following basicsteps:1. Define a varchar(76) column to hold the DBHandles in the table thatcontains the data for your application.2. Decide whether to store the images in the system table or your own table.3. Set the FileHandle attribute of the BitmapObject to the file name.OpenROAD copies the image from the specified file and stores the copy inthe bitmap object.If there is an image field on your form, you can use the BitmapObjectassociated with the image field. If there is no image field, declare avariable of type bitmap object to use for loading the images.4. Use the InsertIntoDB method to insert into the database table the imagethat is now in the bitmap object. After this method completes, OpenROADstores the new DBHandle for the image in the DBHandle attribute.284 <strong>Programming</strong> <strong>Guide</strong>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!