首页

根据URL网址把网页截成图片(网页预览图)

c#

2020-9-5

using System;
using System.Collections.Generic;
using System.Text;
using System.Diagnostics;
using System.Windows.Forms;

namespace 排队取号软件
{
    class HtmlToImage
    {
        /// <summary>
        /// HTML页面转image
        /// </summary>
        /// <param name="HtmlUrl">Url</param>
        /// <param name="imageWidth">图片宽度580</param>
        public static void Go(String HtmlUrl, int imageWidth)
        {
            Process processInstance = new Process();
            ProcessStartInfo startInfo = new ProcessStartInfo();
            startInfo.UseShellExecute = true;
            startInfo.CreateNoWindow = true;
            startInfo.WindowStyle = ProcessWindowStyle.Hidden;
            startInfo.Arguments = @" --quality 100 --width "   imageWidth   " --disable-smart-width "   HtmlUrl  
                                  " page.jpg";
            startInfo.FileName = Application.StartupPath  "\\HtmlToImg\\wkhtmltoimage.exe";
            processInstance.StartInfo = startInfo;
            processInstance.Start();
            processInstance.WaitForExit();
        }

    }
}
资源下载此资源下载价格为3D币(VIP免费),请先
资源文件列表
HtmlToImage.cs , 1146
HtmlToImg/libgcc_s_sjlj-1.dll , 489773
HtmlToImg/libstdc++-6.dll , 6762827
HtmlToImg/libwinpthread-1.dll , 243109
HtmlToImg/vcredist_x64.exe , 7195312
HtmlToImg/vcredist_x86.exe , 6505008
HtmlToImg/wkhtmltoimage.exe , 37714432
╦╡├≈.txt , 32
没有账号? 忘记密码?

社交账号快速登录