Re: [PHP] creating images using php

2005-11-08 Thread Richard Lynch
On Wed, November 2, 2005 5:31 am, bala chandar wrote:
 i know there is a support for Imagemagick in php. I have a doubt.

Could be.

 Please help me out.
 I have to create a image in which a text which should insert a texture
 withing it something like what we do with powerpoint word art. for eg.
 Rose is the text and i want to Rose picture withing the text using
 php. any suggestions or help welcomed!

http://php.net/gd
might have what you need.

If not, and if ImageMagick isn't built into your PHP, you could use:
http://php.net/exec to run ImageMagick from the command line.

-- 
Like Music?
http://l-i-e.com/artists.htm

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] creating images using php

2005-11-02 Thread bala chandar
Hi,

i know there is a support for Imagemagick in php. I have a doubt.

Please help me out.
I have to create a image in which a text which should insert a texture
withing it something like what we do with powerpoint word art. for eg.
Rose is the text and i want to Rose picture withing the text using
php. any suggestions or help welcomed!


--
name balachandar muruganantham/name
Yahoo! mbchandar/Yahoo!
Hotmail  mbchandar/Hotmail
blog http://chandar.blogspot.com/blog
webhttp://www.balachandar.net/web
talk http://www.expertstalk.org/talk
shophttp://www.chennaishopping.com/shop

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Creating Images

2003-09-04 Thread Jed R. Brubaker
I have been trying to write some image creation scripts, and although I have
a version of PHP that includes image support, I keep getting errors related
to imagecreatefrompng(). Here is the latest error:

Fatal error: Call to undefined function: imagecreatefrompng() in
/web/html-docs/psych/jb4920/public_html/pic/picture.php on line 12

Isn't imagecreatfrompng() a built in function? Anyone run across something
like this or a suggestion?

Thanks for the help!
Jed R. Brubaker

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Creating Images

2003-09-04 Thread Curt Zirzow
* Thus wrote Jed R. Brubaker ([EMAIL PROTECTED]):
 I have been trying to write some image creation scripts, and although I have
 a version of PHP that includes image support, I keep getting errors related
 to imagecreatefrompng(). Here is the latest error:
 
 Fatal error: Call to undefined function: imagecreatefrompng() in
 /web/html-docs/psych/jb4920/public_html/pic/picture.php on line 12
 
 Isn't imagecreatfrompng() a built in function? Anyone run across something
 like this or a suggestion?

You need the png libraries installed. configure usually can figure
out where they are at but sometimes you may have to issue a

  configure [other options]  --with-png-dir=/path/to/libpng/dir/


Curt
-- 
I used to think I was indecisive, but now I'm not so sure.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Creating Images

2003-06-15 Thread Don Read

On 09-Jun-2003 Chris Blake wrote:
snip

 
 Any ideas on how to make it so that the error I specified comes up and
 not the The image http://xxx.xxx.xxx.xxx.x blah blah part.
 
 Here`s the code :
 ---
 ?php
   Header('Content-type: image/png');


A little too early for that. Wait 'til the image is properly created ...

snip

 

//here:

Header('Content-type: image/png');

   ImagePng($image);
   }
ImageDestroy($image);
?

Regards,
-- 
Don Read   [EMAIL PROTECTED]
-- It's always darkest before the dawn. So if you are going to 
   steal the neighbor's newspaper, that's the time to do it.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Creating Images

2003-06-09 Thread Chris Blake
Greetings learned PHP(eople),

I am using the code below to create buttons based on entries that are
inserted into a text field from the preceding page.

I got this code from my trusty tome PHP and MySQL Web Development by
Luke Wellign/Laura Thomson.

Problem is this :

If I type in more than 18 characters the image creation fails with :

The image http://xx..xx.xx/Generic/Admin/make_buttons.php;
cannot be displayed, because it contains errors

When I view the HTML page source code, it simply states
Text given is too large for button 

Any ideas on how to make it so that the error I specified comes up and
not the The image http://xxx.xxx.xxx.xxx.x blah blah part.

Here`s the code :
---
?php
  Header('Content-type: image/png');
   
  //Posted from previous page
  //Button text and colour
  $button_text = $HTTP_POST_VARS['button_text'];
  $colour = $HTTP_POST_VARS['colour'];

  if (empty($button_text) || empty($colour))
 {
 echo 'Could not create button';
 exit;
 }
  
  //Create image from existing image
  $image = imagecreatefrompng ('images/purple.png');

  $image_width = ImageSX($image);
  $image_height = ImageSY($image);

  //Image needs 18 pixel margin in from the edge image 
  $image_width_wo_margins = $image_width - (2 * 18);
  $image_height_wo_margins = $image_height - (2 * 18);

  //Work out if the font size will fit and make it
  //smaller until it does. Start with large size and scale down
  $font_size = 33;
  
  //Set font name and location
  $fontname =
/home/data/ClientWebs/chrisplay/Generic/Admin/a_d_mono.ttf;

  do
   {
   $font_size--;

   //Find out the size of the text at that font size
   $bbox = imagettfbbox ($font_size, 0, $fontname, $button_text);

   $right_text = $bbox[2]; //Right co-ordinate
   $left_text = $bbox[0]; //Left co-ordinate
   $width_text = $right_text - $left_text; //How wide is it ?
   $height_text = abs($bbox[7] - $bbox[1]); //How tall is it ?
   }

  while ($font_size  8 
($height_text  $image_height_wo_margins || $width_text 
$image_width_wo_margins)
);
  
 if ($height_text  $image_height_wo_margins || $width_text 
$image_width_wo_margins)
  {
  //No readable font size will fit on button
  echo 'Text given is too large for button';
  }
 else
  {
  //The font size fits
  //Now where to put it
  $text_x = $image_width/2.0 - $width_text/2.0;
  $text_y = $image_height/2.0 - $height_text/2.0;
  if ($left_text  0 )
  
  $text_x += abs($left_text); //Factor for left overhang
  $above_line_text = abs($bbox[7]); //How far above the baseline
  $text_y += $above_line_text; //Add baseline factor

  $text_y -= 2; //Adjustment factor for shape of our template
  $white = ImageColorAllocate($image, 0,0,255);

  ImageTTFText ($image, $font_size, 0, $text_x, $text_y, $white,
$fontname , $button_text);

  ImagePng($image);
  }
   ImageDestroy($image);
   ?
  
  
Thanks in advance for any assistance..

Regards
-- 
Chris Blake
Office : (011) 782-0840
Cell : 083 985 0379

All most men really want in life is a wife, a house, two kids and a car,
a cat, no maybe a dog.  Ummm, scratch one of the kids and add a dog.
Definitely a dog.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Creating images on the fly

2001-08-20 Thread Niklas Lampen

Is it possible to create images on the fly, if my phpinfo says nothing about
GD? What I know is that ImageCreateFromPNG() says it's undefined.

If not, what do I need to install to php to make it possible?


Niklas Lampén


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]