PictureEffects Xojo and Real Studio Plugin

EnsurePictureCompatible Method

To safely ensure that a picture is either 32 bit or 24 bit deep and valid in other ways for usage with PictureEffects filters then use the EnsurePictureCompatible function.

This function should only be used with filters that support both 32 bit and 24 bit Pictures. For filters that only support 32bit images then use the EnsurePictureBits function.

This function can be very fast since it will only copy the original picture when it does not fit the required specs for a 32 bit or 24 bit picture.

EnsurePictureCompatible(
   src as Picture) as Picture

Parameters

src
The source picture to work with. This may be any REALbasic picture.

Returns

Picture
A safe 32 bit or 24 bit picture for usage in effects that do not alter the source picture.

If the EnsurePictureCompatible was forced to convert, if for example a 16 bit image was passed to it then the converted image will always be 32 bits.

(It can also return nil if a out of memory error occurred)

Remarks

This function is only for usage with effects that do not alter the original image. This is very important to remember that the picture returned from this function is not mutable.

Supported Platforms:

  • MacOS X Carbon
  • MacOS X Cocoa
  • Win32 - Windows
  • Linux x86

    Unsupported Platforms:

  • MacOS X Carbon

    See Also

    GlobalMethods Global