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
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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.