搜索插件、代码仓与 APP 分类

floodfill_image 封面
插件详情v0.0.8

floodfill_image

可在提供的图像上使用油漆桶功能的 Flutter 小部件。

AndroidiOSWebmacOSWindowsLinux
近 30 天下载
99
喜欢数
71
Pub 分数
140

安装插件

flutter pub add floodfill_image

插件介绍

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

floodfill_image 包提供了一个 Flutter 小部件,可在图像上实现油漆桶功能,允许用户用选定的颜色填充连续区域。它非常适合需要在定义边界内应用颜色填充的交互式绘图和编辑应用程序。该包支持 Android、iOS、Web、macOS、Windows 和 Linux 等多个平台,确保广泛的兼容性。它可无缝集成到现有的 Flutter 应用中,并为在图像小部件上实现洪水填充操作提供了简单的 API。

适合场景

  • 互动图像着色应用
  • 数字绘画工具
  • 图像编辑功能
  • 教育绘图应用
  • 用户驱动的图形颜色填充

主要特点

  • 油漆桶填充功能
  • 跨平台支持
  • 与 Image 小部件的简单集成
  • 实时填充更新
  • 支持多种图像源

适合对象

  • 开发绘图工具的应用程序开发者
  • 教育软件创作者
  • 使用 Flutter 的数字艺术家
  • 需要交互式图像操作的应用程序
  • 需要快速填充图像颜色的用户

使用建议

  • 性能可能因大图或复杂图像而异
  • 仅限基于像素的填充,不支持高级蒙版
  • 需要仔细处理触摸输入以确保精度
  • 可能需要对高分辨率图像进行优化
  • 不适用于基于矢量的图像编辑

原始 README

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

Flood Fill Image

Version GitHub license Support

Overview

Flutter widget that can use paint bucket functionality on the provided image using Queue-Linear Flood Fill Algorithm by J. Dunlap. For more info check out my blog : Flood Fill in Flutter

Kindly like:+1: the package at pub dev or star:star: the repo in github if you find this library useful. :wink:

demo dog gif

Usage

FloodFillImage(
    imageProvider: AssetImage("assets/dog.jpg"),
    fillColor: Colors.amber,
    avoidColor: [Colors.transparent, Colors.black],
)

Parameters

Name Type Description
imageProvider ImageProvider The image to display via ImageProvider.
You can use AssetImage or NetworkImage.
fillColor Color Color use for filling the area.
isFillActive bool Set false if you want to disable on touch fill function.
Default value is true.
avoidColor List<Color> List of color that determines to which Color is/are needed to be avoided upon touch.
Note: Nearest color shade is applied.
tolerance int Set fill value tolerance that ranges from 0 to 100.
Default value is 8.
width int Width of the image. Parent widget width will be prioritize if it's provided and less than the image width.
height int Height of the image. Parent widget height will be prioritize if it's provided and less than the image height.
alignment AlignmentGeometry Alignment of the image.
loadingWidget Widget Widget to show while the image is being processed on initialization.
It uses CircularProgressIndicator by default.
onFloodFillStart Function(Offset position,Image image) Callback function that returns the touch position and an Image from dart:ui when flood fill starts.
Note: Touch coordinate is relative to the image dimension.
onFloodFillEnd Function(Image image) Callback function that returns an Image from dart:ui when flood fill ended.

Coffee

Buy Me A Coffee

License

MIT License, see the LICENSE.md file for details.

所属分类

依赖

依赖清单 1 项

源码仓库

使用此插件的项目

暂无相关数据。