I need to create a stream image from IHtmlImageElement
.
In HtmlUnit
, I'm using this:
HtmlImage image;
ImageReader reader = image.getImageReader();
So, how could I make this in AngleSharp
?
I need to create a stream image from IHtmlImageElement
.
In HtmlUnit
, I'm using this:
HtmlImage image;
ImageReader reader = image.getImageReader();
So, how could I make this in AngleSharp
?
AngleSharp has only the knowledge that there is something like an
img
element with, e.g., asrc
attribute - it does not have the image stream (out of the box).Getting an image stream can also be done fully independent of AngleSharp (see https://github.com/AngleSharp/AngleSharp/blob/master/doc/Questions.md#how-to-download-a-picture for details).
Now if you want to get the
src
of an image just do something likewhere
document
is the document (IHtmlDocument
) instance and#my-awesome-img-element
is the ID of the image element. You can pick any CSS selector as you like.Hope that helps!