How do I convert a WPF size to physical pixels?

Transforming a known size to device pixels If your visual element is already attached to a PresentationSource (for example, it is part of a window that is visible on screen), the transform is found this way: var source = PresentationSource.FromVisual(element); Matrix transformToDevice = source.CompositionTarget.TransformToDevice; If not, use HwndSource to create a temporary hWnd: Matrix transformToDevice; … Read more