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
imgelement with, e.g., asrcattribute - 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
srcof an image just do something likewhere
documentis the document (IHtmlDocument) instance and#my-awesome-img-elementis the ID of the image element. You can pick any CSS selector as you like.Hope that helps!