Quantcast
Channel: Visual C# forum
Viewing all articles
Browse latest Browse all 31927

Two computers and one is wrong

$
0
0

Hello,

I have two computers and this code works great on one and terrible on the other. Can you help me determine why?

            if (!CheckToMakeSureSomethingIsSelected())
                return;

            int width = wi.rcWindow.right - wi.rcWindow.left;
            int height = -wi.rcWindow.top + wi.rcWindow.bottom;

            var bmp = new Bitmap(width, height, System.Drawing.Imaging.PixelFormat.Format32bppArgb);
            Graphics graphics = Graphics.FromImage(bmp);
            graphics.CopyFromScreen(wi.rcWindow.left, wi.rcWindow.top, 0, 0, new Size(width,height), CopyPixelOperation.SourceCopy);


            
            bmp.Save("c:\\savedpics\\test.png", System.Drawing.Imaging.ImageFormat.Png);
The screenshots are off by a about 100 units. It just doesn't make sense to me.


Viewing all articles
Browse latest Browse all 31927

Trending Articles