Image.fromResized constructor
Image.fromResized(})
Implementation
Image.fromResized(Image other,
{required int width, required int height, bool noAnimation = false})
: _exif = other._exif?.clone(),
iccProfile = other.iccProfile?.clone(),
frameType = other.frameType,
loopCount = other.loopCount,
backgroundColor = other.backgroundColor?.clone(),
frameDuration = other.frameDuration,
frameIndex = other.frameIndex {
_createImageData(
width, height, other.format, other.numChannels, other.palette);
if (other.extraChannels != null) {
extraChannels = Map<String, ImageData>.from(other.extraChannels!);
}
if (other.textData != null) {
textData = Map<String, String>.from(other.textData!);
}
frames.add(this);
if (!noAnimation) {
final numFrames = other.numFrames;
for (var fi = 1; fi < numFrames; ++fi) {
final frame = other.frames[fi];
addFrame(Image.fromResized(frame, width: width, height: height));
}
}
}