Questa breve guida spiega come catturare uno screenshot completo di una pagina web usando C#. It provides details on how to configure the IDE, a list of programming steps, and sample code to take a screenshot of the entire web page using C#. Otterrai informazioni per creare un output personalizzato secondo le tue esigenze.
Steps to capture a screenshot of the entire web page using C#.
- Set the IDE to use Aspose.HTML for .NET to capture a screenshot of the entire web page.
- Set the license to avoid any product trial limitations.
- Specify the web page to capture a screenshot of.
- Load the source web page into memory.
- Create the ImageSaveOptions object and set the output image type to PNG.
- Set the horizontal and vertical resolution of the resulting image.
- Generate the web page as an image using the ConvertHTML() method.
These steps describe how to take a screenshot of an entire web page using C#. Set the license, specify the web page and load it into memory, and create an ImageSaveOptions object. Finally, set the output image parameters and render the web page as an image.
Code to capture a screenshot of a website using C#.
This code example demonstrates how to apply full-page web screenshot capture using C#. Per catturare l’intera pagina, usa le opzioni di adattamento del layout della pagina per catturare l’intera pagina invece della viewport predefinita. You can also try setting the image background color, setting a custom viewport size, and setting a network timeout to handle delays in loading the web page.
Questo tutorial aiuta a catturare schermate di pagine web. To convert Markdown to an image, refer to the article Convert Markdown to Word in C#.