Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

imagecolorallocate imagestring

Posted on 2008-06-24
2
Medium Priority
?
294 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 200 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: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying 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

Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
Many old projects have bad code, but the budget doesn't exist to rewrite the codebase. You can update this code to be safer by introducing contemporary input validation, sanitation, and safer database queries.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
Suggested Courses

916 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