Image in image


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.

Any Ideas?

(I am using visual studio 2005 and vb.NET)



Merovingian you
6/21/2006 4:13:23 PM 1803 articles. 0 followers. Follow

3 Replies

Similar Articles

[PageSpeed] 10

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.
7/12/2006 3:16:26 AM

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

Dim logoScaling As String = Request.QueryString("ls")

If logoScaling = "" Then

logoScaling =


End If

Dim logo As Bitmap

Dim background As Image

Dim g1 As Graphics

Dim g2 As Graphics

background = Image.FromFile(Server.MapPath(

"images/catalog/full/" & img))

logo = Image.FromFile(Server.MapPath(

"_resources/uploads/images/" & img2))

'find the logoscaling based on its size in relation to the background image

Dim backgroundHeight As Integer = background.Height

Dim backgroundWidth As Integer = background.Width

Dim logoHeight As Integer = logo.Height * logoScaling

Dim logoWidth As Integer = logo.Width * logoScaling

Dim scaledLogo As New Bitmap(logo, logoWidth, logoHeight)

Dim scaledLogoStream As New MemoryStream()

Using (scaledLogoStream)

scaledLogo.Save(scaledLogoStream, ImageFormat.Png)

End Using

Dim backgroundStream As New MemoryStream()

Using (backgroundStream)

background.Save(backgroundStream, ImageFormat.Png)

End Using

g1 = Graphics.FromImage(background)

g2 = Graphics.FromImage(scaledLogo)

g2.SmoothingMode = SmoothingMode.AntiAlias

g1.DrawImage(scaledLogo, Convert.ToSingle(backgroundWidth - logoWidth), Convert.ToSingle(backgroundHeight - logoHeight))

'g1.SmoothingMode = SmoothingMode.AntiAlias

Dim stmMemory As New MemoryStream()

Using (stmMemory)


Response.ContentType =


background.Save(stmMemory, ImageFormat.Png)



End Using

7/20/2006 8:03:08 PM

Hi Oinkage, I tried it out and it worked out fine.

Cheeres Smile

Merovingian you
7/21/2006 6:25:57 AM

Similar Artilces:

image and image
// create an image object, using the filename we just retrieved System.Drawing.Image image = System.Drawing.Image.FromFile(Server.MapPath(file)); // create the actual thumbnail imageSystem.Drawing.Image thumbnailImage = image.GetThumbnailImage(64, 64, new System.Drawing.Image.GetThumbnailImageAbort(ThumbnailCallback), IntPtr.Zero);   now my question is how to display this image in my image1 control in (version 1.1) the below line of code is not working.  Image1.ImageUrl=thumbnailImage.ToString();Mark As Answer If my reply helped you. Hi, you can save t...

Image on Image
I am trying to display a page that has image of a map on it. The user can then place other images of red thumbtacks on the image at different locations. Then when these thumb tacks are clicked on, they open a folder of pics related to the area. I saw a method in the imageButton class that returns the (x,y) of the location where the user clicked. I thought I could use this information to place another, smaller image button, on that area. My problem is that i can't seem to get the bottom imageButton to be transparent so I can see the smaller one. Am i on the right track with this. Any advi...

