internal static Overlay FromXml(TourStop owner, XmlNode overlay) { if (overlay.Attributes == null) { return(null); } if (overlay.Attributes.GetNamedItem("Type") == null) { return(null); } string overlayClassName = overlay.Attributes.GetNamedItem("Type").Value.ToString(); //Type overLayType = Type.GetType(overlayClassName.Replace("TerraViewer.","")); string overLayType = overlayClassName.Replace("TerraViewer.", ""); Overlay newOverlay = null; //Overlay newOverlay = (Overlay)System.Activator.CreateInstance(overLayType); switch (overLayType) { case "AudioOverlay": newOverlay = new AudioOverlay(); break; case "BitmapOverlay": newOverlay = new BitmapOverlay(); break; case "FlipBookOverlay": newOverlay = new FlipbookOverlay(); break; case "ShapeOverlay": newOverlay = new ShapeOverlay(); break; case "TextOverlay": newOverlay = new TextOverlay(); break; default: return(null); } newOverlay.owner = owner; newOverlay.InitOverlayFromXml(overlay); return(newOverlay); }
//public FlipbookOverlay(RenderContext renderContext, TourStop owner, string filename) //{ // this.Owner = owner; // string extension = filename.Substr(filename.LastIndexOf(".")); // this.filename = Guid.NewGuid().ToString() + extension; // this.Name = filename.Substr(filename.LastIndexOf('\\')); // //File.Copy(filename, Owner.Owner.WorkingDirectory + this.filename); // //Bitmap bmp = new Bitmap(Owner.Owner.WorkingDirectory + this.filename); // Width = 256; // Height = 256; // //bmp.Dispose(); // //bmp = null; // X = 0; // Y = 0; //} //public FlipbookOverlay(RenderContext renderContext, TourStop owner, Image image) //{ // this.Owner = owner; // this.canvas = canvas; // // to make directory and guid filename in tour temp dir. // this.filename = Guid.NewGuid().ToString() + ".png"; // this.Name = owner.GetNextDefaultName("Image"); // X = 0; // Y = 0; // //image.Save(Owner.Owner.WorkingDirectory + filename, ImageFormat.Png); // Width = 256; // Height = 256; //} public FlipbookOverlay Copy(TourStop owner) { //todo fix this FlipbookOverlay newFlipbookOverlay = new FlipbookOverlay(); newFlipbookOverlay.Owner = owner; newFlipbookOverlay.filename = this.filename; newFlipbookOverlay.X = this.X; newFlipbookOverlay.Y = this.Y; newFlipbookOverlay.Width = this.Width; newFlipbookOverlay.Height = this.Height; newFlipbookOverlay.Color = this.Color; newFlipbookOverlay.Opacity = this.Opacity; newFlipbookOverlay.RotationAngle = this.RotationAngle; newFlipbookOverlay.Name = this.Name + " - Copy"; newFlipbookOverlay.StartFrame = this.StartFrame; newFlipbookOverlay.Frames = this.Frames; newFlipbookOverlay.LoopType = this.LoopType; newFlipbookOverlay.FrameSequence = this.FrameSequence; newFlipbookOverlay.FramesX = this.FramesX; newFlipbookOverlay.FramesY = this.FramesY; return(newFlipbookOverlay); }
//public FlipbookOverlay(RenderContext renderContext, TourStop owner, string filename) //{ // this.Owner = owner; // string extension = filename.Substr(filename.LastIndexOf(".")); // this.filename = Guid.NewGuid().ToString() + extension; // this.Name = filename.Substr(filename.LastIndexOf('\\')); // //File.Copy(filename, Owner.Owner.WorkingDirectory + this.filename); // //Bitmap bmp = new Bitmap(Owner.Owner.WorkingDirectory + this.filename); // Width = 256; // Height = 256; // //bmp.Dispose(); // //bmp = null; // X = 0; // Y = 0; //} //public FlipbookOverlay(RenderContext renderContext, TourStop owner, Image image) //{ // this.Owner = owner; // this.canvas = canvas; // // to make directory and guid filename in tour temp dir. // this.filename = Guid.NewGuid().ToString() + ".png"; // this.Name = owner.GetNextDefaultName("Image"); // X = 0; // Y = 0; // //image.Save(Owner.Owner.WorkingDirectory + filename, ImageFormat.Png); // Width = 256; // Height = 256; //} public FlipbookOverlay Copy(TourStop owner) { //todo fix this FlipbookOverlay newFlipbookOverlay = new FlipbookOverlay(); newFlipbookOverlay.Owner = owner; newFlipbookOverlay.filename = this.filename; newFlipbookOverlay.X = this.X; newFlipbookOverlay.Y = this.Y; newFlipbookOverlay.Width = this.Width; newFlipbookOverlay.Height = this.Height; newFlipbookOverlay.Color = this.Color; newFlipbookOverlay.Opacity = this.Opacity; newFlipbookOverlay.RotationAngle = this.RotationAngle; newFlipbookOverlay.Name = this.Name + " - Copy"; newFlipbookOverlay.StartFrame = this.StartFrame; newFlipbookOverlay.Frames = this.Frames; newFlipbookOverlay.LoopType = this.LoopType; newFlipbookOverlay.FrameSequence = this.FrameSequence; newFlipbookOverlay.FramesX = this.FramesX; newFlipbookOverlay.FramesY = this.FramesY; return newFlipbookOverlay; }
internal static Overlay FromXml(TourStop owner, XmlNode overlay) { if (overlay.Attributes == null) { return null; } if (overlay.Attributes.GetNamedItem("Type") == null) { return null; } string overlayClassName = overlay.Attributes.GetNamedItem("Type").Value.ToString(); //Type overLayType = Type.GetType(overlayClassName.Replace("TerraViewer.","")); string overLayType = overlayClassName.Replace("TerraViewer.", ""); Overlay newOverlay = null; //Overlay newOverlay = (Overlay)System.Activator.CreateInstance(overLayType); switch (overLayType) { case "AudioOverlay": newOverlay = new AudioOverlay(); break; case "BitmapOverlay": newOverlay = new BitmapOverlay(); break; case "FlipBookOverlay": newOverlay = new FlipbookOverlay(); break; case "ShapeOverlay": newOverlay = new ShapeOverlay(); break; case "TextOverlay": newOverlay = new TextOverlay(); break; default: return null; } newOverlay.owner = owner; newOverlay.InitOverlayFromXml(overlay); return newOverlay; }