title: How to programmatically get the rendered dimensions of an image in a web page?
body: <p>I have a need to interrogate every img tag in a webpage and find its height and width in its rendered form. Not the actual physical image dimensions. I need to do this in C# in a WinForm app.</p>
  
  <p>Example: 
  <a href="http://motherboard.vice.com/read/i-built-a-botnet-that-could-destroy-spotify-with-fake-listens" rel="nofollow">http://motherboard.vice.com/read/i-built-a-botnet-that-could-destroy-spotify-with-fake-listens</a></p>
  
  <p>The main image's physical dimension is 3648x2736. The rendered image is 1000x750 when my browser is maximized. I am aware of the media queries and the image resizing due to them. This img tag doesn't have a width and height attributes.
  How do I get my app to get the 1000x750 size using C# and assuming largest media query size and a resolution of at least 1400 width.</p>
  
  <p>I am assuming I will need a browser control like <a href="https://awesomium.codeplex.com/" rel="nofollow">Awesomium</a>, <a href="https://github.com/cefsharp/CefSharp" rel="nofollow">CefSharp</a>, <a href="http://essentialobjects.com/Products/WebBrowser/Default.aspx" rel="nofollow">EO.Browser</a> or IE Web Browser Control? Not sure which one can do this. I would like to iterate through the img tags and get the dimensions of each rendered one as if I opened a browser and used dev tools to get the computed dimensions of each image. I prefer to do this processing in C# than Javascript.</p>