Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

c# aspx return image

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); 
  } 
}
Comment

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();
Comment

PREVIOUS NEXT
Code Example
Csharp :: asp.net web hooks 
Csharp :: unity custom editor draw line in scene 
Csharp :: vb.net ionic zip examples 
Csharp :: query to linq converter online 
Csharp :: How to solve error in ExecuteNonQuery() in asp.net 
Csharp :: initialization of dictionary in other forms c# 
Csharp :: auto paly a video control in mvc c# 
Csharp :: dotnet core vue in subdirectory 
Csharp :: how to check if every element in array is true c# 
Csharp :: reflection assemblies gettypes 
Csharp :: c# get executing method name 
Csharp :: esaddex34 
Csharp :: how to reset checkbox visual studio c# 
Csharp :: join 2 list rows into one row and add totals fields C# 
Csharp :: create circumference with nettopologysuite 
Csharp :: c# create dll runtime 
Csharp :: html tag inside razor tag 
Csharp :: c# interface implementation 
Csharp :: short in c# 
Csharp :: scale curve revit api 
Csharp :: how to clear stackpanel wpf 
Csharp :: orderby make sunday last day c# 
Csharp :: c# mail retrieve library 
Csharp :: unity gamemanager instance not set to an instance of an object 
Csharp :: commandline to open outlook minimized 
Csharp :: how to make infinite loop in c# 
Csharp :: dotnet core webapp 
Csharp :: c# web scraping get images from specific url 
Csharp :: compile c# file in terminal 
Csharp :: Select records that does not exist in another table in Entity Framework 
ADD CONTENT
Topic
Content
Source link
Name
5+1 =