Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Here: <a href="http://pietschsoft.com/post/2008/07/C-Generate-WebPage-Thumbmail-Screenshot-Image.aspx" rel="nofollow">http://pietschsoft.com/post/2008/07/C-Generate-WebPage-Thumbmail-Screenshot-Image.aspx</a></p> <p>Is an example of how to use the WebBrowser.DrawToBitmap method.</p> <p>After you've generated your bitmap, you can compress it using any encoding you want.<br> This is an example from MSDN for how to compress to PNG (lossless and small):<br> <a href="http://msdn.microsoft.com/en-us/library/aa970062.aspx" rel="nofollow">How to: Encode and Decode a PNG Image</a></p> <p>Good luck :)</p> <p><strong>EDIT:</strong><br> In order to get the byte array, you might want to use a memory stream as output stream.</p> <p>Here's a working example of how something like that would work:</p> <pre><code>public static void Main(string[] args) { byte[] test = new byte[] { 2, 5, 6, 1, 9 }; MemoryStream ms = new MemoryStream(); ms.Write(test, 0, 5); byte[] image = new byte[ms.Length]; Buffer.BlockCopy(ms.GetBuffer(), 0, image, 0, (int)ms.Length); for (int i = 0; i &lt; ms.Length; i++) Console.WriteLine(image[i]); Console.ReadKey(); } </code></pre> <p>And here's an example of how it'd work in your case:</p> <pre><code>public static void Main(string[] args) { MemoryStream ms = new MemoryStream(); // You have a PNGBitmapEncoder, and you call this: encoder.Save(ms); byte[] image = new byte[ms.Length]; Buffer.BlockCopy(ms.GetBuffer(), 0, image, 0, (int)ms.Length); for (int i = 0; i &lt; ms.Length; i++) Console.WriteLine(image[i]); Console.ReadKey(); } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload