# toImage method

Future<Image> toImage (int width, int height)

Creates a raster image representation of the current state of the scene. This is a slow operation that is performed on a background thread.

## Implementation

    Future<Image> toImage(int width, int height) {
      if (width <= 0 || height <= 0)
        throw new Exception('Invalid image dimensions.');
      return _futurize(
        (_Callback<Image> callback) => _toImage(width, height, callback)
      );
    }