예제 #1
0
        public static ViewfinderKind UpdateRectangularStyle(RectangularViewfinderStyleType styleType, RectangularViewfinderLineStyleType lineStyleType)
        {
            if (lineStyleType.LineStyle != ((RectangularViewfinder)Rectangular.Viewfinder).LineStyle)
            {
                Rectangular = new ViewfinderKind(1, "Rectangular", RectangularViewfinder.Create(styleType.Style, lineStyleType.LineStyle));

                var viewfinder = (RectangularViewfinder)Rectangular.Viewfinder;
                viewfinder.Animation     = SettingsManager.Instance.RectangularViewfinderAnimation;
                viewfinder.Dimming       = SettingsManager.Instance.RectangularViewfinderDimming;
                viewfinder.Color         = SettingsManager.Instance.RectangularViewfinderColor.UIColor;
                viewfinder.DisabledColor = SettingsManager.Instance.RectangularViewfinderDisabledColor.UIColor;

                if (SettingsManager.Instance.ViewfinderSizeSpecification == RectangularSizeSpecification.WidthAndHeight)
                {
                    viewfinder.SetSize(new SizeWithUnit(SettingsManager.Instance.RectangularWidth, SettingsManager.Instance.RectangularHeight));
                }
                else if (SettingsManager.Instance.ViewfinderSizeSpecification == RectangularSizeSpecification.WidthAndHeightAspect)
                {
                    viewfinder.SetWidthAndAspectRatio(SettingsManager.Instance.RectangularWidth, SettingsManager.Instance.RectangularHeightAspect);
                }
                else if (SettingsManager.Instance.ViewfinderSizeSpecification == RectangularSizeSpecification.HeightAndWidthAspect)
                {
                    viewfinder.SetHeightAndAspectRatio(SettingsManager.Instance.SpotlightHeight, SettingsManager.Instance.RectangularWidthAspect);
                }
                else if (SettingsManager.Instance.ViewfinderSizeSpecification == RectangularSizeSpecification.ShorterDimensionAndAspectRatio)
                {
                    viewfinder.SetShorterDimensionAndAspectRatio(SettingsManager.Instance.RectangularShorterDimension, SettingsManager.Instance.RectangularLongerDimensionAspect);
                }
            }

            return(Rectangular);
        }
예제 #2
0
        public static ViewfinderKind UpdateRectangularStyle(RectangularViewfinderStyleType styleType)
        {
            if (styleType.Style != ((RectangularViewfinder)Rectangular.Viewfinder).Style)
            {
                Rectangular = new ViewfinderKind(1, "Rectangular", RectangularViewfinder.Create(styleType.Style));

                var viewfinder = (RectangularViewfinder)Rectangular.Viewfinder;
                viewfinder.Animation = null;
                SettingsManager.Instance.RectangularViewfinderAnimation     = viewfinder.Animation;
                SettingsManager.Instance.RectangularViewfinderLineStyleType = viewfinder.LineStyle ==
                                                                              RectangularViewfinderLineStyle.Light ? RectangularViewfinderLineStyleType.Light : RectangularViewfinderLineStyleType.Bold;
                SettingsManager.Instance.RectangularViewfinderDimming       = viewfinder.Dimming;
                SettingsManager.Instance.RectangularViewfinderColor         = RectangularViewfinderColor.Default;
                SettingsManager.Instance.RectangularViewfinderDisabledColor = RectangularViewfinderDisabledColor.Default;
            }

            return(Rectangular);
        }