Esempio n. 1
0
        protected override void OnCreateDeviceResources(WindowRenderTarget renderTarget)
        {
            base.OnCreateDeviceResources(renderTarget);
            // Create an array of gradient stops to put in the gradient stop
            // collection that will be used in the gradient brush.
            GradientStop[] stops = new GradientStop[] {
                new GradientStop(0, Color.FromKnown(Colors.Gold, 1)),
                new GradientStop(0.85f, Color.FromKnown(Colors.Orange, 1)),
                new GradientStop(1, Color.FromKnown(Colors.OrangeRed, 1))
            };

            using (GradientStopCollection gradiendStops = renderTarget.CreateGradientStopCollection(stops, Gamma.Gamma22, ExtendMode.Clamp))
            {
                // The center of the gradient is in the center of the box.
                // The gradient origin offset was set to zero(0, 0) or center in this case.
                this._radialGradientBrush = renderTarget.CreateRadialGradientBrush(
                    new RadialGradientBrushProperties(
                        new PointF(330, 330),
                        new PointF(140, 140),
                        140,
                        140),
                    BrushProperties.Default,
                    gradiendStops);
            }

            this._sceneBrush       = renderTarget.CreateSolidColorBrush(Color.FromKnown(Colors.Black, 1));
            this._gridPatternBrush = renderTarget.CreateGridPatternBrush(new SizeF(10, 10), Color.FromRGB(0.93f, 0.94f, 0.96f));
        }
Esempio n. 2
0
        protected override void OnCreateDeviceResources(WindowRenderTarget renderTarget)
        {
            base.OnCreateDeviceResources(renderTarget);
            this._blackBrush       = renderTarget.CreateSolidColorBrush(Color.FromKnown(Colors.Black, 1));
            this._yellowGreenBrush = renderTarget.CreateSolidColorBrush(Color.FromKnown(0x9ACD32, 1));

            GradientStop[] stops = new GradientStop[] {
                new GradientStop(0, Color.FromKnown(Colors.Yellow, 1)),
                new GradientStop(1, Color.FromKnown(Colors.ForestGreen, 1))
            };

            using (GradientStopCollection collection = renderTarget.CreateGradientStopCollection(stops, Gamma.Gamma22, ExtendMode.Clamp))
            {
                this._linearGradientBrush = renderTarget.CreateLinearGradientBrush(
                    new LinearGradientBrushProperties(new PointF(0, 0), new PointF(150, 150)),
                    BrushProperties.Default,
                    collection);
                this._radialGradientBrush = renderTarget.CreateRadialGradientBrush(
                    new RadialGradientBrushProperties(new PointF(75, 75), new PointF(0, 0), 75, 75),
                    BrushProperties.Default,
                    collection);
            }

            using (Bitmap bitmap = RenderTarget.CreateBitmap(this.GetType(), "fern.jpg"))
            {
                this._bitmapBrush = renderTarget.CreateBitmapBrush(bitmap,
                                                                   new BitmapBrushProperties(ExtendMode.Wrap, ExtendMode.Wrap, BitmapInterpolationMode.Linear),
                                                                   BrushProperties.Default);
            }

            this._gridPatternBrush = renderTarget.CreateGridPatternBrush(new SizeF(10, 10), Color.FromRGB(0.93f, 0.94f, 0.96f));
        }
Esempio n. 3
0
 protected override void OnCreateDeviceResources(WindowRenderTarget renderTarget)
 {
     base.OnCreateDeviceResources(renderTarget);
     this._bitmap           = renderTarget.CreateBitmap(this.GetType(), "fern.jpg");
     this._brush            = renderTarget.CreateSolidColorBrush(Color.FromARGB(Colors.Orange, 1));
     this._brush.Opacity    = 0.75f;
     this._gridPatternBrush = renderTarget.CreateGridPatternBrush(new SizeF(10, 10), Color.FromARGB(1, 0.93f, 0.94f, 0.96f));
 }
Esempio n. 4
0
        protected override void OnCreateDeviceResources(WindowRenderTarget renderTarget)
        {
            base.OnCreateDeviceResources(renderTarget);

            this._outlineBrush     = renderTarget.CreateSolidColorBrush(Color.FromARGB(Colors.DarkSlateBlue, 1), 1);
            this._shapeFillBrush   = renderTarget.CreateSolidColorBrush(Color.FromARGB(Colors.CornflowerBlue, 1), 0.5f);
            this._textFillBrush    = renderTarget.CreateSolidColorBrush(Color.FromARGB(Colors.Black, 1), 1);
            this._gridPatternBrush = renderTarget.CreateGridPatternBrush(new SizeF(10, 10), Color.FromARGB(1, 0.93f, 0.94f, 0.96f));
        }
