承接 mwoerlein/vector-graphics 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

mwoerlein/vector-graphics

Composer 安装命令:

composer require mwoerlein/vector-graphics

包简介

Library for OO-modeling of vector graphics.

README 文档

README

Build Status

Vector Graphics Library

PHP library for OO-modeling of vector graphics.

Objectives

This library is designed to construct and describe general vector graphics independent of its application backend. These descriptions are intended to separate the definition on an graphic/chart/... and its representation.

A graphic could be serialized into various document types using there capabilities for vectorized representations. Currently supported/planed serializations are:

  • export as standalone SVG content
  • serialize into a Zend-PDF page
  • serialize into an Imagine image

Installation

To add vector-graphics as a local, per-project dependency to your project, simply add a dependency on mwoerlein/vector-graphics to your project's composer.json file. Here is a minimal example of a composer.json file:

{
    "require": {
        "mwoerlein/vector-graphics": ">0.2"
    }
}

Example Usage

The following example generates a svg-image containing a pentagram in a red circle inside of a square

$graphic = new Graphic();
$graphic->setViewportCorners(-50, -50, 50, 50);

$graphic->addRectangle(-49, -49, 98, 98)->setStrokeWidth(2);
$graphic->addCircle(0, 0, 45)->setFillColor('red', 0.5);

$radius = 40;
$path = new Path($radius * sin(0./5. * pi()), $radius * cos(0./5. * pi()));
$path->lineTo($radius * sin(4./5. * pi()), $radius * cos(4./5. * pi()));
$path->lineTo($radius * sin(8./5. * pi()), $radius * cos(8./5. * pi()));
$path->lineTo($radius * sin(2./5. * pi()), $radius * cos(2./5. * pi()));
$path->lineTo($radius * sin(6./5. * pi()), $radius * cos(6./5. * pi()));
$path->close();
$graphic->addPath($path);

header('Content-Type: image/svg+xml');
echo (new SVGWriter())->toSVG($graphic, 10, 10);

SVG Sample

Progress

see in ChangeLog

统计信息

  • 总下载量: 25
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: LGPL-2.1
  • 更新时间: 2015-11-18

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固