IBM Books

Image, Audio, and Video Extenders Administration and Programming

DBiBrowse


Image Audio Video
X    

Opens the image browser on the client and displays an image. The image can be stored in an image column or an external file:

If the browser can not directly access the image, the extender creates a temporary file in the directory that is specified in the DB2IMAGETEMP environment variable. The extender then displays the image from the temporary file.

Authorization

Select authority on the user table, if browsing an image from a column.

Library file
OS/2 and Windows AIX, HP-UX, and Solaris
dmbimage.lib libdmbimage.a (AIX)

libdmbimage.sl (HP-UX)

libdmbimage.so (Solaris)

Include file

dmbimage.h

Syntax

Browse an image stored in a column

long DBiBrowse(
      char *browserName,
      MMDB_PLAY_HANDLE,
      DB2Image *imageHandle,
      waitFlag
      );

Syntax

Browse an image stored as a file

long DBiBrowse(
      char *browserName,
      MMDB_PLAY_FILE,
      char *fileName,
      waitFlag
      );

Parameters

browserName (in)
The name of the image browser. If set to NULL, the default image browser specified by the DB2IMAGEBROWSER environment variable is used.

MMDB_PLAY_HANDLE (in)
A constant that indicates the image is stored as a BLOB.

MMDB_PLAY_FILE (in)
A constant that indicates the image is stored as a file that is accessible from the client.

imageHandle (in)
The handle of the image. This parameter must be passed when you browse an image in a column. If the image handle represents an external file, the client environment variable DB2IMAGEPATH is used to resolve the file location.

fileName (in)
The name of the file that contains the image.

waitFlag (in)
A constant that indicates whether your program waits for the user to close the browser before continuing. MMDB_PLAY_WAIT runs the browser in the same thread as your application. MMDB_PLAY_NO_WAIT runs the browser in a separate thread.

Error codes

MMDB_SUCCESS
API call processed successfully.

MMDB_RC_NO_AUTH
Caller does not have the proper access authority.

MMDB_RC_NOT_CONNECTED
Application does not have valid connection to a database.

Examples

Display the image that is identified by the imageHandle. Run the default browser in the same thread as the application:

#include <dmbimage.h>
 
rc = DBiBrowse(NULL, MMDB_PLAY_HANDLE,
       imageHandle, MMDB_PLAY_WAIT);


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]