Add Text to Any Image from ASP.Net aand Show in Browser

  • Import NameSpaces

    Imports System.Drawing
    Imports System.Drawing.Drawing2D

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

    Dim bmp As New Bitmap(Server.MapPath("Koala.jpg"))
    Dim g As Graphics = Graphics.FromImage(bmp)
      g.SmoothingMode = SmoothingMode.AntiAlias

    g.DrawString("My Name is Khan", New Font("verdana", 12), SystemBrushes.WindowText, 50, 50)
    Response.ContentType = "image/jpeg"

    bmp.Save(Response.OutputStream, bmp.RawFormat)
    End Sub

    for further details and related topics

Howdy, Stranger!

It looks like you're new here. If you want to get involved, or you want to Ask a new Question, Please Login or Create a new Account by Clicking below

Login with Facebook

Popular Posts of the Week