locked
How to show image after imposing text? RRS feed

  • Question

  • User-932187715 posted
    Hi Friends, I want to assign the image to the image control after imposing text on the image. I don't want to store it to the database(or server). To where I have to save the image and also how to assign that image to the image Control. Sub imposeTitle() Dim letterBrush As SolidBrush = New SolidBrush(Color.FromArgb(50, 255, 255, 255)) Dim shadowBrush As SolidBrush = New SolidBrush(Color.FromArgb(50, 0, 0, 0)) Dim fontTitle As Font = New Font("tahoma", 20, FontStyle.Bold) 'Filename = Request.QueryString("filename") Filename = "limg/laminate-flooring/alloc/alloc-138713.jpg" Filename = Server.MapPath(Filename) ImgFormat = ImageFormat.Jpeg : Response.ContentType = "image/jpeg" ' Default=jpeg ' Img = System.Drawing.Image.FromFile(Filename) Width = Img.Width Height = Img.Height baseMap = New Bitmap(Width, Height) Dim myGraphic As Graphics = Graphics.FromImage(baseMap) With myGraphic .DrawImage(Img, 0, 0, Width, Height) .SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.AntiAlias .DrawString("InternetFloors.COM", fontTitle, shadowBrush, 5, 60) .DrawString("InternetFloors.COM", fontTitle, letterBrush, 7, 62) End With baseMap.Save(Response.OutputStream, ImageFormat.Jpeg) // To where I have to save (as I don't want to save to database)? Image1.ImageUrl = baseMap //My error is here.. baseMap.Dispose() Img = Nothing End Sub Thankyou. Regards.
    Monday, January 10, 2005 4:39 PM

All replies