Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Old 02-22-2008, 04:11 AM 1 image over another
Sharon_leic's Avatar
Super Talker

Posts: 115
Name: Sharon
Location: Leicester, uk
Trades: 0
Hiya

how would i mae 1 image go over the top of another in php.. i need a little affect where 1 is 1/2 way over another.
I know you can do it with css but i have never touched that before and only need this in 1 place ... so is there a simple solution?

thanks

Shaz x
__________________
mysql_connect("localhost", "brain", "sharon") or die(mysql_error());
mysql error: brain doesn't exist!
Sharon_leic is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 02-22-2008, 04:44 AM Re: 1 image over another
mtishetsky's Avatar
King Spam Talker

Posts: 1,226
Name: Mike
Location: Mataro, Spain
Trades: 0
You may overlay two images physically with some image editor, if I understand you right.
__________________

Please login or register to view this content. Registration is FREE
-
Please login or register to view this content. Registration is FREE
-
Please login or register to view this content. Registration is FREE

And don't forget to give me talkupation!
mtishetsky is offline
Reply With Quote
View Public Profile Visit mtishetsky's homepage!
 
Old 02-22-2008, 07:06 AM Re: 1 image over another
Sharon_leic's Avatar
Super Talker

Posts: 115
Name: Sharon
Location: Leicester, uk
Trades: 0
Yeah i know i could do it that way but this wont be fixed
__________________
mysql_connect("localhost", "brain", "sharon") or die(mysql_error());
mysql error: brain doesn't exist!
Sharon_leic is offline
Reply With Quote
View Public Profile
 
Old 02-22-2008, 07:19 AM Re: 1 image over another
Super Moderator

Posts: 1,584
Location: Kokkola, Finland
Trades: 1
can you give an example of what you mean?
davemies is offline
Reply With Quote
View Public Profile Visit davemies's homepage!
 
Old 02-22-2008, 08:22 AM Re: 1 image over another
Ultra Talker

Posts: 310
Trades: 0
You'd have to do it using CSS, can't be done using PHP. PHP can't affect the layout of elements on a webpage directly, you'd have to use XHTML and CSS.
dman_2007 is offline
Reply With Quote
View Public Profile
 
Old 02-22-2008, 01:52 PM Re: 1 image over another
Junior Talker

Posts: 4
Name: John
Trades: 0
You can always modify this watermark code:

Code:
<?php
function imagelogo (&$dst_image, $src_image, $dst_w, $dst_h, $src_w, $src_h, $position='bottom-left') {
    imagealphablending($dst_image,true);
    imagealphablending($src_image,true);
    if ($position == 'random') {
        $position = rand(1,8);
    }
    switch ($position) {
        case 'top-right':
        case 'right-top':
        case 1:
            imagecopy($dst_image, $src_image, ($dst_w-$src_w), 0, 0, 0, $src_w, $src_h);
        break;
        case 'top-left':
        case 'left-top':
        case 2:
            imagecopy($dst_image, $src_image, 0, 0, 0, 0, $src_w, $src_h);
        break;
        case 'bottom-right':
        case 'right-bottom':
        case 3:
            imagecopy($dst_image, $src_image, ($dst_w-$src_w), ($dst_h-$src_h), 0, 0, $src_w, $src_h);
        break;
        case 'bottom-left':
        case 'left-bottom':
        case 4:
            imagecopy($dst_image, $src_image, 0 , ($dst_h-$src_h), 0, 0, $src_w, $src_h);
        break;
        case 'center':
        case 5:
            imagecopy($dst_image, $src_image, (($dst_w/2)-($src_w/2)), (($dst_h/2)-($src_h/2)), 0, 0, $src_w, $src_h);
        break;
        case 'top':
        case 5:
            imagecopy($dst_image, $src_image, (($dst_w/2)-($src_w/2)), 0, 0, 0, $src_w, $src_h);
        break;
        case 'bottom':
        case 6:
            imagecopy($dst_image, $src_image, (($dst_w/2)-($src_w/2)), ($dst_h-$src_h), 0, 0, $src_w, $src_h);
        break;
        case 'left':
        case 7:
            imagecopy($dst_image, $src_image, 0, (($dst_h/2)-($src_h/2)), 0, 0, $src_w, $src_h);
        break;
        case 'right':
        case 8:
            imagecopy($dst_image, $src_image, ($dst_w-$src_w), (($dst_h/2)-($src_h/2)), 0, 0, $src_w, $src_h);
        break;
    }
}

// example:

imagelogo($image, $watermark, imagesx($image), imagesy($image), imagesx($watermark), imagesy($watermark), 'random');
?>
__________________

Please login or register to view this content. Registration is FREE
Zhay is offline
Reply With Quote
View Public Profile
 
Old 02-22-2008, 08:11 PM Re: 1 image over another
Sharon_leic's Avatar
Super Talker

Posts: 115
Name: Sharon
Location: Leicester, uk
Trades: 0
I got it now thanks, i just did what mtishetsky suggested then when i wanted the normal image again i used a bit of javascript to change it

thanks

shaz x
__________________
mysql_connect("localhost", "brain", "sharon") or die(mysql_error());
mysql error: brain doesn't exist!
Sharon_leic is offline
Reply With Quote
View Public Profile
 
Old 02-26-2008, 07:46 AM Re: 1 image over another
mtishetsky's Avatar
King Spam Talker

Posts: 1,226
Name: Mike
Location: Mataro, Spain
Trades: 0
Quote:
Originally Posted by Zhay View Post
You can always modify this watermark code:

Code:
<?php
// code skipped
?>
It is not recommended to resize images with php. Some specially educated guys wrote and continue supporting a wondeful thing called ImageMagick.
__________________

Please login or register to view this content. Registration is FREE
-
Please login or register to view this content. Registration is FREE
-
Please login or register to view this content. Registration is FREE

And don't forget to give me talkupation!
mtishetsky is offline
Reply With Quote
View Public Profile Visit mtishetsky's homepage!
 
Reply     « Reply to 1 image over another
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.46665 seconds with 12 queries