Last active
August 29, 2015 14:16
-
-
Save jz5/6854282a2a6a1ba476d3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | |
bmp.Dispose() | |
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