Jump to content

How to add background


TheSky

Recommended Posts

Hey i got one problem i want add background how i should make it any help will be welcome

 

<?php
//source file
$file = "test.txt";
//images size
$high = "200";
$wide = "400";
//generate image
$data = file($file);
$im = @ imagecreate($wide, $high) or die("Error");
$bc = imagecolorallocate($im, 255, 255, 255);
$tc = imagecolorallocate($im, 0, 0, 0);
$lines = (int) $high / 10;
for ($t = 0; $t < $lines; $t++)
{
    imagestring($im, 3, 4, 4, $data[$t], $tc);
    imagestring($im, 3, 4, 4 + ($t * 10), $data[$t], $tc);
}
//header("Content-type: image/png");
//imagepng($im);
imagepng($im,"pildid/1.png"); 
imagedestroy($im);
?>

Link to comment
https://forums.phpfreaks.com/topic/234165-how-to-add-background/
Share on other sites

For most web purposes, you can usually design the basic background of your image using a normal image editor like Photoshop and only add any additional text or graphical elements that need to be dynamically drawn using PHP. This allows you to speed up your scripts and reduce the resource consumption on your web server. It also lets you create your picture using professional picture designing tools.

 

imagecreatefromgif ( $filename ); // Background is a gif
imagecreatefromjpeg ( $filename ); // Background is a jpg
imagecreatefrompng ( $filename ); // Background is a png

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.