private void NewDrawingBoard(string fileName) { Engine.Workflow w = Engine.WorkflowCollection.NewWorkflow(); if (string.IsNullOrEmpty(fileName)) { w.SetCanvas(new Engine.Surface.Canvas(1200, 1200, Engine.Colors.White)); } else { try { w.SetCanvas(new Engine.Surface.Canvas(fileName)); } catch (Exception e) { MessageBox.Show(String.Format("Error reading file : ", e.Message)); } } var db = new PaintualUI.Controls.DrawingBoard(w); NewDockPane(db, String.Format(t_defaultDocTabTitle + "{0}", w.Key)); _app.ActiveContentHelper.SetCurrentDrawingBoard(db); // a suggested default tool to work with the new DrawingBoard SetActivity(new Engine.Tools.GrainyPen()); }
/// <summary> /// Creates an instance of the VisualPropertyPage and has it fills its content according to the /// current DrawingBoard and selected tool, effect, animation. /// </summary> public void Show(Engine.Workflow w) { if (t_visualPropertyPage != null) { t_docContent.Close -= Pane_Close; Grid g = (Grid)t_docContent.Content; g.Children.Remove(t_visualPropertyPage); t_visualPropertyPage = null; g = null; t_visualPropertyPage = new PaintualUI.Controls.PropertyPage.VisualPropertyPage(); g = new Grid(); g.Background = Brushes.DarkGray; t_docContent.Content = g; g.Children.Add(t_visualPropertyPage); t_docContent.Close += Pane_Close; t_visualPropertyPage.Build(w); return; } t_visualPropertyPage = new PaintualUI.Controls.PropertyPage.VisualPropertyPage(); if (t_docContent == null) { t_docContent = CreateContainer(); } t_visualPropertyPage.Build(w); }
public override IGraphicActivity Duplicate(Engine.Workflow w) { Ripple r = new Ripple(); r.Initialize(w); return(r); }
/// <summary> /// Creates a new instance of an effect that will be attached to another Workflow. /// </summary> /// <param name="w">The workflow to which a copy of this effect is to be applied to.</param> /// <returns></returns> public virtual Engine.Tools.IGraphicActivity Duplicate(Engine.Workflow w) { AnimationBase ab = new AnimationBase(); ab.Initialize(w); return(ab); }
public override IGraphicActivity Duplicate(Engine.Workflow w) { GrainyPen tlt = new GrainyPen(); tlt.Initialize(w); return(tlt); }
public override IGraphicActivity Duplicate(Engine.Workflow w) { QuickExtractAndSave qeas = new QuickExtractAndSave(); qeas.Initialize(w); return(qeas); }
/// <summary> /// Creates a new instance of an effect that will be attached to another Workflow. /// </summary> /// <param name="w">The workflow to which a copy of this effect is to be applied to.</param> /// <returns></returns> public virtual Engine.Tools.IGraphicActivity Duplicate(Engine.Workflow w) { Effect eb = new Effect(); eb.Initialize(w); return(eb); }
public override IGraphicActivity Duplicate(Engine.Workflow w) { Glitch g = new Glitch(); g.Initialize(w); return(g); }
public override void Initialize(Engine.Workflow w) { base.Initialize(w); t_imagePerlin = Engine.Effects.Code.Noise.NoiseFactory_Static.CreatePerlinNoisePlane(t_imageSource, t_frequency, t_seed, t_octaves); CreateFlowField(); }
public override IGraphicActivity Duplicate(Engine.Workflow w) { Brightness b = new Brightness(); b.Initialize(w); return(b); }
public override IGraphicActivity Duplicate(Engine.Workflow w) { Flow_2 f2 = new Flow_2(); f2.Initialize(w); return(f2); }
public override IGraphicActivity Duplicate(Engine.Workflow w) { NoiseFactory nf = new NoiseFactory(); nf.Initialize(w); return(nf); }
public override IGraphicActivity Duplicate(Engine.Workflow w) { AttractorPen ap = new AttractorPen(); ap.Initialize(w); return(ap); }
public override IGraphicActivity Duplicate(Engine.Workflow w) { VarianceGradientEffect vge = new VarianceGradientEffect(); vge.Initialize(w); return(vge); }
public override IGraphicActivity Duplicate(Engine.Workflow w) { ForceEffect fe = new ForceEffect(); fe.Initialize(w); return(fe); }
public override IGraphicActivity Duplicate(Engine.Workflow w) { BlurEffect be = new BlurEffect(); be.Initialize(w); return(be); }
public virtual void Initialize(Engine.Workflow w) { t_workflow = w; t_attributeCollection = new Attributes.AttributeCollection(); t_imageSource = t_workflow.Canvas; // clear the drawing surface of all work layers created by previous tools or effects t_workflow.SelectionGlassRequest(SelectionGlassRequestType.Delete); }
internal void SetWorkflow(Engine.Workflow w) { t_workflow = w; if (t_timer.IsEnabled == false) { t_timer.Start(); } t_workflow.Closing += E_workflow_Closing; t_workflow.InvalidateRequested += E_Workflow_InvalidateRequested; }
public override void Initialize(Engine.Workflow w) { base.Initialize(w); t_attributeCollection.Add(t_folderPath_PropertyName, new Engine.Attributes.StringAttribute()); t_attributeCollection.Add(t_prefix_PropertyName, new Engine.Attributes.StringAttribute()); t_attributeCollection.Add(t_format_PropertyName, new Engine.Attributes.StringAttribute()); // moved to HasErrors prop. because the property is set before the tool is used // so if errros, no selectionGlass is created for nothing //t_VIOM.SelectionGlassRequest(SelectionGlassRequestType.Create); }
private void SetActivity(Engine.Tools.IGraphicActivity activity) { Engine.Workflow w = GetWorkflowForCurrentDrawingBoard(); if (w == null) { return; } w.SetActivity(activity); _app.VisualPropertyPageManager.Show(w); }
public void SetCurrentDrawingBoard(PaintualUI.Controls.DrawingBoard db) { if (db != t_currentDrawingBoard) { t_currentDrawingBoard = db; Engine.Workflow w = t_currentDrawingBoard.Workflow; Engine.WorkflowCollection.SetAsActiveWorkflow(w.Key); // VisualPropertyPage has registered to this event OnCurrentDrawingBoardChanged(); } }
private Engine.Workflow GetWorkflowForCurrentDrawingBoard() { PaintualUI.Controls.DrawingBoard db = _app.ActiveContentHelper.GetCurrentDrawingBoard(); if (db == null) { MessageBox.Show("Select a drawing board first"); return(null); } Engine.Workflow w = db.Workflow; return(w); }
public static void EndWorkflow(int key) { if (key == -1) { return; } Engine.Workflow w = t_workflows[key]; w.OnClosing(); t_workflows.Remove(key); w.Dispose(); }
public override void Initialize(Engine.Workflow w) { base.Initialize(w); // both have all values initialized at 0 by default; t_buffer_1 = new Engine.Effects.Particles.FluidField(t_imageSource.Width, t_imageSource.Height); t_buffer_2 = new Effects.Particles.FluidField(t_imageSource.Width, t_imageSource.Height); sum = new double[t_imageSource.Width * t_imageSource.Height]; b1_1 = new double[t_imageSource.Width * t_imageSource.Height]; b1_2 = new double[t_imageSource.Width * t_imageSource.Height]; b1_3 = new double[t_imageSource.Width * t_imageSource.Height]; b1_4 = new double[t_imageSource.Width * t_imageSource.Height]; b2_1 = new double[t_imageSource.Width * t_imageSource.Height]; }
public static Engine.Workflow GetWorkflow(int key) { if (key == -1) { throw new ArgumentOutOfRangeException(String.Format("In {0}, the provided Workflow key {1} cannot be retrieved.", "WorkflowCollection.GetWorkflow", key)); } Engine.Workflow w = t_workflows[key]; if (w == null) { throw new ArgumentException(String.Format("The Viome with the specified key ({0}) does not exist in the Application.", key)); } return(w); }
private void Extraction_QuickExtractAndSave_Click(object sender, RoutedEventArgs e) { PaintualUI.Controls.DrawingBoard db = _app.ActiveContentHelper.GetCurrentDrawingBoard(); if (db == null) { MessageBox.Show("Select a drawing board first"); return; } Engine.Workflow w = db.Workflow; Engine.Tools.QuickExtractAndSave qeas = new Engine.Tools.QuickExtractAndSave(); w.SetActivity(qeas); _app.VisualPropertyPageManager.Show(w); // TODO : determine when double click should not be handled anymore and release handler db.SelectionDoubleClick += qeas.HandleDoubleClick; }
private void Save_MenuItem_Click(object sender, RoutedEventArgs e) { PaintualUI.Controls.DrawingBoard db = _app.ActiveContentHelper.GetCurrentDrawingBoard(); if (db == null) { MessageBox.Show("Select a drawing board first"); return; } SaveFileDialog dialog = new SaveFileDialog() { Filter = "PNG files(*.png)|*.png" }; if (dialog.ShowDialog() == true) { Engine.Workflow w = db.Workflow; w.LastSavedFolder = dialog.FileName; w.SaveImage(dialog.FileName, Engine.Surface.ImageFileFormats.PNG); } }
public void DeleteDrawingBoard(PaintualUI.Controls.DrawingBoard db) { Engine.Workflow w = db.Workflow; Engine.WorkflowCollection.EndWorkflow(w.Key); }
public abstract IGraphicActivity Duplicate(Engine.Workflow w);
public WorkflowEventArgs(Engine.Workflow w) { Workflow = w; }