Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Response.ContentType = "image/png";
- Response.Clear();
- using (Bitmap bmp = new Bitmap(tifFilepath))
- bmp.Save(Response.OutputStream, ImageFormat.Png);
- Response.End();
- protected void Page_Load(object sender, EventArgs e)
- {
- Response.ContentType = "image/jpeg";
- Response.Clear();
- Bitmap bmp = new Bitmap(tifFileLocation);
- bmp.Save(Response.OutputStream, ImageFormat.Jpeg);
- Response.End();
- }
- Public Shared Function ToImage(ByVal imageBytes As Byte()) As Byte()
- Dim ms As System.IO.MemoryStream = New System.IO.MemoryStream(imageBytes)
- Dim os As System.IO.MemoryStream = New System.IO.MemoryStream()
- Dim img As System.Drawing.Image = System.Drawing.Image.FromStream(ms)
- img.Save(os, System.Drawing.Imaging.ImageFormat.Jpeg)
- Return os.ToArray()
- End Function
Add Comment
Please, Sign In to add comment