Image_Problem
am 23.07.2009 00:26:56 von Bilal Ahmad
--00163649a6036944f8046f52de43
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Hi All, I wanna ask a question pleasenV. I am trying to create an image on
fly, please do help me , following is the code.
*File Name : Font.php
Code: *
Image Creation
*File Name : image.php
Code:*
[php]
$name = $_GET['text'];
$pic = imagecreatetruecolor(100, 100);
$text_color = imagecolorallocate($pic, 255, 255, 255);
imagestring($pic, 10, 15, 15, $name, $text_color);
$pi = Imagejpeg($pic,"pic.jpg");
echo $pi;
ImageDestroy($pic);
[/php]
*Problem: *
What this code is doing is that, it creates a new image with the text (that
user enters) on it, but loads the image that was created previously, I want
that it should display the text on the picture which users enter on the fly.
( e.g. If user enter TEXT as text it should display TEXT on the picture
displayed, soon after we get response from ajax).I hope you got the problem.
Thanks
--00163649a6036944f8046f52de43--
Re: Image_Problem
am 23.07.2009 11:21:07 von Richard Quadling
2009/7/22 Bilal Ahmad :
> Hi All, I wanna ask  a question pleasenV. I am trying to create an i=
mage on
> fly, please do help me , following is the code.
>
> *File Name : Font.php
> Code: *
>
>
>
> Image Creation
>
>
>
>
>
e;">
> Â
>
>
>
>
> *File Name : image.php
> Code:*
>
> [php]
>
> $name =3D $_GET['text'];
>
> Â $pic =3D imagecreatetruecolor(100, 100);
> Â $text_color =3D imagecolorallocate($pic, 255, 255, 255);
> Â imagestring($pic, 10, 15, 15, Â $name, $text_color);
> Â $pi =3D Imagejpeg($pic,"pic.jpg");
> Â echo $pi;
> Â ImageDestroy($pic);
>
> [/php]
>
> *Problem: *
>
> What this code is doing is that, it creates a new image with the text (th=
at
> user enters) on it, but loads the image that was created previously, I wa=
nt
> that it should display the text on the picture which users enter on the f=
ly.
> ( e.g. If user enter TEXT as text it should display TEXT on the picture
> displayed, soon after we get response from ajax).I hope you got the probl=
em.
>
>
> Thanks
>
Try changing ...
$pi =3D Imagejpeg($pic,"pic.jpg");
echo $pi;
to ...
imagejpeg($pic);
--=20
-----
Richard Quadling
Zend Certified Engineer : http://zend.com/zce.php?c=3DZEND002498&r=3D213474=
731
"Standing on the shoulders of some very clever giants!"
ZOPA : http://uk.zopa.com/member/RQuadling
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Re: Image_Problem
am 23.07.2009 18:43:56 von Bilal Ahmad
--00163645950a93873b046f6231a7
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Hi All, Thanx Richard for your reply, but it isn't working either, please
help me out, Thanks. I can explain the problem again if some one has ne
problem in understanding of the problem. Thanks
On Thu, Jul 23, 2009 at 2:21 PM, Richard Quadling
wrote:
> 2009/7/22 Bilal Ahmad :
> > Hi All, I wanna ask a question pleasenV. I am trying to create an image
> on
> > fly, please do help me , following is the code.
> >
> > *File Name : Font.php
> > Code: *
> >
> >
> >
> > Image Creation
> >
> >
> >
> >
> >
> >
> >
> >
> > *File Name : image.php
> > Code:*
> >
> > [php]
> >
> > $name = $_GET['text'];
> >
> > $pic = imagecreatetruecolor(100, 100);
> > $text_color = imagecolorallocate($pic, 255, 255, 255);
> > imagestring($pic, 10, 15, 15, $name, $text_color);
> > $pi = Imagejpeg($pic,"pic.jpg");
> > echo $pi;
> > ImageDestroy($pic);
> >
> > [/php]
> >
> > *Problem: *
> >
> > What this code is doing is that, it creates a new image with the text
> (that
> > user enters) on it, but loads the image that was created previously, I
> want
> > that it should display the text on the picture which users enter on the
> fly.
> > ( e.g. If user enter TEXT as text it should display TEXT on the picture
> > displayed, soon after we get response from ajax).I hope you got the
> problem.
> >
> >
> > Thanks
> >
>
> Try changing ...
>
> $pi = Imagejpeg($pic,"pic.jpg");
> echo $pi;
>
> to ...
>
> imagejpeg($pic);
>
>
>
> --
> -----
> Richard Quadling
> Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498&r=213474731
> "Standing on the shoulders of some very clever giants!"
> ZOPA : http://uk.zopa.com/member/RQuadling
>
--00163645950a93873b046f6231a7--