know the handler the image

GD and GD2 are useful libraries for creating graphics on-the-fly. Discuss your PHP GD and GD2 scripts here.

Moderators: onion2k, General Moderators

Post Reply
sinita
Forum Newbie
Posts: 2
Joined: Mon Apr 16, 2007 3:54 pm

know the handler the image

Post by sinita »

Hi, sorry my bad english.
How I can to know the position in memory temporal after ImagePNG($image) and before ImageDestroy($image)?
Thanks a lot
:oops: :?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

What?
User avatar
onion2k
Jedi Mod
Posts: 5263
Joined: Tue Dec 21, 2004 5:03 pm
Location: usrlab.com

Post by onion2k »

If I understand you correctly the answer is that you can't using plain PHP. There's no low level memory addressing functions. You could write an extension in C or something that could query the address of a handle, but I think handles are just strings that act a bit like pointers anyway, so you'd need to lookup the real address in PHP's address table. It'd be very tricky.

Why do you need to do this anyway? The only thing I can think of would be that you're trying to access the memory area using some sort of external application. I wouldn't go there if I were you. It's asking for trouble.
sinita
Forum Newbie
Posts: 2
Joined: Mon Apr 16, 2007 3:54 pm

Post by sinita »

feyd | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]


OK...I'm trying to print a report with TCPDF, I need to show an image but within save it. Something like this:

Code: Select all

<?php

$image = imagecreate(300,60);

...

ImagePNG($image);

//In this point i need to get the handler of that image in order to pass it to $pdf->GDImage($image, 50, 25, 40); 

ImageDestroy($image);

?>
I hope you can help me

Thanks


feyd | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
Post Reply