Skip to content

Instantly share code, notes, and snippets.

Last active Aug 29, 2015
What would you like to do?
Function Image() As ActionResult
Dim path = Server.MapPath("~/App_Data/images/")
Dim bmp = New Bitmap(IO.Path.Combine(path, "sample.png"))
Dim ms = New MemoryStream()
bmp.Save(ms, Imaging.ImageFormat.Png)
ms.Position = 0
Return New FileStreamResult(ms, "image/png")
End Function
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment