# extractRoiWithColor method

DocumentImage extractRoiWithColor(

1. Rectangle bounds,
2. int colorRed,
3. int colorGreen,
4. int colorBlue

)

Extracts a region of interest in the image according to the given bounds.

param bounds Bounds of the crop to extract. param colorRed Background color red (from 0 to 255) param colorGreen Background color green (from 0 to 255) param colorBlue Background color blue (from 0 to 255) return The extracted region of interest. throws DocumentException An error has occurred during Document Library execution.

## Implementation

    DocumentImage extractRoiWithColor(Rectangle bounds, int colorRed, int colorGreen, int colorBlue) {
      DocumentImage documentImageRoi = DocumentImage();
      var err = documentSDK.id3DocumentImage_ExtractRoiWithColor(_pHandle.value, bounds.handle, colorRed, colorGreen, colorBlue, documentImageRoi.handle);
      if (err != DocumentError.success.value) {
        documentImageRoi.dispose();
        throw DocumentException(err);
      }
      return documentImageRoi;
    }