I have a WPF application with a custom control. The custom control renders itself to a bitmap and I am able to use the following code to figure out what resolution to use so that the bitmap matches the display resolution.I have a WPF application with a custom control.