Converts a length in device-independent pixels (DIPs) to a length in physical pixels.
| 88 | |
| 89 | // Converts a length in device-independent pixels (DIPs) to a length in physical pixels. |
| 90 | inline float ConvertDipsToPixels(float dips, float dpi) |
| 91 | { |
| 92 | static const float dipsPerInch = 96.0f; |
| 93 | return floorf(dips * dpi / dipsPerInch + 0.5f); // Round to nearest integer. |
| 94 | } |
| 95 | |
| 96 | // Converts a length in physical pixels to a length in device-independent pixels (DIPs) using the provided DPI. This removes the need |
| 97 | // to call this function from a thread associated with a CoreWindow, which is required by DisplayInformation::GetForCurrentView(). |