c# aspx return image
string Path = Server.MapPath(Request.ApplicationPath + "\image.jpg");
Bitmap bmp = CreateThumbnail(Path,Size,Size);
Response.ContentType = "image/jpeg";
bmp.Save(Response.OutputStream,System.Drawing.Imaging.ImageFormat.Jpeg);
bmp.Dispose();public class ImageHandler : IHttpHandler
{
public bool IsReusable { get { return true; } }
public void ProcessRequest(HttpContext ctx)
{
var myImage = GetImageSomeHow();
ctx.Response.ContentType = "image/png";
ctx.Response.OutputStream.Write(myImage);
}
}
Also in C#:
- visual studio clear text script
- c# how to run external program
- c# get the last item in a list
- modal dismiss
- increase variable C#
- loops in coding
- c# loop datatable rows
- whats a string
- c# how to exit program
- dont destroy on load unity
- c# join array
- unity3d quaternion add 90 degrees
- c# display float with 2 decimal places
- c# null conditional operator if statement
- c# windows forms draw pixel
- matplotlib measure the width of text
- wpf c# select folder path
- how to use K2 games Games parallax background
- what data type should be for contact number in asp.net
- parse strings into words C#
- c# write to console
- insert variables into string c#
- c# odd even median
- C# datareadeer return null