-
Notifications
You must be signed in to change notification settings - Fork 526
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #207 from Progi1984/issue192
#192 : Image Adapter
- Loading branch information
Showing
53 changed files
with
1,055 additions
and
930 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
Large diffs are not rendered by default.
Oops, something went wrong.
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.
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
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
Oops, something went wrong.