Last post Jul 21, 2006 02:25 AM by Merovingian
Jun 21, 2006 12:13 PM|Merovingian|LINK
I have a project where clients viewing my website can buy t-shirts. They can choose from a number of t-shirt colors and shapes which are their plain colour.
They can also choose a number of prints to be placed on the t-shirt. These will be graphics stored in a database. My problem is on how I can displaty the t-shirt with the graphics or logo they chose on te t-shirt.
It would be something like drawing text on an image but instead drawing an existing image on the base image.
(I am using visual studio 2005 and vb.NET)
Jul 11, 2006 11:16 PM|jeepzj|LINK
1. You can create a blank image with the same size of the orginal image, such as T-shirt image.
2. Draw the t-shirt image on the new image from step 1.
3. Draw your favourite graphics or logo on the image from step 2.
Jul 20, 2006 04:03 PM|Oinkage|LINK
This is just a snippet of code for what I think you are attempting to do. You will need to modify it to get it to work for you. Hope it helps.
'show img2 interposed on the primary img
background = Image.FromFile(Server.MapPath(
logo = Image.FromFile(Server.MapPath(
g1 = Graphics.FromImage(background)
g2 = Graphics.FromImage(scaledLogo)
g2.SmoothingMode = SmoothingMode.AntiAlias
g1.DrawImage(scaledLogo, Convert.ToSingle(backgroundWidth - logoWidth), Convert.ToSingle(backgroundHeight - logoHeight))
Jul 21, 2006 02:25 AM|Merovingian|LINK
Hi Oinkage, I tried it out and it worked out fine.