Solved

imagecolorallocate imagestring

Posted on 2008-06-24
2
288 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
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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

These days socially coordinated efforts have turned into a critical requirement for enterprises.
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to count occurrences of each item in an array.

828 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