Click here to Skip to main content
15,922,650 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i am developing a website. and wants to place image over an image.
can anybody have any idea how to do it...
i am using visual studio 2010.
Posted

On server side, you can prepare a composite image on the fly using System.Drawing.Bitmap. Create a new bitmap of appropriate size. Then you need to obtain an instance of System.Drawing.Graphics which you can use to draw on a bitmap. Here is how:
http://msdn.microsoft.com/en-us/library/system.drawing.graphics.fromimage.aspx[^].

See also:
http://msdn.microsoft.com/en-us/library/system.drawing.bitmap.aspx[^],
http://msdn.microsoft.com/en-us/library/system.drawing.graphics.aspx[^].

Using this instance, draw one bitmap and another bitmap on top of it, in required position. You can read those two bitmaps from files you can store on the server side. Those two bitmaps will be drawn on a resulting bitmap. Then you can either save resulting bitmap in a file and show it by its URI, or draw the bitmap on the fly, using the class System.Web.HttpResponse:
http://msdn.microsoft.com/en-us/library/system.web.httpresponse.aspx[^].

You will find rudimentary code sample on the MSDN page referenced above.

—SA
 
Share this answer
 
You can use html <div> tag and css style for this.

Image1.jpg = background image
Image2.jpg = to be placed on Image1

HTML
<div style="width: 400px; height: 80px; background-image: removed(Images/LMTG-LOGO.gif); background-repeat: no-repeat; background-removed: center; text-align: center;">
        <img src="Images/ltmhilogo.bmp" alt="Image1" />
    </div>


You can adjust location of your Image2 by applying "style" property and "margin" attribute. Adjust height and width of the <div> tag based on the size of your image.


Hope this will help you.
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900