Windows programming: Difference between revisions

From Wildsong
Jump to navigationJump to search
Brian Wilson (talk | contribs)
m New page: == Read the screen resolution in DPI == →‎Get the device context of the screen: tmpDC = GetDC(0); →‎Get the screen resolution.: iScre...
 
Brian Wilson (talk | contribs)
 
Line 1: Line 1:
== Read the screen resolution in DPI ==
== Read the screen resolution in DPI ==


            /* Get the device context of the screen */
  /* Get the device context of the screen */
            tmpDC = GetDC(0);
  tmpDC = GetDC(0);
            /* Get the screen resolution. */
  /* Get the screen resolution. */
            iScreenResolution = GetDeviceCaps((int)tmpDC, 88); //88 is the win32 const for Logical pixels/inch in X)
  iScreenResolution = GetDeviceCaps((int)tmpDC, 88); //88 is the win32 const for Logical pixels/inch in X)
            /* release the DC. */
  /* release the DC. */
            ReleaseDC(0, (int)tmpDC);
  ReleaseDC(0, (int)tmpDC);
            docExport.Resolution = iOutputResolution;
  docExport.Resolution = iOutputResolution;

Latest revision as of 19:07, 14 June 2008

Read the screen resolution in DPI

 /* Get the device context of the screen */
 tmpDC = GetDC(0);
 /* Get the screen resolution. */
 iScreenResolution = GetDeviceCaps((int)tmpDC, 88); //88 is the win32 const for Logical pixels/inch in X)
 /* release the DC. */
 ReleaseDC(0, (int)tmpDC);
 docExport.Resolution = iOutputResolution;