-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
set opacity for canvas in copyResampled and add alpha example script
- Loading branch information
1 parent
10ef426
commit 2c31ec7
Showing
8 changed files
with
63 additions
and
21 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
<?php | ||
/** | ||
* Opacity image and text support example. | ||
* php version 7.1 | ||
* | ||
* @category PHP | ||
* @package PosterEditor | ||
* @author Anton Lukin <anton@lukin.me> | ||
* @license MIT License (http://www.opensource.org/licenses/mit-license.php) | ||
* @link https://github.com/antonlukin/poster-editor | ||
*/ | ||
|
||
require_once __DIR__ . '/../vendor/autoload.php'; | ||
|
||
try { | ||
$image = new PosterEditor\PosterEditor(); | ||
$image->canvas(500, 500, array('color' => '#fff')); | ||
|
||
$image->insert( | ||
'images/icon.png', | ||
array( | ||
'y' => 50, | ||
'opacity' => 0, | ||
) | ||
); | ||
|
||
$image->insert( | ||
file_get_contents('images/icon.png'), | ||
array( | ||
'y' => 200, | ||
'opacity' => 40, | ||
) | ||
); | ||
|
||
$icon = new PosterEditor\PosterEditor(); | ||
$icon->make(file_get_contents('images/icon.png')); | ||
|
||
$image->insert( | ||
$icon, | ||
array( | ||
'y' => 350, | ||
'opacity' => 80, | ||
) | ||
); | ||
|
||
$image->show('png'); | ||
|
||
} catch(Exception $e) { | ||
echo $e->getMessage(); | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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