PHP School Assignment? Project Due Tomorrow? Chat LIVE With A Programming Expert!

Welcome to Dream.In.Code
Become a PHP Expert!

Join 307,165 PHP Programmers for FREE! Get instant access to thousands of PHP experts, tutorials, code snippets, and more! There are 1,545 people online right now. Registration is fast and FREE... Join Now!




place one image over another image at required co-ordinates of another

 

place one image over another image at required co-ordinates of another

pallavi312@rediff.com

17 Aug, 2009 - 12:00 AM
Post #1

New D.I.C Head
*

Joined: 9 Apr, 2009
Posts: 6

Hello,

My Question is i have co-ordinartes (x,y). i want one image to be placed over another image at given co-ordinates positon as given above.
Please send me reply earlier......


User is offlineProfile CardPM
+Quote Post


Wimpy

RE: Place One Image Over Another Image At Required Co-ordinates Of Another

17 Aug, 2009 - 12:54 AM
Post #2

I feel happy... *singing*
Group Icon

Joined: 2 May, 2009
Posts: 958



Thanked: 132 times
Dream Kudos: 75
My Contributions
hmm, this could acutally be more of a html or css issue than a PHP problem unless you try to do it using GD Library. If you show your code someone would perhaps be able to help you! We won't do your homework for you! Show some good effort of trying to solve the problem yourself and post again! smile.gif

QUOTE(pallavi312@rediff.com @ 17 Aug, 2009 - 10:00 AM) *

Hello,

My Question is i have co-ordinartes (x,y). i want one image to be placed over another image at given co-ordinates positon as given above.
Please send me reply earlier......


User is offlineProfile CardPM
+Quote Post

pallavi312@rediff.com

RE: Place One Image Over Another Image At Required Co-ordinates Of Another

17 Aug, 2009 - 01:59 AM
Post #3

New D.I.C Head
*

Joined: 9 Apr, 2009
Posts: 6

QUOTE(Wimpy @ 17 Aug, 2009 - 12:54 AM) *

hmm, this could acutally be more of a html or css issue than a PHP problem unless you try to do it using GD Library. If you show your code someone would perhaps be able to help you! We won't do your homework for you! Show some good effort of trying to solve the problem yourself and post again! smile.gif

QUOTE(pallavi312@rediff.com @ 17 Aug, 2009 - 10:00 AM) *

Hello,

My Question is i have co-ordinartes (x,y). i want one image to be placed over another image at given co-ordinates positon as given above.
Please send me reply earlier......





hello,
my code is like that i m trying placing text over the image but it gives me error like this
"Warning: imagepsloadfont() [function.imagepsloadfont]: T1Lib Error: Premature End of Font File Encountered in C:\Program Files\Apache Group\Apache2\htdocs\test\text.php on line 9

Warning: imagepsloadfont() [function.imagepsloadfont]: Couldn't load the font in C:\Program Files\Apache Group\Apache2\htdocs\test\text.php on line 9

my code is below:

$im = imagecreatetruecolor(200, 200);

// Allocate colors
$black = imagecolorallocate($im, 0, 0, 0);
$white = imagecolorallocate($im, 255, 255, 255);

// Load the PostScript Font
echo "<br>forntL:".$font = imagepsloadfont('Fonts/Tahoma.ttf');

// Write the font to the image
imagepstext($im, 'Sample text is simple', $font, 12, $black, $white, 50, 50);

// Output and free memory
//header('Content-type: image/png');

imagepng($im);
imagedestroy($im);
User is offlineProfile CardPM
+Quote Post

RudiVisser

RE: Place One Image Over Another Image At Required Co-ordinates Of Another

17 Aug, 2009 - 02:05 AM
Post #4

.. does not guess solutions
Group Icon

Joined: 5 Jun, 2009
Posts: 1,891



Thanked: 139 times
Dream Kudos: 125
Expert In: PHP, MySQL, HTML, CSS, C#

My Contributions
Well, Tahoma.TTF is a TrueType font (clue's in the name), so you use imagettftext, not imagepstext..

But I think more importantly, that code does absolutely nothing to acheive your purpose (2 images).

Also, that text won't be placed over any image because you're not loading any image in the background... Please can you tell us exactly what you want to acheive??
User is offlineProfile CardPM
+Quote Post

pallavi312@rediff.com

RE: Place One Image Over Another Image At Required Co-ordinates Of Another

17 Aug, 2009 - 02:32 AM
Post #5

New D.I.C Head
*

Joined: 9 Apr, 2009
Posts: 6

QUOTE(MageUK @ 17 Aug, 2009 - 02:05 AM) *

Well, Tahoma.TTF is a TrueType font (clue's in the name), so you use imagettftext, not imagepstext..

But I think more importantly, that code does absolutely nothing to acheive your purpose (2 images).

Also, that text won't be placed over any image because you're not loading any image in the background... Please can you tell us exactly what you want to acheive??


Hello,
i want both functionality placing text over an image also placing one image over theother at required position...

User is offlineProfile CardPM
+Quote Post

RudiVisser

RE: Place One Image Over Another Image At Required Co-ordinates Of Another

17 Aug, 2009 - 02:54 AM
Post #6

.. does not guess solutions
Group Icon

Joined: 5 Jun, 2009
Posts: 1,891



Thanked: 139 times
Dream Kudos: 125
Expert In: PHP, MySQL, HTML, CSS, C#

My Contributions
Well to do this, you need to use imagecreatefrompng (or imagecreatefrom(gif/jpeg), whichever is relevant)... You can then copy the images over each other at different points, and draw text on them using imagettftext.

Have a go and show us what you come up with, if you get stuck we can provide more help easily smile.gif
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic

Time is now: 11/21/09 06:09PM

Live PHP Help!

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter Fan Us On Facebook

PHP Tutorials

Reference Sheets

PHP Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month