Example #1
0
        //public static BitmapOverlay(RenderContext renderContext, TourStop owner, string filename)
        //{
        //    this.Owner = owner;
        //    this.filename = Guid.NewGuid().ToString() + ".png";

        //    this.Name = filename.Substr(filename.LastIndexOf('\\'));

        //    X = 0;
        //    Y = 0;
        //}


        public static BitmapOverlay Create(RenderContext renderContext, TourStop owner, ImageElement image)
        {
            BitmapOverlay temp = new BitmapOverlay();

            temp.Owner = owner;
            // to make directory and guid filename in tour temp dir.
            temp.filename = (NextId++).ToString() + ".png";

            temp.Name = owner.GetNextDefaultName("Image");
            temp.X    = 0;
            temp.Y    = 0;

            return(temp);
        }
Example #2
0
        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);
        }
Example #3
0
        public BitmapOverlay Copy(TourStop owner)
        {
            BitmapOverlay newBmpOverlay = new BitmapOverlay();

            newBmpOverlay.Owner         = owner;
            newBmpOverlay.filename      = this.filename;
            newBmpOverlay.X             = this.X;
            newBmpOverlay.Y             = this.Y;
            newBmpOverlay.Width         = this.Width;
            newBmpOverlay.Height        = this.Height;
            newBmpOverlay.Color         = this.Color;
            newBmpOverlay.Opacity       = this.Opacity;
            newBmpOverlay.RotationAngle = this.RotationAngle;
            newBmpOverlay.Name          = this.Name + " - Copy";

            return(newBmpOverlay);
        }
Example #4
0
        public BitmapOverlay Copy(TourStop owner)
        {
            BitmapOverlay newBmpOverlay = new BitmapOverlay();
            newBmpOverlay.Owner = owner;
            newBmpOverlay.filename = this.filename;
            newBmpOverlay.X = this.X;
            newBmpOverlay.Y = this.Y;
            newBmpOverlay.Width = this.Width;
            newBmpOverlay.Height = this.Height;
            newBmpOverlay.Color = this.Color;
            newBmpOverlay.Opacity = this.Opacity;
            newBmpOverlay.RotationAngle = this.RotationAngle;
            newBmpOverlay.Name = this.Name + " - Copy";

            return newBmpOverlay;
        }
Example #5
0
        //public static BitmapOverlay(RenderContext renderContext, TourStop owner, string filename)
        //{
        //    this.Owner = owner;
        //    this.filename = Guid.NewGuid().ToString() + ".png";
        //    this.Name = filename.Substr(filename.LastIndexOf('\\'));
        //    X = 0;
        //    Y = 0;
        //}
        public static BitmapOverlay Create(RenderContext renderContext, TourStop owner, ImageElement image)
        {
            BitmapOverlay temp = new BitmapOverlay();

            temp.Owner = owner;
            // to make directory and guid filename in tour temp dir.
            temp.filename = (NextId++).ToString() + ".png";

            temp.Name = owner.GetNextDefaultName("Image");
            temp.X = 0;
            temp.Y = 0;

            return temp;
        }
Example #6
0
        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;
        }