Solved

imagecolorallocate imagestring

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Php pie charts 3 26
Load google maps api into wordpress 5 38
test if query has no results 2 19
Is there a limit to how many inner joins you should use? 4 11
I imagine that there are some, like me, who require a way of getting currency exchange rates for implementation in web project from time to time, so I thought I would share a solution that I have developed for this purpose. It turns out that Yaho…
Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this.Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it is …
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…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…

863 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

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now