Пример #1
0
        public Bush()
        {
            using (StreamGeometryContext geometryContext = base.BGGeometry.Open())
            {
                geometryContext.BeginFigure(new Point(-16.0d, -16.0d), true, true);

                pc = new PointCollection();
                pc.Add(new Point(16.0d, -16.0d));
                pc.Add(new Point(16.0d, 16.0d));
                pc.Add(new Point(-16.0d, 16.0d));

                geometryContext.PolyLineTo(pc, true, true);
            }
            using (StreamGeometryContext geometryContext2 = base.IconGeometry.Open())
            {
                geometryContext2.BeginFigure(new Point(-16.0d, -16.0d), true, true);

                pc2 = new PointCollection();
                pc2.Add(new Point(16.0d, -16.0d));
                pc2.Add(new Point(16.0d, 16.0d));
                pc2.Add(new Point(-16.0d, 16.0d));

                geometryContext2.PolyLineTo(pc, true, true);
            }
            string uri = "pack://application:,,,/Assets/Bush.png";

            _NextElementID++;
            name    = "Bush " + _NextElementID;
            _FEType = "Bush";

            ImageSource imageSource = new ImageSourceConverter().ConvertFromString(uri) as ImageSource;

            _IconBrush = new ImageBrush(new BitmapImage(new Uri(imageSource.ToString())));
            _BGBrush   = Brushes.Transparent;
        }
Пример #2
0
        public Stage(Brush nColour, double nScaleX, double nScaleY) : base(nColour, nScaleX, nScaleY)
        {
            using (StreamGeometryContext geometryContext = base.BGGeometry.Open())
            {
                geometryContext.BeginFigure(new Point(-16.0d, -16.0d), true, true);

                pc = new PointCollection();
                pc.Add(new Point(16.0d, -16.0d));
                pc.Add(new Point(16.0d, 16.0d));
                pc.Add(new Point(-16.0d, 16.0d));

                geometryContext.PolyLineTo(pc, true, true);
            }
            using (StreamGeometryContext geometryContext2 = base.IconGeometry.Open())
            {
                geometryContext2.BeginFigure(new Point(-16.0d, -16.0d), true, true);

                pc2 = new PointCollection();
                pc2.Add(new Point(16.0d, -16.0d));
                pc2.Add(new Point(16.0d, 16.0d));
                pc2.Add(new Point(-16.0d, 16.0d));

                geometryContext2.PolyLineTo(pc, true, true);
            }
            string uri = "pack://application:,,,/Assets/Stage.png";

            _NextElementID++;
            name    = "Stage " + _NextElementID;
            _FEType = "Stage";

            ImageSource imageSource = new ImageSourceConverter().ConvertFromString(uri) as ImageSource;

            _IconBrush = new ImageBrush(new BitmapImage(new Uri(imageSource.ToString())));
        }
Пример #3
0
        public BeerTent()
        {
            // geometry for this element's background
            using (StreamGeometryContext geometryContext = base.BGGeometry.Open())
            {
                geometryContext.BeginFigure(new Point(-16.0d, -16.0d), true, true);

                pc = new PointCollection();
                pc.Add(new Point(16.0d, -16.0d));
                pc.Add(new Point(16.0d, 16.0d));
                pc.Add(new Point(-16.0d, 16.0d));

                geometryContext.PolyLineTo(pc, true, true);
            }

            // geometry for the icon of this element
            using (StreamGeometryContext geometryContext2 = base.IconGeometry.Open())
            {
                geometryContext2.BeginFigure(new Point(-16.0d, -16.0d), true, true);

                pc2 = new PointCollection();
                pc2.Add(new Point(16.0d, -16.0d));
                pc2.Add(new Point(16.0d, 16.0d));
                pc2.Add(new Point(-16.0d, 16.0d));

                geometryContext2.PolyLineTo(pc, true, true);
            }
            string uri = "pack://application:,,,/Assets/AlcoholIcon.png"; // image location of icon

            _NextElementID++;
            name    = "BeerTent " + _NextElementID; //  sets element name
            _FEType = "BeerTent";                   // type used for Save/ Load

            ImageSource imageSource = new ImageSourceConverter().ConvertFromString(uri) as ImageSource;

            _IconBrush = new ImageBrush(new BitmapImage(new Uri(imageSource.ToString())));
        }