I wan't to change the resolution of an Bitmap in C# and already found the Bitmap.setResolution method, but this method is not actually changing the physical resolution. Then i found this: http://www.nullskull.com/q/10269424/change-the-resolution-of-png-image-and-save-it.aspx But sadly it didn't work. With this code, the resulting image is just a part of the original one. Here is my code:
Bitmap b = new Bitmap(SystemInformation.VirtualScreen.Width, SystemInformation.VirtualScreen.Height);
Graphics g = Graphics.FromImage(b);
g.CopyFromScreen(0, 0, 0, 0, b.Size);
Bitmap b2 = new Bitmap(100, 100);
g = Graphics.FromImage(b2);
g.DrawImage(b, new Rectangle(0, 0, b2.Width, b2.Height), 0, 0, b.Width, b.Height, GraphicsUnit.Pixel);
b2.Save(Strings.common_documents + "tmp_screenshot.jpg", ImageFormat.Jpeg);
Is there a way of giving an Image a lower resolution with the same content?