I am hoping someone here can help me with this issue. I need to take a 100X100 image and frame it in a larger image that is 124X119. The larger image needs to be on top of the smaller one with the smaller one being centered inside the larger image. I am basically taking a 100X100 thumbnail and creating a larger image out of it in which the original thumbnail is inside a frame. Any help at all would be greatly appreciated. By the way. I am running this website on a 64 bit Windows server. Thanks.
You could do this fairly easily with ASP.NET. Below is some code: Imports System.Drawing Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load Dim bmp As New Bitmap(Server.MapPath("img1.jpg")) Dim bmp2 As New Bitmap(Server.MapPath("img2.jpg")) Dim g As Graphics g = Graphics.FromImage(bmp2) g.DrawImage(bmp, CInt((bmp2.Width - bmp.Width) / 2), CInt((bmp2.Height - bmp.Height) / 2)) Response.ContentType = "image/jpeg" bmp2.Save(Response.OutputStream, Imaging.ImageFormat.Jpeg) bmp.Dispose() bmp2.Dispose() g.Dispose() Response.End() End Sub Code (markup): The above code will center img1.jpg in img2.jpg. img2.jpg must be larger than img1.jpg
Here is the image resizing code I use. I don't know about making the image larger though, you will loose quality no matter what you do. You can modify it to simplify, but using this you just input
camjohnson95 and deltron - Thank you very much for the code samples. I appreciate it very much. My entire web application is in classic ASP. Do you know if I can integrate a .net page into my asp site?