Last post Jan 03, 2008 10:27 AM by CurtWRC
Dec 29, 2007 01:59 AM|maximo3491|LINK
Is there anyway to merge multiple images into one that is then displayed to the client.
I'm new to drawing in asp.net and some sample code would be very helpful, or atleast links to where there are sample codes.
Thanks in advance.
Jan 03, 2008 10:25 AM|CurtWRC|LINK
Heres the method I use for merging two images.
First create a blank bitmap which will become your base (ie canvas)
Dim baseimg As New Bitmap(500, 300)
Then create two more bitmaps importing images from your server:
Dim img1 As New Bitmap(URL HERE)
Dim img2 As New Bitmap(URL HERE)
then create a graphic based on your original bitmap
Dim g As Graphics = Graphics.FromImage(baseimg)
then import the other bitmaps to this graphic specifying where to place them:
g.DrawImage(img1, 0, 0)
g.DrawImage(img2, 100, 0)
then output the bitmap
Dim imgStream As New MemoryStream()
Response.ContentType = "image/png"
then dispose all graphics and bitmaps
Hope this helps!
Jan 03, 2008 10:27 AM|CurtWRC|LINK
Heres another example which may help: