public override void Init(Table.Table Table) { base.Init(Table); Shape Def = Table.ShapeDefinitions.Shapes.FirstOrDefault(SH => SH.Name.Equals(ShapeName, StringComparison.InvariantCultureIgnoreCase)); if (Def != null) { IMatrixBitmapEffect FX; if (Def.GetType() == typeof(ShapeAnimated)) { ShapeAnimated DefAnim = (ShapeAnimated)Def; FX = new RGBAMatrixColorScaleBitmapAnimationEffect(); RGBAMatrixColorScaleBitmapAnimationEffect FXA = (RGBAMatrixColorScaleBitmapAnimationEffect)FX; FXA.AnimationBehaviour = DefAnim.AnimationBehaviour; FXA.AnimationFrameCount = DefAnim.AnimationFrameCount; FXA.AnimationFrameDurationMs = DefAnim.AnimationFrameDurationMs; FXA.AnimationStepDirection = DefAnim.AnimationStepDirection; FXA.AnimationStepSize = DefAnim.AnimationStepSize; ((RGBAMatrixColorScaleBitmapAnimationEffect)FX).ActiveColor = this.ActiveColor; ((RGBAMatrixColorScaleBitmapAnimationEffect)FX).InactiveColor = this.InactiveColor; } else { FX = new RGBAMatrixColorScaleBitmapEffect(); ((RGBAMatrixColorScaleBitmapEffect)FX).ActiveColor = this.ActiveColor; ((RGBAMatrixColorScaleBitmapEffect)FX).InactiveColor = this.InactiveColor; } FX.BitmapFilePattern = Table.ShapeDefinitions.BitmapFilePattern; FX.BitmapFrameNumber = Def.BitmapFrameNumber; FX.BitmapHeight = Def.BitmapHeight; FX.BitmapWidth = Def.BitmapWidth; FX.BitmapTop = Def.BitmapTop; FX.BitmapLeft = Def.BitmapLeft; FX.DataExtractMode = Def.DataExtractMode; FX.ToyName = this.ToyName; FX.FadeMode = this.FadeMode; FX.Name = this.Name + " Target"; FX.LayerNr = this.LayerNr; FX.FadeMode = this.FadeMode; FX.Left = this.Left; FX.Top = this.Top; FX.Width = this.Width; FX.Height = this.Height; TargetEffect = FX; TargetEffect.Init(Table); } else { //Shape does not exist TargetEffect = null; } }
public override void Finish() { base.Finish(); if (TargetEffect != null) { TargetEffect.Finish(); TargetEffect = null; } }