forked from PHPOffice/PHPPresentation
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PHPOffice#192 : Image Adapter (Doc & UnitTests)
- Loading branch information
Showing
32 changed files
with
433 additions
and
620 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
.. _shapes_drawing: | ||
|
||
Drawing | ||
======= | ||
|
||
To create a drawing, you have four sources : File, GD, Base64 and ZipFile. | ||
|
||
File | ||
---- | ||
|
||
To create a drawing, use `createDrawingShape` method of slide. | ||
|
||
.. code-block:: php | ||
$oShape = $oSlide->createDrawingShape(); | ||
$oShape->setName('Unique name') | ||
->setDescription('Description of the drawing') | ||
->setPath('/path/to/drawing.filename'); | ||
It's an alias for : | ||
|
||
.. code-block:: php | ||
use PhpOffice\PhpPresentation\Shape\Drawing\File; | ||
$oShape = new File(); | ||
$oShape->setName('Unique name') | ||
->setDescription('Description of the drawing') | ||
->setPath('/path/to/drawing.filename'); | ||
$oSlide->addShape($oShape); | ||
GD | ||
-- | ||
|
||
.. code-block:: php | ||
use PhpOffice\PhpPresentation\Shape\Drawing\Gd; | ||
$gdImage = @imagecreatetruecolor($width, $height); | ||
$oShape = new Gd(); | ||
$oShape->setName('Sample image') | ||
->setDescription('Sample image') | ||
->setImageResource($gdImage) | ||
->setRenderingFunction(Drawing\Gd::RENDERING_JPEG) | ||
->setMimeType(Drawing\Gd::MIMETYPE_DEFAULT); | ||
$oSlide->addShape($oShape); | ||
Base64 | ||
------ | ||
|
||
.. code-block:: php | ||
use PhpOffice\PhpPresentation\Shape\Drawing\Base64; | ||
$oShape = new Base64(); | ||
$oShape->setName('Sample image') | ||
->setDescription('Sample image') | ||
->setImageResource($gdImage) | ||
->setData('data:image/jpeg;base64,..........'); | ||
$oSlide->addShape($oShape); | ||
ZipFile | ||
------- | ||
|
||
.. code-block:: php | ||
use PhpOffice\PhpPresentation\Shape\Drawing\ZipFile; | ||
$oShape = new ZipFile(); | ||
$oShape->setName('Sample image') | ||
->setDescription('Sample image') | ||
->setPath('zip://myzipfile.zip#path/in/zip/img.ext') | ||
$oSlide->addShape($oShape); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?php | ||
/** | ||
* This file is part of PHPPresentation - A pure PHP library for reading and writing | ||
* presentations documents. | ||
* | ||
* PHPPresentation is free software distributed under the terms of the GNU Lesser | ||
* General Public License version 3 as published by the Free Software Foundation. | ||
* | ||
* For the full copyright and license information, please read the LICENSE | ||
* file that was distributed with this source code. For the full list of | ||
* contributors, visit https://github.com/PHPOffice/PHPPresentation/contributors. | ||
* | ||
* @link https://github.com/PHPOffice/PHPPresentation | ||
* @copyright 2009-2015 PHPPresentation contributors | ||
* @license http://www.gnu.org/licenses/lgpl.txt LGPL version 3 | ||
*/ | ||
|
||
namespace PhpOffice\PhpPresentation\Shape; | ||
|
||
use PhpOffice\PhpPresentation\Shape\Drawing\Gd; | ||
|
||
/** | ||
* Memory drawing shape | ||
* @deprecated Drawing\Gd | ||
*/ | ||
class MemoryDrawing extends Gd | ||
{ | ||
} |
Oops, something went wrong.