Reference documentation and code samples for the Google Apps Chat V1 Client class ImageCropStyle.
Represents the crop style applied to an image.
Google Workspace add-ons and Chat apps: For example, here's how to apply a 16:9 aspect ratio:
cropStyle {
"type": "RECTANGLE_CUSTOM",
"aspectRatio": 16/9
}
Generated from protobuf message google.apps.card.v1.ImageCropStyle
Namespace
Google \ Apps \ Card \ V1Methods
__construct
Constructor.
| Parameters | |
|---|---|
| Name | Description |
data |
array
Optional. Data for populating the Message object. |
↳ type |
int
The crop type. |
↳ aspect_ratio |
float
The aspect ratio to use if the crop type is |
getType
The crop type.
| Returns | |
|---|---|
| Type | Description |
int |
Enum of type ImageCropType. |
setType
The crop type.
| Parameter | |
|---|---|
| Name | Description |
var |
int
Enum of type ImageCropType. |
| Returns | |
|---|---|
| Type | Description |
$this |
|
getAspectRatio
The aspect ratio to use if the crop type is RECTANGLE_CUSTOM.
For example, here's how to apply a 16:9 aspect ratio:
cropStyle {
"type": "RECTANGLE_CUSTOM",
"aspectRatio": 16/9
}
| Returns | |
|---|---|
| Type | Description |
float |
|
setAspectRatio
The aspect ratio to use if the crop type is RECTANGLE_CUSTOM.
For example, here's how to apply a 16:9 aspect ratio:
cropStyle {
"type": "RECTANGLE_CUSTOM",
"aspectRatio": 16/9
}
| Parameter | |
|---|---|
| Name | Description |
var |
float
|
| Returns | |
|---|---|
| Type | Description |
$this |
|