ImageCropStyle

A class that represents a crop style that can be applied to image components. You can't set the
size of an image or resize it, but you can crop the image.

### Methods

| Method | Return type | Brief description |
|---|---|---|
| `https://developers.google.com/apps-script/reference/card-service/image-crop-style#setAspectRatio(Number)` | `https://developers.google.com/apps-script/reference/card-service/image-crop-style#` | Sets the aspect ratio to use if the crop type is `RECTANGLE_CUSTOM`. |
| `https://developers.google.com/apps-script/reference/card-service/image-crop-style#setImageCropType(ImageCropType)` | `https://developers.google.com/apps-script/reference/card-service/image-crop-style#` | Sets the crop type for the image. |

## Detailed documentation

### `setAspectRatio(ratio)`

Sets the aspect ratio to use if the crop type is `RECTANGLE_CUSTOM`. The ratio must
be a positive value.

#### Parameters

| Name | Type | Description |
|---|---|---|
| `ratio` | `Number` | The ratio to apply. |

#### Return


`https://developers.google.com/apps-script/reference/card-service/image-crop-style#` --- This object, for chaining.

#### Throws


[`Error`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error) --- if the input is negative or zero.

*** ** * ** ***

### `setImageCropType(type)`

Sets the crop type for the image. Default is SQUARE.

#### Parameters

| Name | Type | Description |
|---|---|---|
| `type` | `https://developers.google.com/apps-script/reference/card-service/image-crop-type` | The crop type. |

#### Return


`https://developers.google.com/apps-script/reference/card-service/image-crop-style#` --- This object, for chaining.