c# web api return image file
[HttpGet]
public IActionResult Get()
{
Byte[] b = System.IO.File.ReadAllBytes(@"E:\Test.jpg"); // You can use your own method over here.
return File(b, "image/jpeg");
}
c# web api return image file
[HttpGet]
public IActionResult Get()
{
Byte[] b = System.IO.File.ReadAllBytes(@"E:\Test.jpg"); // You can use your own method over here.
return File(b, "image/jpeg");
}
get image information using c#
Image img = Image.FromFile(fileName);
ImageFormat format = img.RawFormat;
Console.WriteLine("Image Type : "+format.ToString());
Console.WriteLine("Image width : "+img.Width);
Console.WriteLine("Image height : "+img.Height);
Console.WriteLine("Image resolution : "+(img.VerticalResolution*img.HorizontalResolution));
Console.WriteLine("Image Pixel depth : "+Image.GetPixelFormatSize(img.PixelFormat));
Console.WriteLine("Image Creation Date : "+creation.ToString("yyyy-MM-dd"));
Console.WriteLine("Image Creation Time : "+creation.ToString("hh:mm:ss"));
Console.WriteLine("Image Modification Date : "+modify.ToString("yyyy-MM-dd"));
Console.WriteLine("Image Modification Time : "+modify.ToString("hh:mm:ss"));
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us