i seen this tutorial of capture screen and i did some edit to it and the result is good,
but the resolution of each image is 1366, 768
and i want it to be like 683, 384
but all i get is part of the image
here is my code:
private void Display(Bitmap desktop)
{
if (desktop != null)
{
Bitmap bmp = new Bitmap(1366, 768);
using (Graphics g = Graphics.FromImage(bmp))
{
g.DrawImage(desktop, Point.Empty);
}
MemoryStream stream = new MemoryStream();
Image myImg = (bmp as Image);
myImg.Save(stream, System.Drawing.Imaging.ImageFormat.Jpeg);
byte[] pic = stream.ToArray();
ssWithMouseViewer.Image = myImg;
dataGridView1.Rows.Add(pic);
}
}
here is my form:
i want to store in the datagridview images with resolution of 683, 384 and less qualty.