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(o bject sender, System.EventArg s e)
{
resdial.Activat e() ;
System.IntPtr srcDC=GetDC(res dial.axWebBrows er1.Handle);
Bitmap bm=new Bitmap(50,50);
Graphics g=Graphics.From Image(bm);
System.IntPtr bmDC=g.GetHdc() ;
BitBlt(bmDC,0,0 ,bm.Width,bm.He ight,srcDC,0,0, 0x00CC0020 /*SRCCOPY*/);
this.pictureBox 1.Image = System.Drawing. Image.FromHbitm ap(bmDC);
ReleaseDC(srcDC );
g.ReleaseHdc(bm DC);
g.Dispose();
}
The line that gives the error is
this.pictureBox 1.Image = System.Drawing. Image.FromHbitm ap(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(o bject sender, System.EventArg s e)
{
resdial.Activat e() ;
System.IntPtr srcDC=GetDC(res dial.axWebBrows er1.Handle);
Bitmap bm=new Bitmap(50,50);
Graphics g=Graphics.From Image(bm);
System.IntPtr bmDC=g.GetHdc() ;
BitBlt(bmDC,0,0 ,bm.Width,bm.He ight,srcDC,0,0, 0x00CC0020 /*SRCCOPY*/);
this.pictureBox 1.Image = System.Drawing. Image.FromHbitm ap(bmDC);
ReleaseDC(srcDC );
g.ReleaseHdc(bm DC);
g.Dispose();
}
The line that gives the error is
this.pictureBox 1.Image = System.Drawing. Image.FromHbitm ap(bmDC);
What's wrong with this?
Thanks
Comment