Пример #1
0
        private void InitializeResources()
        {
            m_tempLayer = m_presenter.Factory.CreateDrawingLayer(SCENE_WIDTH, SCENE_HEIGHT);
            m_tempLayer2 = m_presenter.Factory.CreateDrawingLayer(SCENE_WIDTH, SCENE_HEIGHT);
            m_drawingLayerBrush = m_presenter.Factory.CreateDrawingLayerBrush(m_tempLayer);
            m_drawingLayerBrush2 = m_presenter.Factory.CreateDrawingLayerBrush(m_tempLayer2);
            m_blurEffect = new BlurEffect(m_presenter.Factory);

            GradientStop[] stops = new GradientStop[3];

            stops[0].Position = 0;
            stops[0].Color = new Color4(1f, 1, 0, 0);

            stops[1].Position = 0.5f;
            stops[1].Color = new Color4(1f, 0, 1, 0);

            stops[2].Position = 1f;
            stops[2].Color = new Color4(.1f, 0, 0, 1);

            m_gradientBrush = m_presenter.Factory.CreateLinearGradientBrush(stops, ExtendMode.Clamp, new PointF(0, 0), new PointF(SCENE_WIDTH, 0));
            m_gradientBrush.Transform = new RotateTransform();

            //m_paintingBrush = m_presenter.DirectCanvas.CreateRadialGradientBrush(stops,
            //                                                                    ExtendMode.Clamp,
            //                                                                    new PointF(500, 500),
            //                                                                    new PointF(0, 0),
            //                                                                    new SizeF(500, 500));

            InitMediaPlayer();
        }
Пример #2
0
        private void Initialize()
        {
            SetupGeometry();

            m_solidColorBrush = m_presenter.Factory.CreateSolidColorBrush(new Color4(1, 1, 1, 1));
            m_bitmap = m_presenter.Factory.CreateDrawingLayerFromFile(@".\Assets\Nature Mountains photo.jpg");
            m_bitmapBrush = m_presenter.Factory.CreateDrawingLayerBrush(m_bitmap);

            GradientStop[] stops = new GradientStop[3];

            stops[0].Position = 0;
            stops[0].Color = new Color4(1f, 1, 0, 0);

            stops[1].Position = 0.5f;
            stops[1].Color = new Color4(1f, 0, 1, 0);

            stops[2].Position = 1f;
            stops[2].Color = new Color4(.1f, 0, 0, 1);

            m_gradientBrush = m_presenter.Factory.CreateLinearGradientBrush(stops, ExtendMode.Clamp, new PointF(0, 0), new PointF(SCENE_WIDTH, 0));
            m_gradientBrush.Transform = new RotateTransform();

            m_radialBrush = m_presenter.Factory.CreateRadialGradientBrush(stops, 
                                                                                   ExtendMode.Clamp,
                                                                                   new PointF(500, 500),
                                                                                   new PointF(0, 0),
                                                                                   new SizeF(500, 500));
        }