overlay method
The overlay parameter allows you to put one image on top of another.
You need to specify the relative URL of the image as
value for this parameter.
By default, the cropping alignment will be middle,
center. See overlay-align for more details.
It accepts overlayUrl
as a parameter to put one
overlayUrl
on top of _imageUrl
There are optional params also like overlayAlign
,
overlayRepeat
, overlayWidth
, overlayHeight
Fr more details read the documentation:
https://www.contentstack.com/docs/developers/apis/image-delivery-api/#overlay
For more details, Read documentation: https://www.contentstack.com/docs/developers/apis/image-delivery-api/#overlay-pad
Example
final stack = contentstack.Stack(apiKey, deliveryToken, environment);
final imageTransformation = stack.imageTransform(imageUrl);
final response = await imageTransformation.
overlay('overlayUrl', overlayWidth: '').fetch();
Implementation
void overlay(String overlayUrl,
{String overlayAlign,
String overlayRepeat,
int overlayWidth,
int overlayHeight}) {
query.append('overlay', overlayUrl);
if (overlayAlign != null) {
query.append('overlay-align', overlayAlign);
}
if (overlayRepeat != null) {
query.append('overlay-repeat', overlayRepeat);
}
if (overlayWidth != null) {
query.append('overlay-width', overlayWidth);
}
if (overlayHeight != null) {
query.append('overlay-height', overlayHeight);
}
}