QPix Command Reference Image Files

QPx_ExportImageFileToBLOB

QPx_ExportImageFileToBLOB(sourcePath; targetBlob; targetType; exportSettings):error
sourcePath Text Pathname to the source file
targetBlob BLOB BLOB to receive the image
targetType String4 4-char image type identifier
exportSettings BLOB Export settings
error Longint Error result

Saves an image file into a BLOB, in the specified format.

The source file is specified by sourcePath. If sourcePath is empty, a file selection dialog is presented.

The targetBlob parameter is the target BLOB. Uppon successful completion of the command, targetBlob receives the image data.

The targetType parameter specifies the target file format. To get the list of avaliable export formats, call the QPx_GetExportTypes command. QPix defines the following constants for the export formats supported by QuickTime 4.x.

qpx_JPEGFile "JPEG" JPEG/JIFF file format
qpx_TIFFFile "TIFF" TIFF file format
qpx_PNGFile "PNGf" PNG file format
qpx_BMPFile "BMPf" BMP file format
qpx_PhotoshopFile "8BPS" Adobe Photoshop file format
qpx_PictureFile "PICT" Apple PICT file format
qpx_QTImageFile "qtif" QuickTime Image file format
qpx_TargaFile "TPIC" Truevision Targa file format
qpx_SGIImageFile ".SGI" Silicon Graphics SGI file format
qpx_MacPaintFile "PNTG" Apple MacPaint file format

The exportSettings parameter can be used to specify format-specific settings for the export operation, and to receive settings after a successful image export. Not all export formats support settings. If the specified export format does not support settings, this parameter is ignored. If an empty BLOB is passed, format-specific defaults are used.

Note: The exportSettings BLOB parameter must contain valid export settings. The structure of this BLOB is private to QuickTime and cannot be constructed or altered with 4D BLOB commands. To let the user modify the export settings, call the QPx_DoExportSettingsDialog command.

Example

  `Save an image file into a BLOB, in JPEG format
 
C_LONGINT($error)
C_TEXT($imagePath)
C_BLOB($jpegImage)
C_BLOB($settings)
 
$imagePath:="" `This will bring up the "Open" dialog
 
$error:=QPx_ExportImageFileToBLOB ($imagePath;$jpegImage;qpx_JPEGFile;$settings)
If ($error#qpx_noErr)
   `Handle the error
End if

Related commands

QPx_GetExportTypes Returns the list of available export types
QPx_DoExportSettingsDialog Displays the export settings dialog for a specific file type

QPix © Escape Information Services
Generated by QDoc 2.6 on Thu, 2 May 2002 00:49:49 +0300