v0.7.1image_painter
一個用於在影像上繪圖的 Flutter 套件。支援顏色、筆觸寬度、不同繪圖模式及匯出影像。
214喜歡 5100近 30 天下載150Pub 分數
AndroidiOSmacOSWindowsLinux
用於在圖像上繪畫的 Flutter 套件
{"sdk":"flutter"}以下為英文專案原文快照,最新內容請造訪 GitHub。
pub package style: effective dart Platform Badge License: MIT
A flutter implementation of painting over image.
demo!
[Note] Tested and working only on flutter stable channel. Please make sure you are on stable channel of flutter before using the package.
In the pubspec.yaml of your flutter project, add the following dependency:
dependencies:
...
image_painter: latest
In your library add the following import:
import 'package:image_painter/image_painter.dart';
For help getting started with Flutter, view the online documentation.
Basic usage of the libary:
ImagePainter.network: Painting over image from network url./// Initialize `ImagePainterController`.
final imagePainterController = ImagePainterController();
/// Provide controller to the painter.
ImagePainter.network("https://sample_image.png",
controller: imagePainterController,scalable: true),
///Export the image:
Uint8List byteArray = await imagePainterController.exportImage();
/// Create a file or create a File instance of existing file.
File imgFile = File('directoryPath/fileName.png');
/// Now you use `Uint8List` data and write it into the file.
imgFile.writeAsBytesSync(image);
For more thorough implementation guide, check the example.
For any issues or support please visit the Issues.