Question: I am currently using this code to screen capture the panel I created, but whenever I am saving it, the quality is bad. Is there any way to maintain the good quality when saving it?

I tried resizing the panel but the result is still the same.
I tried doing a normal screen shot with the snipping tool and it also has the same result with the codes I use.

Any suggestions? or help? 

```
private void SaveControlImage(Control theControl)
{
    snapCount++;

    int width = panel1.Size.Width;
    int height = panel1.Size.Height;

    Bitmap bm = new Bitmap(width, height, PixelFormat.Format64bppPArgb);

    panel1.DrawToBitmap(bm, new Rectangle(0, 0, width, height));
    //bm.Save(@"D:\TestDrawToBitmap.bmp", ImageFormat.Bmp);

    bm.Save(deskTopPath + @"/Offer_" + snapCount.ToString() + "_" + DateTime.Now.ToString("yyyyMMdd") + @".jpg", System.Drawing.Imaging.ImageFormat.Jpeg);
}

```

---

Like here, it looks pixelated if you compare it to what you're reading now (like this website). I tried to screen cap the form but it looks like the uploaded picture so its useless

Screenshot:

![1](https://i.stack.imgur.com/HY9Z7.jpg)

Answer: 
```
Bitmap bmp= new Bitmap(controls.Width, controls.Height-50, System.Drawing.Imaging.PixelFormat.Format32bppArgb);
Graphics Grap = Graphics.FromImage(bmp);

Grap.CopyFromScreen(PointToScreen(controls.Location).X, PointToScreen(controls.Location).Y, 0, 0, AnhDoThi.Size, CopyPixelOperation.SourceCopy);
SaveFileDialog save = new SaveFileDialog();
save.Filter = "JPEG|*.jpg";
DialogResult tl = save.ShowDialog();
if (tl == DialogResult.OK)
{
    bmp.Save(save.FileName);
    MessageBox.Show("Completed !");
}

```
Windows Forms is not using vector graphics to draw the user interface. Therefore, all you can get generically is to draw the control to a Bitmap instead of to the screen. This works independently of whether your control is visible on the screen, but there is not more than that. If you want a higher-resolution image from a Windows Forms control, the only way is to resize the control and hope that it supports zooming.