cefsharp截图
方法如下 Bitmap myImage = new Bitmap(panel1.Width,panel1.Height); Graphics gp1 = Graphics.FromHwnd(panel1.Handle); panel1.DrawToBitmap(myImage,panel1.ClientRectangle); myImage.Save( “C:\\ 11.bmp”); 后来到网上搜到了,另外一个方法,还是对容器面板,测试,居然可以截图了!!方法如下 图形g1 = panel1.CreateGraphics(); Image myImage = new Bitmap(this.panel1.Width,this.panel1.Height,g1); 图形g2 = Graphics.FromImage(myImage); IntPtr dc1 = g1.GetHdc(); IntPtr dc2 = g2.GetHdc(); BitBlt(dc2,0,0,this.panel1.Width,this.panel1.Height,dc1,0,0,1336376); g1.ReleaseHdc(DC1); g2.ReleaseHdc(DC2); myImage.Save( “C:\\ 11.bmp”); pictureBox1.Image = myImage;