public MainWindow() { Thread.CurrentThread.CurrentUICulture = CultureInfo.CreateSpecificCulture(Settings.Default.Culture); InitializeComponent(); SetLanguages(); var version = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version; _headerText = string.Format(" - FlagMaker {0}.{1}{2}", version.Major, version.Minor, version.Build > 0 ? string.Format(".{0}", version.Build) : string.Empty); SetTitle(); _showGrid = false; SetColorsAndSliders(); LoadPresets(); OverlayFactory.SetUpTypeMap(); try { OverlayFactory.FillCustomOverlays(); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void Clone(object sender, EventArgs e) { var controlToClone = (OverlayControl)sender; int index = _lstOverlays.Children.IndexOf(controlToClone); var type = controlToClone.Overlay.GetType(); var copy = OverlayFactory.GetInstance(type, 1, 1, controlToClone.Overlay.Name); for (int i = 0; i < controlToClone.Overlay.Attributes.Count; i++) { copy.Attributes[i].Value = controlToClone.Overlay.Attributes[i].Value; copy.Attributes[i].IsDiscrete = controlToClone.Overlay.Attributes[i].IsDiscrete; } copy.SetColor(controlToClone.Overlay.Color); if (type == typeof(OverlayPath) || type.IsSubclassOf(typeof(OverlayPath))) { ((OverlayPath)copy).StrokeColor = ((OverlayPath)controlToClone.Overlay).StrokeColor; } else if (type == typeof(OverlayFlag)) { ((OverlayFlag)copy).Flag = ((OverlayFlag)controlToClone.Overlay).Flag; } var gridSize = ((Ratio)_cmbGridSize.SelectedItem); copy.SetMaximum(gridSize.Width, gridSize.Height); OverlayAdd(index + 1, copy, true); }
public PopEffect() { var globalCurve = new Curve(CurveInterpolation.NaturalCubicSpline) { Points = new[] { new Point(0, 0), new Point(68, 60), new Point(144, 163), new Point(255, 255), } }; var overlayFactory = new OverlayFactory( "ms-appx:///images/Filters_Landscape_Overlay_Pop3.png", "ms-appx:///images/Filters_Portrait_Overlay_Pop3.png", "ms-appx:///images/Filters_Square_Overlay_Pop3.png"); LayerList = new LayerList() { new AdjustmentLayer(LayerStyle.Normal(), new ContrastEffect(1.0)), new AdjustmentLayer(LayerStyle.Normal(), new CurvesEffect(globalCurve)), new AdjustmentLayer(LayerStyle.Normal(), new GrayscaleEffect(0.54, 0.64, 0.0, -0.1)), new AdjustmentLayer(LayerStyle.Normal(), new LevelsEffect(0.7, 0.7 / 2, 0)), new Layer(LayerStyle.Screen(1.0), context => new ColorImageSource(context.HintedRenderSize, Color.FromArgb(255, 108, 0, 148))), new Layer(LayerStyle.Lighten(), context => overlayFactory.CreateAsync(context.HintedRenderSize)) }; }
public OldPosterEffect() { // Curves var globalCurve = new Curve(CurveInterpolation.NaturalCubicSpline) { Points = new[] { new Point(0, 0), new Point(38, 17), new Point(160, 210), new Point(231, 250), new Point(255, 255) } }; var overlayFactory = new OverlayFactory( "ms-appx:///images/Filters_Landscape_Overlay_Poster2.png", "ms-appx:///images/Filters_Portrait_Overlay_Poster2.png", "ms-appx:///images/Filters_Square_Overlay_Poster2.png"); LayerList = new LayerList( new AdjustmentLayer(LayerStyle.Normal(), new GrayscaleEffect(0.54, 0.64, 0.0, -0.1)), new AdjustmentLayer(LayerStyle.Normal(), new CurvesEffect(globalCurve)), new Layer(LayerStyle.Multiply(), context => new ColorImageSource(context.BackgroundLayer.ImageSize, Color.FromArgb(255, 255, 167, 151))), new Layer(LayerStyle.Normal(), context => overlayFactory.CreateAsync(context.BackgroundLayer.ImageSize)) ); }
public Overlay ToOverlay(int maxX, int maxY, string directory) { Overlay overlay; if (!string.IsNullOrWhiteSpace(Path)) { overlay = Type == "flag" ? OverlayFactory.GetFlagInstance(Path, maxX, maxY) : OverlayFactory.GetImageInstance(Path, directory, maxX, maxY); } else { overlay = OverlayFactory.GetInstance(Type, maxX, maxY); } if (overlay == null) { return(null); } overlay.SetColor(Color); overlay.SetValues(Values); var path = overlay as OverlayPath; if (path != null) { path.StrokeColor = StrokeColor; } return(overlay); }
public DreamEffect() { Name = "Dream"; var diagonalGradient = new LinearGradient { StartPoint = new Point(0.0, 0.0), EndPoint = new Point(1.0, 1.0), Stops = new[] { new GradientStop {Offset = 0, Color = Color.FromArgb(255, 133, 147, 201)}, new GradientStop {Offset = 1.0, Color = Color.FromArgb(255, 245, 152, 157)} } }; var overlayFactory = new OverlayFactory( "ms-appx:///images/Filters_Landscape_Overlay_Dream.jpg", "ms-appx:///images/Filters_Portrait_Overlay_Dream.jpg", "ms-appx:///images/Filters_Square_Overlay_Dream.jpg"); LayerList = new LayerList( new AdjustmentLayer(LayerStyle.Normal(), new LevelsEffect(0.75, 0.85, 0.15)), new Layer(LayerStyle.Softlight(), context => new GradientImageSource(context.BackgroundLayer.ImageSize, diagonalGradient)), new Layer(LayerStyle.Overlay(), context => overlayFactory.CreateAsync(context.BackgroundLayer.ImageSize)) ); }
public FantasticEffect() { var globalCurve = new Curve(CurveInterpolation.NaturalCubicSpline) { Points = new[] { new Point(0, 0), new Point(68, 60), new Point(144, 163), new Point(255, 255), } }; var overlayFactory1 = new OverlayFactory( "ms-appx:///images/Filters_Landscape_Overlay_Fantastic1.jpg", "ms-appx:///images/Filters_Portrait_Overlay_Fantastic1.jpg", "ms-appx:///images/Filters_Square_Overlay_Fantastic1.jpg"); var overlayFactory2 = new OverlayFactory( "ms-appx:///images/Filters_Landscape_Overlay_Fantastic2.png", "ms-appx:///images/Filters_Portrait_Overlay_Fantastic2.png", "ms-appx:///images/Filters_Square_Overlay_Fantastic2.png"); LayerList = new LayerList() { new AdjustmentLayer(LayerStyle.Normal(), new ContrastEffect(1.0)), new AdjustmentLayer(LayerStyle.Normal(), new CurvesEffect(globalCurve)), new AdjustmentLayer(LayerStyle.Normal(), new GrayscaleEffect(0.54, 0.64, 0.0, -0.1)), new Layer(LayerStyle.Softlight(), context => overlayFactory1.CreateAsync(context.BackgroundLayer.ImageSize)), new Layer(LayerStyle.Normal(), context => overlayFactory2.CreateAsync(context.BackgroundLayer.ImageSize)) }; }
public OldPosterEffect() { // Curves var globalCurve = new Curve(CurveInterpolation.NaturalCubicSpline) { Points = new[] { new Point(0, 0), new Point(38, 17), new Point(160, 210), new Point(231, 250), new Point(255, 255) } }; var overlayFactory = new OverlayFactory( "ms-appx:///images/Filters_Landscape_Overlay_Poster2.png", "ms-appx:///images/Filters_Portrait_Overlay_Poster2.png", "ms-appx:///images/Filters_Square_Overlay_Poster2.png"); LayerList = new LayerList( new AdjustmentLayer(LayerStyle.Normal(), new GrayscaleEffect(0.54, 0.64, 0.0, -0.1)), new AdjustmentLayer(LayerStyle.Normal(), new CurvesEffect(globalCurve)), new Layer(LayerStyle.Multiply(), context => new ColorImageSource(context.BackgroundLayer.ImageSize, Color.FromArgb(255, 255, 167, 151))), new Layer(LayerStyle.Normal(), context => overlayFactory.CreateAsync(context.BackgroundLayer.ImageSize)) ); }
public FantasticEffect() { var globalCurve = new Curve(CurveInterpolation.NaturalCubicSpline) { Points = new[] { new Point(0, 0), new Point(68, 60), new Point(144, 163), new Point(255, 255), } }; var overlayFactory1 = new OverlayFactory( "ms-appx:///images/Filters_Landscape_Overlay_Fantastic1.jpg", "ms-appx:///images/Filters_Portrait_Overlay_Fantastic1.jpg", "ms-appx:///images/Filters_Square_Overlay_Fantastic1.jpg"); var overlayFactory2 = new OverlayFactory( "ms-appx:///images/Filters_Landscape_Overlay_Fantastic2.png", "ms-appx:///images/Filters_Portrait_Overlay_Fantastic2.png", "ms-appx:///images/Filters_Square_Overlay_Fantastic2.png"); LayerList = new LayerList() { new AdjustmentLayer(LayerStyle.Normal(), new ContrastEffect(1.0)), new AdjustmentLayer(LayerStyle.Normal(), new CurvesEffect(globalCurve)), new AdjustmentLayer(LayerStyle.Normal(), new GrayscaleEffect(0.54, 0.64, 0.0, -0.1)), new Layer(LayerStyle.Softlight(), context => overlayFactory1.CreateAsync(context.BackgroundLayer.ImageSize)), new Layer(LayerStyle.Normal(), context => overlayFactory2.CreateAsync(context.BackgroundLayer.ImageSize)) }; }
public DreamEffect() { Name = "Dream"; var diagonalGradient = new LinearGradient { StartPoint = new Point(0.0, 0.0), EndPoint = new Point(1.0, 1.0), Stops = new[] { new GradientStop { Offset = 0, Color = Color.FromArgb(255, 133, 147, 201) }, new GradientStop { Offset = 1.0, Color = Color.FromArgb(255, 245, 152, 157) } } }; var overlayFactory = new OverlayFactory( "ms-appx:///images/Filters_Landscape_Overlay_Dream.jpg", "ms-appx:///images/Filters_Portrait_Overlay_Dream.jpg", "ms-appx:///images/Filters_Square_Overlay_Dream.jpg"); LayerList = new LayerList( new AdjustmentLayer(LayerStyle.Normal(), new LevelsEffect(0.75, 0.85, 0.15)), new Layer(LayerStyle.Softlight(), context => new GradientImageSource(context.BackgroundLayer.ImageSize, diagonalGradient)), new Layer(LayerStyle.Overlay(), context => overlayFactory.CreateAsync(context.BackgroundLayer.ImageSize)) ); }
public PopEffect() { var globalCurve = new Curve(CurveInterpolation.NaturalCubicSpline) { Points = new[] { new Point(0, 0), new Point(68, 60), new Point(144, 163), new Point(255, 255), } }; var overlayFactory = new OverlayFactory( "ms-appx:///images/Filters_Landscape_Overlay_Pop3.png", "ms-appx:///images/Filters_Portrait_Overlay_Pop3.png", "ms-appx:///images/Filters_Square_Overlay_Pop3.png"); LayerList = new LayerList() { new AdjustmentLayer(LayerStyle.Normal(), new ContrastEffect(1.0)), new AdjustmentLayer(LayerStyle.Normal(), new CurvesEffect(globalCurve)), new AdjustmentLayer(LayerStyle.Normal(), new GrayscaleEffect(0.54, 0.64, 0.0, -0.1)), new AdjustmentLayer(LayerStyle.Normal(), new LevelsEffect(0.7, 0.7 / 2, 0)), new Layer(LayerStyle.Screen(1.0), context => new ColorImageSource(context.HintedRenderSize, Color.FromArgb(255, 108, 0, 148))), new Layer(LayerStyle.Lighten(), context => overlayFactory.CreateAsync(context.HintedRenderSize)) }; }
public LightEffect() { var globalCurve = new Curve(CurveInterpolation.Linear, new[] { new Point(0, 0), new Point(41, 59), new Point(112, 146), new Point(189, 211), new Point(255, 255) }); var redCurve = new Curve(CurveInterpolation.Linear, new[] { new Point(18, 0), new Point(126, 116), new Point(255, 228), }); Curve.Compose(redCurve, globalCurve, redCurve); var greenCurve = globalCurve; var blueCurve = new Curve(CurveInterpolation.Linear, new[] { new Point(0, 44), new Point(113, 138), new Point(230, 255), }); Curve.Compose(blueCurve, globalCurve, blueCurve); var gradient = new RadialGradient { EllipseRadius = new EllipseRadius(1.5, 0), CenterPoint = new Point(0.5, 0.5), Stops = new[] { new GradientStop { Offset = 0, Color = Color.FromArgb(0, 0, 0, 0) }, new GradientStop { Offset = 1, Color = Color.FromArgb(255, 255, 255, 255) } } }; var overlayFactory = new OverlayFactory( "ms-appx:///images/Filters_Landscape_Overlay_Light.jpg", "ms-appx:///images/Filters_Portrait_Overlay_Light.jpg", "ms-appx:///images/Filters_Square_Overlay_Light.jpg"); LayerList = new LayerList() { new AdjustmentLayer(LayerStyle.Normal(0.2), new CurvesEffect(redCurve, greenCurve, blueCurve)), new Layer(LayerStyle.Softlight(0.3), context => new ColorImageSource(context.BackgroundLayer.ImageSize, Color.FromArgb(255, 200, 200, 200))), new Layer(LayerStyle.Softlight(0.7), context => new GradientImageSource(context.BackgroundLayer.ImageSize, gradient)), new Layer(LayerStyle.Screen(), context => overlayFactory.CreateAsync(context.BackgroundLayer.ImageSize)) }; }
protected void HoverExit() { OverlayFactory.HANDLER().ClickThrough = true; if (controller != null) { controller.HoverExited(); } }
protected void HoverEnter() { OverlayFactory.HANDLER().ClickThrough = false; if (controller != null) { controller.HoverEntered(); } }
public LightEffect() { var globalCurve = new Curve(CurveInterpolation.Linear, new[] { new Point(0, 0), new Point(41, 59), new Point(112, 146), new Point(189, 211), new Point(255, 255) }); var redCurve = new Curve(CurveInterpolation.Linear, new[] { new Point(18, 0), new Point(126, 116), new Point(255, 228), }); Curve.Compose(redCurve, globalCurve, redCurve); var greenCurve = globalCurve; var blueCurve = new Curve(CurveInterpolation.Linear, new[] { new Point(0, 44), new Point(113, 138), new Point(230, 255), }); Curve.Compose(blueCurve, globalCurve, blueCurve); var gradient = new RadialGradient { EllipseRadius = new EllipseRadius(1.5, 0), CenterPoint = new Point(0.5, 0.5), Stops = new[] { new GradientStop {Offset = 0, Color = Color.FromArgb(0, 0, 0, 0)}, new GradientStop {Offset = 1, Color = Color.FromArgb(255, 255, 255, 255)} } }; var overlayFactory = new OverlayFactory( "ms-appx:///images/Filters_Landscape_Overlay_Light.jpg", "ms-appx:///images/Filters_Portrait_Overlay_Light.jpg", "ms-appx:///images/Filters_Square_Overlay_Light.jpg"); LayerList = new LayerList() { new AdjustmentLayer(LayerStyle.Normal(0.2), new CurvesEffect(redCurve, greenCurve, blueCurve)), new Layer(LayerStyle.Softlight(0.3), context => new ColorImageSource(context.BackgroundLayer.ImageSize, Color.FromArgb(255, 200, 200, 200))), new Layer(LayerStyle.Softlight(0.7), context => new GradientImageSource(context.BackgroundLayer.ImageSize, gradient)), new Layer(LayerStyle.Screen(), context => overlayFactory.CreateAsync(context.BackgroundLayer.ImageSize)) }; }
void OnPostRender() { if (!wait) { tex = OverlayFactory.HANDLER().ActiveWindow.GetActiveWindowCapture(); if (tex != null) { target.GetComponent <RawImage>().texture = tex; } } }
public bool IsProgramOpen() { var newProgram = OverlayFactory.HANDLER().ActiveWindow.GetTitle().ToLower(); if (!newProgram.Contains(Application.productName.ToLower())) { prevOpenProgram = OpenProgram; OpenProgram = newProgram; return(OpenProgram.Contains(Name.ToLower())); } return(prevOpenProgram.Contains(Name.ToLower())); }
// Update is called once per frame void Update() { if (!isLow && !OverlayFactory.HANDLER().CanToggleClickThrough) { isLow = true; transform.SetPositionAndRotation(transform.position + new Vector3(0, -amount, 0), new Quaternion()); } else if (isLow && OverlayFactory.HANDLER().CanToggleClickThrough) { transform.SetPositionAndRotation(transform.position + new Vector3(0, amount, 0), new Quaternion()); isLow = false; } }
public ReflectiveGlassEffect() { var overlayFactory = new OverlayFactory( "ms-appx:///images/Filters_Landscape_Overlay_Reflect.jpg", "ms-appx:///images/Filters_Portrait_Overlay_Reflect.jpg", "ms-appx:///images/Filters_Square_Overlay_Reflect.jpg") { HorizontalAlignment = HorizontalAlignment.None }; LayerList.AddRange( new Layer(LayerStyle.Screen(), context => overlayFactory.CreateAsync(context.BackgroundLayer.ImageSize)) ); }
public MagzineStarEffect() { var overlayFactory = new OverlayFactory( "ms-appx:///images/Filters_Landscape_Overlay_Magazine.png", "ms-appx:///images/Filters_Portrait_Overlay_Magazine.png", "ms-appx:///images/Filters_Square_Overlay_Magazine.png") { HorizontalAlignment = HorizontalAlignment.None }; LayerList.AddRange( new Layer(LayerStyle.Normal(targetArea: new Rect(0.02, 0.02, 0.96, 0.96)), context => overlayFactory.CreateAsync(context.HintedRenderSize)) ); }
public MagzineStarEffect() { var overlayFactory = new OverlayFactory( "ms-appx:///images/Filters_Landscape_Overlay_Magazine.png", "ms-appx:///images/Filters_Portrait_Overlay_Magazine.png", "ms-appx:///images/Filters_Square_Overlay_Magazine.png") { HorizontalAlignment = HorizontalAlignment.None }; LayerList.AddRange( new Layer(LayerStyle.Normal(targetArea: new Rect(0.02, 0.02, 0.96, 0.96)), context => overlayFactory.CreateAsync(context.HintedRenderSize)) ); }
public ReflectiveGlassEffect() { var overlayFactory = new OverlayFactory( "ms-appx:///images/Filters_Landscape_Overlay_Reflect.jpg", "ms-appx:///images/Filters_Portrait_Overlay_Reflect.jpg", "ms-appx:///images/Filters_Square_Overlay_Reflect.jpg") { HorizontalAlignment = HorizontalAlignment.None }; LayerList.AddRange( new Layer(LayerStyle.Screen(), context => overlayFactory.CreateAsync(context.BackgroundLayer.ImageSize)) ); }
// Use this for initialization protected override void Clicked() { _open = !_open; OverlayFactory.HANDLER().CanToggleClickThrough = !_open; if (_open) { menu.GetComponent <CanvasGroup>().Show(); } else { menu.GetComponent <CanvasGroup>().Hide(); } }
public ClickthroughComponent(MonoBehaviour mb, IClickthroughController tc = null) { controller = tc; component = mb; OverlayFactory.HANDLER().MouseTracker.OnMouseMoved += MouseTracker_OnMouseMoved; }
void Start() { OverlayFactory.HANDLER().ClickThrough = clickthrough; }
void Start() { OverlayFactory.HANDLER().MouseTracker.OnMouseMoved += MouseTracker_OnMouseMoved; }