merge_images 1.0.3

Flutter Android iOS

A package that can merge images into one, support vertical and horizontal direction.

merge_images in flutter #

中文文档

Intro #

Merge images (Image stitching) in vertical or horizontal direction. Preview

Features #

  • Support vertical and horizontal direction.
  • Provide a helper to merge images in code and get a result image, and a widget to automatically merge and show images.
  • Automatically scale the image to fit other images (fit width in vertical, and height in horizontal).

Usage #

ImagesMergeHelper

Use this helper to merge images in code.

ui.Image image = await ImagesMergeHelper.margeImages(
[assetImage1,assetImage2,providerImage],///required,images list
   fit: true,///scale image to fit others
   direction: Axis.vertical,///direction of images
   backgroundColor: Colors.black26);///background color

Besides, it provider some functions to do image format conversion:

///ui.Image to Uint8List
Uint8List bytes = await ImagesMergeHelper.imageToUint8List(image);
///ui.Image to File
File file = await ImagesMergeHelper.imageToFile(image);
///Uint8List to ui.Image
ui.Image image = await ImagesMergeHelper.uint8ListToImage(imageBytes);
///file to ui.Image
ui.Image image = await ImagesMergeHelper.loadImageFromFile(file);
///asset to ui.Image
ui.Image image = await ImagesMergeHelper.loadImageFromAsset(assetPath);
///ImageProvider to ui.Image
ui.Image image = await ImagesMergeHelper.loadImageFromProvider(imageProvider);

ImageMerge

Use this widget to automatically merge and show images.

ImagesMerge(
  imageList,///required,images list
  direction: Axis.vertical,///direction
  backgroundColor: Colors.black26,///background color
  fit: false,///scale image to fit others
  controller: captureController,///controller to get screen shot
),

Besides, the widget was wrapped with RepaintBoundary, you can simply passing an instance of CaptureController and get the screen shot by calling capture().

///get capture of widget by RepaintBoundary
 getCapture() async{
  Uint8List bytes = await captureController.capture();
  }

LICENSE #

MIT License

4
likes
90
pub points
71%
popularity

A package that can merge images into one, support vertical and horizontal direction.

Repository (GitHub)
View/report issues

Documentation

API reference

Uploader

xiaozhizhong@gmail.com

License

MIT (LICENSE)

Dependencies

flutter, path_provider

More

Packages that depend on merge_images