html to jpg with c#

前端 未结 2 591
灰色年华
灰色年华 2021-02-05 19:51

I did some searching to try and generate jpg files from an html page and found one solution called IECapt or something similar that requires IE on the server to work...not what

相关标签:
2条回答
  • 2021-02-05 20:29

    You can use this HtmlRenderer class.

    0 讨论(0)
  • 2021-02-05 20:37

    I haven't tried this, but you can try using Control.DrawToBitmap(). To draw the watermark you can go like this:

    Image img; //the html image.
    Image watermark; //the watermark image.
    Point location; //where to draw the watermark on the html image.
    
    Graphics g = Graphics.FromImage(img);
    g.DrawImage(watermark, location);
    
    0 讨论(0)
提交回复
热议问题