Skip to content

Commit c3bab5c

Browse files
committed
Update Documentation
1 parent 4a55c14 commit c3bab5c

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

docs/topics/recipes.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1483,6 +1483,22 @@ $drawing->setHeight(36);
14831483
$drawing->setWorksheet($spreadsheet->getActiveSheet());
14841484
```
14851485

1486+
Note that GD images are memory-intensive.
1487+
1488+
### Creating a Drawing from string or stream data
1489+
1490+
If you want to create a drawing from a string containing the binary image data, or from an external datasource such as an S3 bucket, then you can create a new MemoryDrawing from these sources using the `fromString()` or `fromStream()` static methods.
1491+
1492+
```php
1493+
$drawing = MemoryDrawing::fromString($imageString);
1494+
```
1495+
1496+
```php
1497+
$drawing = MemoryDrawing::fromStream($imageStreamFromS3Bucket);
1498+
```
1499+
1500+
Note that this is a memory-intensive process, like all gd images; and also creates a temporary file.
1501+
14861502
## Reading Images from a worksheet
14871503

14881504
A commonly asked question is how to retrieve the images from a workbook

0 commit comments

Comments
 (0)