| Welcome to Graphics Requests Galore. We hope you enjoy your visit.
You're currently viewing our forum as a guest. This means you are limited to certain areas of the board and there are some features you can't use. If you join our community, you'll be able to access member-only sections, and use many member-only features such as customizing your profile, sending personal messages, and voting in polls. Registration is simple, fast, and completely free.
Join our community!
If you're already a member please log in to your account to access all of our features:
|
Test
RULES!!REMEMBER TO READ THE PINNED TOPIC AND FOLLOW ALL RULES IN THERE!!!
Gm-scorpius, My site :D
| Sokoto |
|
Graphic Artist

Group: Administrator
Posts: 436
Member No.: 1
Joined: 23-March 05

|
Yea You Shoud Make that lastest News text in white anyway Cool Site.. -Sokoto
--------------------
|
|
|
| scorpius |
|
Member
 
Group: Requester
Posts: 14
Member No.: 206
Joined: 5-July 05

|
I did that  but than you cant read it either :S I will post the code here for the text. maby some1 can change it into a good looking text: ---------------------------------------- [QUOTE]<?php require("../db.php"); header("Content-type: image/png"); $Opdracht = "SELECT * from news ORDER BY (date) DESC LIMIT 1"; $Verbinding = mysql_connect($ secret,$ secret,$ secret); $Resultaat = mysql_db_query($db,$Opdracht,$Verbinding); while ($Rij = mysql_fetch_array($Resultaat)) { $string = "Latest news: $Rij[title]"; $im = imagecreatefrompng("../pictures/newsbanner.png"); $white = imagecolorallocate($im, 0, 0, 0); imagestring($im, 4, 45, 40, $string, $white); imagepng($im); imagedestroy($im); } ?> ------------------------- maby some1 can change it into bolt ore the same text as the rest. Sorry but its dutch :S
--------------------
|
|
|
| Sokoto |
|
Graphic Artist

Group: Administrator
Posts: 436
Member No.: 1
Joined: 23-March 05

|
Hmmn Your Options 1.Ask Smartart as he knows php 2.Remove The Code and I can Update the logo with the text and can keep redoing it with the latest news as you like...  .
--------------------
|
|
|
| CPS |
|
Full Member
  
Group: Requester
Posts: 49
Member No.: 138
Joined: 15-May 05

|
--------------------
|
|
|
| ShogunWarrior |
|

..: The Vigilante :..

Group: Global Moderator
Posts: 456
Member No.: 8
Joined: 24-March 05

|
If your PHP install has the FreeType2 font library then you can use this function to draw text:
| CODE | | imagettftext($image,$size,$angle,$x, $y, $textcolor, $font_file_name, $text_string); |
| CODE | <?php require("../db.php"); header("Content-type: image/png"); $Opdracht = "SELECT * from news ORDER BY (date) DESC LIMIT 1"; $Verbinding = mysql_connect($secret,$secret,$secret); $Resultaat = mysql_db_query($db,$Opdracht,$Verbinding); while ($Rij = mysql_fetch_array($Resultaat)) {
$string = "Latest news: $Rij[title]"; $im = imagecreatefrompng("../pictures/newsbanner.png"); $white = imagecolorallocate($im, 0, 0, 0);
imagettftext($im, 50, 0, 20, 50, $white, 'coolfont.ttf'', $string); imagepng($im); imagedestroy($im); } ?> |
Or, if you have the PostScript T1 lib you can use:
| CODE | $font = imagepsloadfont($filename);//.pfb imagepstext($im, $string_text, $font, $text_size,$color, $bg_color,$x,$y);imagepsfreefont($font); |
To set the font. //Note: The $bg_color is not drawn, it is simply for anti-aliasing the text to match that color. So, you would use a blue or black color for $bg_color.
For example:
| CODE | <?php require("../db.php"); header("Content-type: image/png"); $Opdracht = "SELECT * from news ORDER BY (date) DESC LIMIT 1"; $Verbinding = mysql_connect($secret,$secret,$secret); $Resultaat = mysql_db_query($db,$Opdracht,$Verbinding); while ($Rij = mysql_fetch_array($Resultaat)) {
$string = "Latest news: $Rij[title]"; $im = imagecreatefrompng("../pictures/newsbanner.png"); $white = imagecolorallocate($im, 255,255, 255); $black = imagecolorallocate($im, 0, 0, 0); $text_size=15; $x=10; $y=10;
$font = imagepsloadfont($filename);//.pfb imagepstext($im, $string, $font,$text_size,$white, $black,$x,$y); imagepsfreefont($font); imagepng($im); imagedestroy($im);
} ?> |
Fo' Shizzle!!
-SW
--------------------
|
|
|
Track this topic
Receive email notification when a reply has been made to this topic and you are not active on the board.
Subscribe to this forum
Receive email notification when a new topic is posted in this forum and you are not active on the board.
Download / Print this Topic
Download this topic in different formats or view a printer friendly version.
]]
|