Equinox Online Help - Language Reference - A to Z
ImportPicture |
|
---|---|
Applies to | |
Syntax | ImportPicture PictureItem, FileExpression Also ImportPicture PictureItem, "CLIPBOARD", [ImageType], [hClip], [iSize] ImportPicture PictureItem, "FILE", ImageType, hFile, [iSize] ImportPicture PictureItem, "MEMORY", ImageType, hMem, [iSize] |
Action | [Statement] Imports a picture to a picture field. |
Scope | [Statement] Imports a picture to a picture field. |
Notes | This statement imports an image to a specified picture field. PictureItem is the name of the picture field, in the current record. There are four forms of the ImportPicture statement, corresponding to the four sources from which you can read an image:
If you import the image from a file path, FileExpression is a string and identifies the image file name. If you do not specify a path for the file, Equinox searches the following directories (in the specified order):
If you import the image from a file path, Equinox takes the file-type from the file extension used. If the type is "BMP", Equinox assumes that the file starts with a standard file header (referred to as a BITMAPFILEHEADER in the Windows SDK documentation) and removes it before storing the file in the database. In order to import the file from the server, prepend "SERVER:" (in any case) to the FileExpression. This prefix is ignored by the single user version. If you import the image from any of the other three sources, ImageType is a three-letter string which must match the file-type. It can be one of the following:
If you import the image from the Windows clipboard, Equinox assumes that the type is "BMP" (clipboard type CF_DIB) unless the ImageType parameter is supplied. The clipboard handle may be supplied if required. If you import the image from an open file handle, the ImageType parameter must be supplied. You must also supply the file handle using hFile, having first obtained it using FileOpen in one of the binary (random) modes. If you import the image from an open memory handle, the ImageType parameter must be supplied. You must also supply the memory handle using hMem, having first obtained it using GlobalAlloc. The iSize parameter optionally determines the size of the image. If it is supplied as the wrong value, unpredictable results will occur. If it is not supplied, the image size is calculated as follows:
|
Category | Pictures |
See Also | ErasePicture, ExportPicture, IsPicture, PictureSize, PictureType, SelectPicture, ShowPictures |
Example | The following examples assume a picture field PicField, character workareas HandleType(3), MemType(3) and a numeric workarea MemHandle(8,0) |* File Operations *| |