Solved

imagecolorallocate imagestring

Posted on 2008-06-24
2
289 Views
Last Modified: 2008-06-24
Hello,

I like to make the background transparent and the font color white.
some help is needed please:


$image = imagecreate(60, 17);
$white = imagecolorallocate($image, 255, 255, 255);
$black = imagecolorallocate($image,   0,   0,   0);
imagestring ($image, 3, 0, 4, $t_num, $black);
imagepng    ($image);
imagedestroy($image);

Open in new window

0
Comment
Question by:Milcoi
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 

Author Comment

by:Milcoi
ID: 21854334
can I just add??:
ImageColorTransparent($Image, $back);
0
 
LVL 20

Accepted Solution

by:
virmaior earned 50 total points
ID: 21855829
yes but in all lower case and $black instead of $back (http://us2.php.net/manual/en/function.imagecolortransparent.php)

and when you do that anything which was black will be transparent...

transparency makes that color a signal in the image rather than setting the color to transparent for future painting.
0

Featured Post

Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Popularity Can Be Measured Sometimes we deal with questions of popularity, and we need a way to collect opinions from our clients.  This article shows a simple teaching example of how we might elect a favorite color by letting our clients vote for …
Deprecated and Headed for the Dustbin By now, you have probably heard that some PHP features, while convenient, can also cause PHP security problems.  This article discusses one of those, called register_globals.  It is a thing you do not want.  …
The viewer will learn how to count occurrences of each item in an array.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question