/// <summary> /// Changes the component attributes /// </summary> /// <param name="attribute">attribute string in form Name=Value</param> /// <returns>array of two strings: name and attribute</returns> public override string[] AddAttribute(string attribute) { string[] attrib = base.AddAttribute(attribute); if (attrib.Length <= 1) { return(attrib); } try { switch (attrib[0]) { case "ccolor": CountColor = Slide.GetColorARGB(attrib[1].Trim().ToUpper()); break; case "countcolor": CountColor = Slide.GetColorARGB(attrib[1].Trim().ToUpper()); break; case "ctolerance": CountColorTolerance = Convert.ToInt32(attrib[1].Trim()); break; case "countcolortolerance": CountColorTolerance = Convert.ToInt32(attrib[1].Trim()); break; case "newfile": NewFile = Convert.ToBoolean(attrib[1].Trim()); break; default: break; } } catch (Exception) { } return(attrib); }
/// <summary> /// Constructor, creates the image description /// </summary> /// <param name="Parent"></param> /// <param name="args"></param> public SlideComponentPixelCount(Slide Parent, string[] args) : base(Parent, args) { CountColor = (args.Length > 6) ? Slide.GetColorARGB(args[6]) : Color.White; CountColorTolerance = (args.Length > 7) ? Convert.ToInt32(args[7]) : 0; NewFile = (args.Length > 8) ? Convert.ToBoolean(args[8].Trim()) : false; }
/// <summary> /// Changes the component attributes /// </summary> /// <param name="attribute">attribute string in form Name=Value</param> /// <returns>array of two strings: name and attribute</returns> public override string[] AddAttribute(string attribute) { string[] attrib = base.AddAttribute(attribute); if (attrib.Length <= 1) { return(attrib); } try { switch (attrib[0]) { case "source_x": source_x = Convert.ToInt32(attrib[1].Trim()); break; case "source_y": source_y = Convert.ToInt32(attrib[1].Trim()); break; case "source_dx": source_dx = Convert.ToInt32(attrib[1].Trim()); break; case "source_dy": source_dy = Convert.ToInt32(attrib[1].Trim()); break; case "tcolor": TransparentColor = Slide.GetColorARGB(attrib[1].Trim().ToUpper()); break; case "transparentcolor": TransparentColor = Slide.GetColorARGB(attrib[1].Trim().ToUpper()); break; case "ttolerance": TransparentColorTolerance = Convert.ToInt32(attrib[1].Trim()); break; case "transparentcolortolerance": TransparentColorTolerance = Convert.ToInt32(attrib[1].Trim()); break; default: break; } } catch (Exception) { } return(attrib); }
/// <summary> /// Constructor, creates the image description /// </summary> /// <param name="Parent"></param> /// <param name="args"></param> public SlideComponentImageOver(Slide Parent, string[] args) : base(Parent, args) { if (args.Length > 6) { source_x = Convert.ToInt32(args[6]); } if (args.Length > 7) { source_y = Convert.ToInt32(args[7]); } if (args.Length > 8) { source_dx = Convert.ToInt32(args[8]); } if (args.Length > 9) { source_dy = Convert.ToInt32(args[9]); } if (args.Length > 10) { TransparentColor = Slide.GetColorARGB(args[10]); } if (args.Length > 11) { TransparentColorTolerance = Convert.ToInt32(args[11]); } SaveAttributes(); }
/// <summary> /// Constructor, creates the image description /// </summary> /// <param name="Parent"></param> /// <param name="args"></param> public SlideComponentRasterOver(Slide Parent, string[] args) : base(Parent, args) { source_x = (args.Length > 6) ? Convert.ToInt32(args[6]) : 0; source_y = (args.Length > 7) ? Convert.ToInt32(args[7]) : 0; source_dx = (args.Length > 8) ? Convert.ToInt32(args[8]) : -1; source_dy = (args.Length > 9) ? Convert.ToInt32(args[9]) : -1; TransparentColor = (args.Length > 10) ? Slide.GetColorARGB(args[10]) : Color.White; TransparentColorTolerance = (args.Length > 11) ? Convert.ToInt32(args[11]) : 0; }
/// <summary> /// Recovers attributes from the previous component /// </summary> protected override void RecoverAttributes() { try { this.x = Convert.ToInt32(ParentSlide.DefaultParameters["x"]); this.y = Convert.ToInt32(ParentSlide.DefaultParameters["y"]); this.dx = Convert.ToInt32(ParentSlide.DefaultParameters["dx"]); this.dy = Convert.ToInt32(ParentSlide.DefaultParameters["dy"]); this.Text = ParentSlide.DefaultParameters["mask"]; this.source_x = Convert.ToInt32(ParentSlide.DefaultParameters["source_x"]); this.source_y = Convert.ToInt32(ParentSlide.DefaultParameters["source_y"]); this.source_dx = Convert.ToInt32(ParentSlide.DefaultParameters["source_dx"]); this.source_dy = Convert.ToInt32(ParentSlide.DefaultParameters["source_dy"]); this.TransparentColor = Slide.GetColorARGB(ParentSlide.DefaultParameters["tcolor"]); this.TransparentColorTolerance = Convert.ToInt32(ParentSlide.DefaultParameters["ttolerance"]); this.Orientation = ParentSlide.DefaultParameters["orientation"]; } catch (Exception) { } }