-
February 15th, 2013, 06:30 PM
#1
Getting the DPI information for the current display
I am new to C# and I am having problems getting some snippets of code to build. I am using VS2010 and am trying to use GetDeviceCaps or CreateGraphics to get the DPI of my monitor. This is the GetDeviceCaps code that I have.
{
SetProcessDPIAware();
HDC screen = GetDC(NULL);
double hDPI = GetDeviceCaps(screen,LOGPIXELSX);
double vDPI = GetDeviceCaps(screen,LOGPIXELSY);
ReleaseDC(NULL, screen);
}
Do I need to add a resource or library or something else so the compiler recognizes SetProcessDPIAware, GetDC, HDC, GetDeviceCaps, and ReleaseDC?
-
March 4th, 2013, 12:34 PM
#2
Re: Getting the DPI information for the current display
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|