Esempio n. 5
0
        protected override void OnCreateDeviceResources(WindowRenderTarget renderTarget)
        {
            base.OnCreateDeviceResources(renderTarget);
            // Create an array of gradient stops to put in the gradient stop
            // collection that will be used in the gradient brush.
            GradientStop[] stops = new GradientStop[] {
                new GradientStop(0, Color.FromARGB(Colors.Gold, 1)),
                new GradientStop(0.85f, Color.FromARGB(Colors.Orange, 1)),
                new GradientStop(1, Color.FromARGB(Colors.OrangeRed, 1))
            };

            using (GradientStopCollection gradiendStops = renderTarget.CreateGradientStopCollection(stops, Gamma.Gamma22, ExtendMode.Clamp))
            {
                // The center of the gradient is in the center of the box.
                // The gradient origin offset was set to zero(0, 0) or center in this case.
                this._radialGradientBrush = renderTarget.CreateRadialGradientBrush(
                    new RadialGradientBrushProperties(
                        new PointF(330, 330),
                        new PointF(140, 140),
                        140,
                        140),
                        BrushProperties.Default,
                        gradiendStops);
            }

            this._sceneBrush = renderTarget.CreateSolidColorBrush(Color.FromARGB(Colors.Black, 1));
            this._gridPatternBrush = renderTarget.CreateGridPatternBrush(new SizeF(10, 10), Color.FromARGB(1, 0.93f, 0.94f, 0.96f));
        }
Esempio n. 6
0
        protected override void OnCreateDeviceResources(WindowRenderTarget renderTarget)
        {
            base.OnCreateDeviceResources(renderTarget);
            this._blackBrush = renderTarget.CreateSolidColorBrush(Color.FromARGB(Colors.Black, 1));
            this._yellowGreenBrush = renderTarget.CreateSolidColorBrush(Color.FromARGB(0x9ACD32, 1));

            GradientStop[] stops = new GradientStop[] {
                new GradientStop(0, Color.FromARGB(Colors.Yellow, 1)),
                new GradientStop(1, Color.FromARGB(Colors.ForestGreen, 1))
            };

            using (GradientStopCollection collection = renderTarget.CreateGradientStopCollection(stops, Gamma.Gamma22, ExtendMode.Clamp))
            {
                this._linearGradientBrush = renderTarget.CreateLinearGradientBrush(
                    new LinearGradientBrushProperties(new PointF(0, 0), new PointF(150, 150)),
                    BrushProperties.Default,
                    collection);
                this._radialGradientBrush = renderTarget.CreateRadialGradientBrush(
                    new RadialGradientBrushProperties(new PointF(75, 75), new PointF(0, 0), 75, 75),
                    BrushProperties.Default,
                    collection);
            }

            using (Bitmap bitmap = RenderTarget.CreateBitmap(this.GetType(), "fern.jpg"))
            {
                this._bitmapBrush = renderTarget.CreateBitmapBrush(bitmap,
                    new BitmapBrushProperties(ExtendMode.Wrap, ExtendMode.Wrap, BitmapInterpolationMode.Linear),
                    BrushProperties.Default);
            }

            this._gridPatternBrush = renderTarget.CreateGridPatternBrush(new SizeF(10, 10), Color.FromARGB(1, 0.93f, 0.94f, 0.96f));
        }
Esempio n. 7
0
        protected override void OnCreateDeviceResources(WindowRenderTarget renderTarget)
        {
            base.OnCreateDeviceResources(renderTarget);

            this._outlineBrush = renderTarget.CreateSolidColorBrush(Color.FromARGB(Colors.DarkSlateBlue, 1), 1);
            this._shapeFillBrush = renderTarget.CreateSolidColorBrush(Color.FromARGB(Colors.CornflowerBlue, 1), 0.5f);
            this._textFillBrush = renderTarget.CreateSolidColorBrush(Color.FromARGB(Colors.Black, 1), 1);
            this._gridPatternBrush = renderTarget.CreateGridPatternBrush(new SizeF(10, 10), Color.FromARGB(1, 0.93f, 0.94f, 0.96f));
        }
Esempio n. 8
0
 protected override void OnCreateDeviceResources(WindowRenderTarget renderTarget)
 {
     base.OnCreateDeviceResources(renderTarget);
     this._bitmap = renderTarget.CreateBitmap(this.GetType(), "fern.jpg");
     this._brush = renderTarget.CreateSolidColorBrush(Color.FromARGB(Colors.Orange, 1));
     this._brush.Opacity = 0.75f;
     this._gridPatternBrush = renderTarget.CreateGridPatternBrush(new SizeF(10, 10), Color.FromARGB(1, 0.93f, 0.94f, 0.96f));
 }