forked from PHPOffice/PhpSpreadsheet
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
57 changed files
with
908 additions
and
141 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
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,69 @@ | ||
<?php | ||
|
||
require __DIR__ . '/../Header.php'; | ||
|
||
use PhpOffice\PhpSpreadsheet\Spreadsheet; | ||
use PhpOffice\PhpSpreadsheet\Worksheet\Drawing; | ||
|
||
//var_dump(realpath(__DIR__ . '/../images/blue_square.png')); | ||
//exit(); | ||
|
||
$path = __DIR__ . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'images/blue_square.png'; | ||
$spreadsheet = new Spreadsheet(); | ||
$spreadsheet->getProperties()->setTitle('53_ImageOpacity'); | ||
|
||
$helper->log('Add image to spreadsheet 6 times with different opacities'); | ||
$sheet = $spreadsheet->getActiveSheet(); | ||
$sheet->setTitle('Squares different opacities'); | ||
$sheet->setShowGridLines(false); | ||
|
||
$drawing = new Drawing(); | ||
$drawing->setName('Blue Square opacity not specified'); | ||
$drawing->setPath($path); | ||
$drawing->setCoordinates('A1'); | ||
$drawing->setCoordinates2('B5'); | ||
$drawing->setWorksheet($sheet); | ||
|
||
$drawing = new Drawing(); | ||
$drawing->setName('Blue Square opacity 80%'); | ||
$drawing->setPath($path); | ||
$drawing->setCoordinates('C1'); | ||
$drawing->setCoordinates2('D5'); | ||
$drawing->setOpacity(80000); | ||
$drawing->setWorksheet($sheet); | ||
|
||
$drawing = new Drawing(); | ||
$drawing->setName('Blue Square opacity 60%'); | ||
$drawing->setPath($path); | ||
$drawing->setCoordinates('E1'); | ||
$drawing->setCoordinates2('F5'); | ||
$drawing->setOpacity(60000); | ||
$drawing->setWorksheet($sheet); | ||
|
||
$drawing = new Drawing(); | ||
$drawing->setName('Blue Square opacity 40%'); | ||
$drawing->setPath($path); | ||
$drawing->setCoordinates('A8'); | ||
$drawing->setCoordinates2('B12'); | ||
$drawing->setOpacity(40000); | ||
$drawing->setWorksheet($sheet); | ||
|
||
$drawing = new Drawing(); | ||
$drawing->setName('Blue Square opacity 20%'); | ||
$drawing->setPath($path); | ||
$drawing->setCoordinates('C8'); | ||
$drawing->setCoordinates2('D12'); | ||
$drawing->setOpacity(20000); | ||
$drawing->setWorksheet($sheet); | ||
|
||
$drawing = new Drawing(); | ||
$drawing->setName('Blue Square opacity 0%'); | ||
$drawing->setPath($path); | ||
$drawing->setCoordinates('E8'); | ||
$drawing->setCoordinates2('F12'); | ||
$drawing->setOpacity(0); | ||
$drawing->setWorksheet($sheet); | ||
|
||
// Save | ||
$helper->write($spreadsheet, __FILE__, ['Xlsx', 'Html', 'Dompdf', 'Mpdf']); | ||
$spreadsheet->disconnectWorksheets(); |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
Oops, something went wrong.