getScaledImageBytes method

  1. @Deprecated("See [DeviceImage] for a better way to load scaled images.")
Future<Uint8List> getScaledImageBytes(
  1. LocalImageProvider localImageProvider,
  2. double scale
)

Returns a jpeg scaled by the given scaling factor in each dimension.

The resulting image will maintain its aspect ratio and fit within a pixelHeightscale x pixelWidthscale area.

Implementation

@Deprecated("See [DeviceImage] for a better way to load scaled images.")
Future<Uint8List> getScaledImageBytes(
    LocalImageProvider localImageProvider, double scale) async {
  int scaledHeight = (pixelHeight! * scale).round();
  int scaledWidth = (pixelWidth! * scale).round();
  return getImageBytes(localImageProvider, scaledHeight, scaledWidth);
}