Import images to a new image ?

12-08-07, 07:40 PM
|
|
Wannabe Coder
|
|
Join Date: Jan 2006
Posts: 111
Thanks: 2
Thanked 0 Times in 0 Posts
|
|
|
Import images to a new image ?
I'm having many images and I want to use PHP to import them to a new created image with positions and dimensions. Is it possible to do so ? Thanks. 
|

12-09-07, 06:40 PM
|
|
Coding Addict
|
|
Join Date: Dec 2006
Posts: 278
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Go here: http://us2.php.net/gd
And then you can lookup many tutorials on these calls that will help you do what you are trying to do.
__________________
"Things are difficult only while you don't understand them."
|

12-09-07, 11:06 PM
|
 |
Newbie Coder
|
|
Join Date: Dec 2007
Location: chennai
Posts: 30
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
PHP Code:
<?
$im = ImageCreate(175,125);
$white = ImageColorAllocate($im,255,255,255);
$black = ImageColorAllocate($im,0,0,0);
ImageString($im,1,10,20,"ABCdef",$black);
ImageString($im,2,10,35,"ABCdef",$black);
ImageString($im,3,10,53,"ABCdef",$black);
ImageString($im,4,10,70,"ABCdef",$black);
ImageString($im,5,10,90,"ABCdef",$black);
ImageStringUp($im,5,150,118,"Vertical Text",$black);
Header('Content-Type: image/png');
ImagePNG($im);
?>
This is an example image problem...just see it ..
__________________
Last edited by mab; 12-09-07 at 11:25 PM.
Reason: Post code in code tags please.
|

12-09-07, 11:20 PM
|
|
Wannabe Coder
|
|
Join Date: Jan 2006
Posts: 111
Thanks: 2
Thanked 0 Times in 0 Posts
|
|
PHP Code:
<?
header("Content-type: image/jpeg");
$im = @imagecreatefromjpeg("test.jpg");
$im1 = @imagecreatefromjpeg("test1.jpg");
if (!$im)
$im = imagecreatetruecolor(150, 30);
$bgc = imagecolorallocate($im, 255, 255, 255);
$tc = imagecolorallocate($im, 0, 0, 0);
imagefilledrectangle($im, 0, 0, 150, 30, $bgc);
imagestring($im, 1, 5, 5, "Error loading $imgname", $tc);
}
imagejpeg($im);
imagedestroy($im);
?>
I have the two "test.jpg" and "test1.jpg" and I want to show both of them in one new image. Can you tell me how to do please ? 
|

12-12-07, 06:35 AM
|
|
Wannabe Coder
|
|
Join Date: Jan 2006
Posts: 111
Thanks: 2
Thanked 0 Times in 0 Posts
|
|
|
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
|
|
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|