how to fit screen shot in to 800*600 bitmap

232 Views Asked by At

i want to screen shot my screen and place it in 800*600 bitmap. how can i do it? the problem is that i can make a full 4K bitmap and then the whole screen shot will be inside and i cant do it otherwise. and if the bit map is smaller it places only part of the screenshot.

  Bitmap bmpScreenCapture=new Bitmap(800,600);
       Graphics g = Graphics.FromImage(bmpScreenCapture);
        //g.CopyFromScreen(800,
        //             600,
        //             0, 0,
        //             bmpScreenCapture.Size,
        //             CopyPixelOperation.SourceCopy);
        g.CopyFromScreen(Screen.PrimaryScreen.Bounds.X,
                     Screen.PrimaryScreen.Bounds.Y,
                     0, 0,
                     bmpScreenCapture.Size,
                   CopyPixelOperation.SourceCopy);

i am placing it eventually in a picture box

thanks very appriciate

0

There are 0 best solutions below