Using generated images?

Jul 22, 2014 at 10:42 AM
Hi,

I have a script that outputs an image, and usually I can use this image with something like:

<img src="data:image/png;base64,<?php echo base64_encode($image);?>" />

I need to use one of these generated images in the powerpoint presentation, is this possible?

Thanks

Kevin
Jul 22, 2014 at 11:49 AM
Edited Jul 22, 2014 at 11:50 AM
Just in case someone is wondering - i've answered my own question with the following:
$imageString = file_get_contents($image); // base 64 image string
$imageSrc = imagecreatefromstring($imageString); // convert to resource

$currentSlide = $powerpoint->createSlide();
$shape = new PHPPowerPoint_Shape_MemoryDrawing();
$shape->setName('Graph1');
$shape->setDescription('Graph1');
$shape->setImageResource($imageSrc);
$shape->setRenderingFunction(PHPPowerpoint_Shape_MemoryDrawing::RENDERING_PNG);
$shape->setMimeType(PHPPowerPoint_Shape_MemoryDrawing::MIMETYPE_DEFAULT);
$shape->setHeight(500);
$shape->setOffsetX(120);
$shape->setOffsetY(120);
$currentSlide->addShape($shape);
Just ensure you do images before text on every slide.