搜索分类、插件与代码仓

image_painter 封面
插件详情v0.7.1

image_painter

一个用于在图像上绘图的 Flutter 包。支持颜色、笔触宽度、不同的绘画模式以及导出图像。

AndroidiOSmacOSWindowsLinux
近 30 天下载
7050
喜欢数
214
Pub 分数
150

安装插件

flutter pub add image_painter

插件介绍

基于插件公开信息、社区数据与项目使用情况整理的选型参考。

一个 Flutter 包,允许用户使用可自定义的颜色、画笔粗细和绘画模式在图像上进行绘制。它支持直接在图像上进行交互式绘画,并允许导出结果。适用于需要在 Flutter 应用中进行图像注释、草图绘制或创意编辑的应用程序。该包跨平台,可在 Android、iOS、macOS、Windows 和 Linux 上无缝运行。

适合场景

  • 图像注释
  • 创意素描
  • 数字签名捕获
  • 照片编辑工具
  • 交互式绘图应用

主要特点

  • 可定制的油漆颜色
  • 可调笔画宽度
  • 多种绘画模式
  • 导出绘制的图像
  • 跨平台支持

适合对象

  • 需要绘图功能的应用程序开发者
  • 教育或设计应用
  • 用户生成内容平台
  • 移动和桌面多媒体应用

使用建议

  • 需要处理图像加载和渲染
  • 性能可能因大图像而异
  • 仅限基本绘画操作
  • 无内置的撤销/重做功能
  • 依赖外部图像源管理

原始 README

以下为关联源码仓库的 README 原文快照,最新内容请访问源码仓库。

image_painter

pub package style: effective dart Platform Badge License: MIT

A flutter implementation of painting over image.

Overview

demo!

Features

  • Seven available paint modes. Line, Box/Rectangle, Circle, Freestyle/Signature, Dotted Line, Arrow and Text.
  • Four constructors for adding image from Network Url, Asset Image, Image from file and from memory.
  • Export image as memory bytes which can be converted to image. Implementation provided on example
  • Ability to undo and clear drawings.
  • Built in control bar.

[Note] Tested and working only on flutter stable channel. Please make sure you are on stable channel of flutter before using the package.

Getting started

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.

Using the library

Check out the example

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.

Issues and Support.

For any issues or support please visit the Issues.

所属分类

源码仓库

使用此插件的项目

暂无相关数据。