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.
精彩评论