PictureEffects Xojo Plugin |

# PictureEffectsUtilities.EnsurePictureBits Method

To safely get a 32bit or 24 bit picture to use with effects in this plugin use the EnsurePictureBits function.
This function will examine the src picture that is passed to it and return it unchanged if it is considered safe for use for the effects in this plugin. If it is not safe then a new copy of the picture will be created internally that is a safe 32bit or 24 bit picture.
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.

EnsurePictureBits(
src as Picture,
depth as Integer) as Picture

#### Parameters

src
  The source picture to work with. This may be any Xojo / Real Studio picture.
depth
  The desired depth to work with. (All of the filters in PictureEffects support 32 bit images and some support 24 bit images).

#### Returns

Picture
  A safe 32 bit or 24 bit picture for usage in effects that do not alter the source picture.
  (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 32 bit
- MacOS X Cocoa 64 bit
- Windows 32 bit
- Windows 64 bit
- Linux 32 bit
- Linux 64 bit
- Linux ARM

  #### See Also

  PictureEffectsUtilities Module