render image at runtime in a datagrid

Login or register to post comments
1 reply [Last post]
Offline
Joined: 03/25/2011

Hi,
I'm trying to embed a php thumbnail image to a datagrid column. I've already installed imagick, and Ghost script, and I'm able to create the image thumbnail using the code below:

$im = new Imagick();
$im->readImage( "path\filetoconvert.pdf" );
$im->setImageFormat( "jpg" );
$im->scaleimage(200,200,TRUE);
header( "Content-Type: image/jpeg" );
echo $im;

Is there a way to create a datagrid render function using the code above:
e.g.

public function htmlAttachmentsRender(FormLabTests $objFormLabTests){
..
return $image->render;
}

without relying on another page to get the thumbnail stream e.g. www.imagepath.com?id=1511&format="thumbnail"....

Thanks in advance

Offline
Joined: 04/22/2009

You might find some ideas in QImageControl. That control displays text as images I think, but it should have some useful code for you in it.