convertPicture

convertPicture(type: Integer): Binary;

The convertPicture method of the Binary primitive type returns a copy of a binary picture image converted to the picture type specified in the type parameter. The types of images that can be converted (by using the Window class PictureType_Bitmap, PictureType_Jpeg, PictureType_Jpeg2000, PictureType_Png, or PictureType_Tiff constant) are as follows.

A 14015 (File does not contain an image type that can be handled) exception is raised if the receiver does not contain valid image data.

Converting to a .tif image type file results in a tiff packbits type image. Converting to a .jpg image results in loss of quality in the picture, as Joint Photographic Experts Group (JPEG) uses a lossy compression algorithm.

As the Portable Network Graphics image uses a lossless compression algorithm, it provides clarity and retains definition for images, but the files may be larger than JPEG files.

An exception is raised if this method is invoked from a server method.

You cannot convert images to GIF picture files.

See also the convertToFile method of the Binary primitive type.