Posted 27 September 2017, 9:13 pm EST
Hi,
For the meantime, you can use below code snippet to achieve your requirement:
Bitmap BMP = new Bitmap(Screen.PrimaryScreen.Bounds.Width,
Screen.PrimaryScreen.Bounds.Height,
PixelFormat.Format32bppArgb);
using (Graphics GFX = Graphics.FromImage(BMP))
{
GFX.CopyFromScreen(Screen.PrimaryScreen.Bounds.X,
Screen.PrimaryScreen.Bounds.Y,
0, 0,
Screen.PrimaryScreen.Bounds.Size,
CopyPixelOperation.SourceCopy);
}
Bitmap YourImage = new Bitmap(groupBox2.Width, groupBox2.Height);
using (Graphics g = Graphics.FromImage(YourImage))
{
Point np = groupBox2.PointToScreen(new Point(0, 0));
g.DrawImage(BMP, new Rectangle(0, 0, groupBox2.Width, groupBox2.Height), new Rectangle(np, groupBox2.Size), GraphicsUnit.Pixel);
}
pictureBox2.Image = YourImage;
Hope, it will work.
Thanks,
Sonu