html to jpg with c#

前端 未结 2 589
灰色年华
灰色年华 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: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);
    

提交回复
热议问题