D
dawn
Hi,
With the code I use to capture part of a form, an error shows up : External
GDI+ error
the code is the following
private void button3_Click(object sender, System.EventArgs e)
{
resdial.Activate() ;
System.IntPtr srcDC=GetDC(resdial.axWebBrowser1.Handle);
Bitmap bm=new Bitmap(50,50);
Graphics g=Graphics.FromImage(bm);
System.IntPtr bmDC=g.GetHdc();
BitBlt(bmDC,0,0,bm.Width,bm.Height,srcDC,0,0,0x00CC0020 /*SRCCOPY*/);
this.pictureBox1.Image = System.Drawing.Image.FromHbitmap(bmDC);
ReleaseDC(srcDC);
g.ReleaseHdc(bmDC);
g.Dispose();
}
The line that gives the error is
this.pictureBox1.Image = System.Drawing.Image.FromHbitmap(bmDC);
What's wrong with this?
Thanks
With the code I use to capture part of a form, an error shows up : External
GDI+ error
the code is the following
private void button3_Click(object sender, System.EventArgs e)
{
resdial.Activate() ;
System.IntPtr srcDC=GetDC(resdial.axWebBrowser1.Handle);
Bitmap bm=new Bitmap(50,50);
Graphics g=Graphics.FromImage(bm);
System.IntPtr bmDC=g.GetHdc();
BitBlt(bmDC,0,0,bm.Width,bm.Height,srcDC,0,0,0x00CC0020 /*SRCCOPY*/);
this.pictureBox1.Image = System.Drawing.Image.FromHbitmap(bmDC);
ReleaseDC(srcDC);
g.ReleaseHdc(bmDC);
g.Dispose();
}
The line that gives the error is
this.pictureBox1.Image = System.Drawing.Image.FromHbitmap(bmDC);
What's wrong with this?
Thanks