updateRect method
Future<bool>
updateRect({
- int destX = 0,
- int destY = 0,
- int? width,
- int? height,
- int srcX = 0,
- int srcY = 0,
- int? texWidth,
- int? texHeight,
- double? fullWidth,
- double? fullHeight,
- bool backgroundFill = true,
override
Update texture's sub-rectangle (destX
,destY
,width
,height
) with the sub-rectangle (srcX
,srcY
,width
,height
) of the PDF page scaled to fullWidth
x fullHeight
size.
If backgroundFill
is true, the sub-rectangle is filled with white before rendering the page content.
The method can also resize the texture if you specify texWidth
and texHeight
.
Returns true if succeeded.
Implementation
Future<bool> updateRect({int destX = 0, int destY = 0, int? width, int? height, int srcX = 0, int srcY = 0, int? texWidth, int? texHeight, double? fullWidth, double? fullHeight, bool backgroundFill = true}) async {
final result = await (_channel.invokeMethod<int>('updateTex', {
'docId': _doc.docId,
'pageNumber': pageNumber,
'texId': texId,
'destX': destX,
'destY': destY,
'width': width,
'height': height,
'srcX': srcX,
'srcY': srcY,
'texWidth': texWidth,
'texHeight': texHeight,
'fullWidth': fullWidth,
'fullHeight': fullHeight,
'backgroundFill': backgroundFill
}) as FutureOr<int>);
if (result >= 0) {
_texWidth = texWidth ?? _texWidth;
_texHeight = texHeight ?? _texHeight;
}
return result >= 0;
}