Beispiel #1
0
        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            double value_             = (double)value;
            double imageWidthOrHeight = value_ / ScreenDPI.GetScreenScaleFactor();

            return(imageWidthOrHeight);
        }
Beispiel #2
0
        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            double widthOrHeight = (double)value;
            double realWidthOrHeightToDisplay = widthOrHeight * ScreenDPI.GetScreenScaleFactor();

            return(realWidthOrHeightToDisplay);
        }
Beispiel #3
0
        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            Thickness value_ = (Thickness)value;

            // converted
            PointF originValue = new PointF((float)(value_.Left * ScreenDPI.GetScreenScaleFactor()), (float)(value_.Top * ScreenDPI.GetScreenScaleFactor()));

            return(originValue);
        }
Beispiel #4
0
        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            PointF originValue = (PointF)value;

            // converted
            // its always -50, as it is 50px wide, as specified in the xaml
            Thickness margin = new Thickness(originValue.X / ScreenDPI.GetScreenScaleFactor(), originValue.Y / ScreenDPI.GetScreenScaleFactor(), 0, 0);             // 20,75


            return(margin);
        }