online tshirt design

GD and GD2 are useful libraries for creating graphics on-the-fly. Discuss your PHP GD and GD2 scripts here.

Moderators: onion2k, General Moderators

Post Reply
lanny
Forum Newbie
Posts: 24
Joined: Thu Apr 06, 2006 10:09 am

online tshirt design

Post by lanny »

i currently doing a online tshirt design website where user customise their own shirt by adding text on the shirt.
So, how the text will be placed on top of shirt when user input their text?
i'hv told that to use php generated image to make a text image.....but after generated the text image..it cant placed on top of the shirt..anyone solutions for dat?

thanks in advance
timvw
DevNet Master
Posts: 4897
Joined: Mon Jan 19, 2004 11:11 pm
Location: Leuven, Belgium

Post by timvw »

Allow them so choose the postion on the t-shirt? Simply X-Y input boxes should be sufficient.

Perhaps this can be made more user-friendly with the addition of javascript/flash that displays a movable x/y axis over the tshirt to choose that position...
lanny
Forum Newbie
Posts: 24
Joined: Thu Apr 06, 2006 10:09 am

Post by lanny »

it is actually just place the text at the center of the shirt....but the php generated image cant display over the shirt,,how/
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Here's an idea: using a div, two <img> tags, and some CSS you could MacGyver their image underneath a partially transparent overlay of the t-shirt acting as a mask. Their image can then be moved around, resized all from the comfort of their browser using Javascript. No server interaction necessary until a submission is made. They wouldn't even have to upload the image until that submission if you did it a certain way.
lanny
Forum Newbie
Posts: 24
Joined: Thu Apr 06, 2006 10:09 am

Post by lanny »

i dont really understand, can u please explain more?....hmm..can i create a php generated image on the shirt?
derchris
Forum Commoner
Posts: 44
Joined: Sat Jun 10, 2006 6:14 pm

Post by derchris »

Merge the Text and the T-Shirt Image.
That should be pretty easy with GD and some line code.
User avatar
wtf
Forum Contributor
Posts: 331
Joined: Thu Nov 03, 2005 5:27 pm

Post by wtf »

Flash will be the easiest and most efficient solution for this.
User avatar
bokehman
Forum Regular
Posts: 509
Joined: Wed May 11, 2005 2:33 am
Location: Alicante (Spain)

Post by bokehman »

feyd wrote:They wouldn't even have to upload the image until that submission.
Unless I am missing something (probably!) the sandbox doesn't allow that behaviour in Firefox and Netscape. It does seem to work in Internet Explorer though as discovered in the following test.

Code: Select all

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">

<html lang="en">
<head>

<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
     
<script type="text/javascript">
function load_image(input)
{
	tee_shirt_img = document.getElementById('tee_shirt_img')
	tee_shirt_img.src = 'file:///' + input.value
	tee_shirt_img.style.display = ''
}
</script>

<title></title>

</head>

<body>

<form action="" enctype="multipart/form-data" method="post">
<p><input type="file" name="file" onchange="load_image(this)"></p>
<p><img id="tee_shirt_img" style="display:none"></p>
</form>

</body>

</html>
Post Reply