コード例 #1
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));
        }
コード例 #2
0
ファイル: ImageProcessing.cs プロジェクト: InfoStrat/MotionFx
        public void InitLayers(Size ImageSize)
        {
            hoverBrush = Factory.CreateSolidColorBrush(new Color4(.4f, 0, 0, 0));
            contactBrush = Factory.CreateSolidColorBrush(new Color4(.8f, 0, 0, 0));

            DepthPresenter = new WPFPresenter(Factory, ImageSize.Width, ImageSize.Height);
            intermediateLayer = Factory.CreateDrawingLayer(ImageSize.Width, ImageSize.Height);
            rawDepthLayer = Factory.CreateDrawingLayer(ImageSize.Width, ImageSize.Height);

            DepthBrush = Factory.CreateDrawingLayerBrush(DepthPresenter);
            DepthBrush.Alignment = DirectCanvas.Brushes.BrushAlignment.DrawingLayerAbsolute;
        }