Quote: namespace WindowsFormsApplication3 { public partial class Form1 : Form { public WebBrowser wb = new WebBrowser(); public Form1() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { this.openFileDialog1.ShowDialog(); string[] files = openFileDialog1.FileNames; foreach (string nam in files) { try { string url = @"file:///" + nam; wb.Navigate(url); Bitmap b = new Bitmap(wb.Width, wb.Height); wb.DrawToBitmap(b, new Rectangle(0, 0, wb.Width, wb.Height)); b.Save(@"D:\copy\" + Path.GetFileNameWithoutExtension(nam) + ".png", System.Drawing.Imaging.ImageFormat.Png); wb.Dispose(); } catch { } } } } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)