Answers for "display image with uri c#"

C#
0

c# how to get src from html img

string str = "<div> <img src="https://i.testimg.com/images/g/test/s-l400.jpg" style="width: 100%;"> <div>Test</div> </div>";

// Get the index of where the value of src starts.
int start = str.IndexOf("<img src="") + 10;

// Get the substring that starts at start, and goes up to first ".
string src = str.Substring(start, str.IndexOf(""", start) - start);
Posted by: Guest on December-05-2020
-1

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"));
Posted by: Guest on July-31-2020

C# Answers by Framework

Browse Popular Code Answers by Language