Imaging, but not imaging
We multicasted to 43 machines. Updated the image on the master. Multicasted the updated image to 36 machines. (the other 7 wouldn't join the session for some unknown reason). I visually verified that all 36 were imaging. One of the 8 which didn't rename appears to not even have been imaged. The problems with the previous image were still there. It's as though the machine didn't image even though I saw it take part in the session and the temp bar going across the screen. What the heck's going on here? AlaN As a try, what happens if you boot either to PXE ...

display image in a image image button
hi   i have to display an image in image button while uploading mycode Image1.ImageUrl = Upload.PostedFile.FileName; is not working thanks Hi You need to save the PostedFile to the disk on the server and then assign it to ImageUrl. Take a look at the following links for more infoprmation on how to do this. Nassabehwww.professionalcsharp.comDon't forget to click "Mark as Answer" on the post that helped you. That way ... problem: i can not view image data for the rest of my table rows except the image for the first row but i can read all the other non image fields for all rows.
Hi i have a table with the following fields imgdata........image imgtitle.........varchar(max) imgType........varchar(max) imgLength.....bigint i have no problem with uploading the image but viewing the uploaded image(s) in a gridview has caused me great pain. The probelm is i have two pages. page1 grabs the image to display and page2 has a gridview that displays the grabed image. I wanted to have an sql statement like SELECT * FROM mytable WHERE incident_id=someValue. IF i have 5 records in this table and i view page2 ...

Displaying image from database(image datatype) to image control
Hie all...I'm a newbie at I m currently using 2.0.I m having a problem with displaying images on my web form. Have tried looking thru all codes but i can't find a step by step tutorial for doing so. I understand that in 1.1, the detailsview can automatically be linked to the image field and display the image. But this is not possible now. So, i have decided to just display the image in an image control.from my understanding, 1. retrieve image from database and convert it to temporary image file in a file path. 2. use the image control's imageurl to point to the file....

Display image from image
Let me explain more. I have a Gridview, that displays an image.  Then i have a detailsview displaying an image from the selected value in the gridview.  Simple.  When i click on one of the images from the gridview, it displays the correct image in the detailsview.  Basically, i have two images in each row of the table in the database.The only way this works is if i have "autogenerateselectbutton=true" set.  I do not want the select link next to my image.  I want to be able to pick on the image in the GridView, and have it show the correct image in...

How can set an image from SystemDrawing.Image into WebControls.Image?
I want directly to set an image from SqlServer to the webform. Do you know how to do it ? please tell me. In the window form I saw a method to set an image from SqlServer: byte[] imgData=(byte[])dr["PictureFile"] // dr is SqlDataReader when call data from SqlServer MemoryStream ms = new MemoryStream(imgData); PictureBox1.Image = System.Drawing.Image.FromStream(ms); ms.Close(); but I have not yet seen any method set an image from SqlServer to WebForm. Have you seen it please tell me, thanks. ...

how to superimpose image over image
Hi,   Could please you please tell me how to solve this problem,    I have Category and products, after selecting category and products,     I am display product Image and also I am giving aspx file upload control to upload logo and display logo on middle of the product image    User will select image and click on submit button. Then uploaded logo should be in    Middle of the product image    Example (if product image width 200 and height 200) and then uploaded image should be placed center&...

Image in Image Frame
Name: Winbinar Product: Firefox Summary: Image in Image Frame Comments: I usually do surfing in Internet with disabled option "show pictures". But I sometimes want a look to the picture. I do right click on the picture and select "Show Picture". Browser shows only this picture. Why you didn't this possibility as in Internet Explorer? Browser Details: Mozilla/5.0 (Windows; U; Windows NT 5.1; ru; rv:1.9b1) Gecko/2007110904 Firefox/3.0b1 ...

display image in Gridview from sql image in .Net 2005
Hi all, I need to Display the Image directly from SQL Database in the GridView as Thumnails. This i can do in .Net 2003 with Help of ItemDatabound Event and Template Column. But in the .Net 2005 there no ItemDatabound event in GridView. For Example I need to Show it like this:  Help Me ASAP.Tamil See : this helps. Vikram.S, DeveloperDiscountASP.NETInnovative ASP.NET Hosting & SQL Hosting Thanks a lot Sharma. It was very useful.  Tamil...

Save Image Path into Database, Retrieve Image Path by Particular Image ID and Display Image through Gridview
Hi All, Currently, I have a file upload control in my aspx page to allow user to upload images. When the user clicks the SAVE button, the image will be saved in a particular folder named 'PMap' that located within the website. What I am trying to do here is to direct all uploaded images into a common image folder (in this case 'PMap') and then, retrieve the images and displayed it through a Gridview according to its respective image id. I have managed to store all uploaded images into a common image folder, PMap. However, I hope advice can be given on my following pro... image.databind, Image does not show on front end
Hi Guys,its the first time I am working with images so I was confused not to actually see my image altough the URL is correct (if I paste it in seperately in the browser it shows).all I do is: ImageOfAlternative.ImageUrl =  myurl.comImageOfAlternative.DataBind()ImageOfAlternative.Focus()Any ideas?  So when you run your website, it shows the "x" picture?Have you checked the properties of the broken image? See where it's pointing to? Microsoft ASP.NET Enthusiast the http:// was missing!...

Creating Thumbnail Images
Hi all, I have a script that uploads an image and creates a thumbnail for it. Ideally this thumbnail would be a smaller filesize but this is not what is happening. I have just uploaded a few images one of which was 378x521px and 11.3Kb. The thumbnail image created from this was 145x200 and 55.5Kb! Can anyone please tell me what I am doing wrong. I am using the GetThumbnailImage method as such:  System.Drawing.Image myThumbnail = myBitmap.GetThumbnailImage(intThumbWidth, intThumbHeight, myCallBack, IntPtr.Zero);myThumbnail.Save (Server.MapPath(sSavePath + sThumbFile)); Many thank...

Web resources about - Image in image -

Twist Image
At Twist Image, we connect brands to people and people to brands. Let us show you what we mean.

Wikipedia:Manual of Style/Images - Wikipedia, the free encyclopedia
Wikipedia contains millions of illustrative images and other electronic media . This page gives a very brief overview of how images are used ...

Bunbury man in court over child sex abuse images after US Homeland Security tip
A West Australian man who allegedly used his mobile phone to access and send child sexual abuse images is due to appear in court.

Bunbury man in court over child sex abuse images after US Homeland Security tip
A West Australian man who allegedly used his mobile phone to access and send child sexual abuse images is due to appear in court.

Bunbury man in court over child sex abuse images after US Homeland Security tip
A West Australian man who allegedly used his mobile phone to access and send child sexual abuse images is due to appear in court.

Convert your images quickly and easily with PDF Photos
Have you ever wanted an easy way to convert images to a PDF? Maybe you want to include them in a document for work, send them via email at a ...

"Iran humiliated the United States with the capture of our 10 sailors. Horrible pictures & images. We ...
You don't need to have the speaker identified. The style is unmistakable.

These amazing images from the bottom of the sea reveal a mysterious world scientists are just starting ...
... into the deep. But not anymore . The University of Washington, NSF-OOI, and Canadian Scientific Submersible Facility provided these images ...

First Marvel's Jessica Jones Season 2 Teaser Image Released
... have already [...] Following on the heels of their renewal announcement today, Marvel and Netflix have already released the first teaser image ...

Mike Huckabee: Obama More Interested In Protecting The Image Of Islam
... rethink our visa program. The EU is a failure.... We have a president who seems to be more interested in protecting the reputation and image ...

Resources last updated: 1/18/2016 2:28:43 PM