/// <devdoc> /// CreateDC creates a DeviceContext object wrapping an hdc created with the Win32 CreateDC function. /// </devdoc> public static DeviceContext CreateDC(string driverName, string deviceName, string fileName, HandleRef devMode) { // Note: All input params can be null but not at the same time. See MSDN for information. IntPtr hdc = IntUnsafeNativeMethods.CreateDC(driverName, deviceName, fileName, devMode); return(new DeviceContext(hdc, DeviceContextType.NamedDevice)); }