开发者

IHTMLImgElement to byte[]

I am trying to extract image from c# webbrowser control, and return byte array of the same, i have managed to extract image, buy unable to get byte array of the same.

H开发者_StackOverflow中文版ow do i get IHTMLImgElement to byte[], cannot find good examples on google, please any suggestions ?

Thank you.


How about just downloading the original?

string imgSrc = htmlImgElement.src;
WebClient web = new WebClient();
byte[] imageData = web.DownloadData(imgSrc);

You may need to convert src to a fullly qualified URL which you can probably get from the webBrowser.Url (?) property.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