搜尋分類、套件與程式碼儲存庫

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.

所屬分類

原始碼儲存庫

使用此套件的專案

暫無相關資料。