internal RadialGradientBrush(Direct2DRenderTarget renderTargetOwner, GradientStop[] gradientStops, ExtendMode extendMode, PointF centerPoint, PointF gradientOriginOffset, SizeF radius) { m_renderTargetOwner = renderTargetOwner; m_extendMode = extendMode; m_radius = radius; m_gradientOriginOffset = gradientOriginOffset; m_centerPoint = centerPoint; var gradientStopList = new List<SlimDX.Direct2D.GradientStop>(gradientStops.Length); for (int i = 0; i < gradientStops.Length; i++) { gradientStopList.Add(gradientStops[i].InternalGradientStop); } var props = new RadialGradientBrushProperties(); props.CenterPoint = centerPoint.InternalPointF; props.GradientOriginOffset = gradientOriginOffset.InternalPointF; props.HorizontalRadius = radius.Width; props.VerticalRadius = radius.Height; m_internalGradientStopCollection = new GradientStopCollection(m_renderTargetOwner.InternalRenderTarget, gradientStopList.ToArray(), Gamma.Linear, (SlimDX.Direct2D.ExtendMode)extendMode); m_internalRadialGradientBrush = new SlimDX.Direct2D.RadialGradientBrush(m_renderTargetOwner.InternalRenderTarget, m_internalGradientStopCollection, props); }
internal LinearGradientBrush(Direct2DRenderTarget renderTargetOwner, GradientStop[] gradientStops, ExtendMode extendMode, PointF startPoint, PointF endPoint) { m_renderTargetOwner = renderTargetOwner; var gradientStopList = new List<SlimDX.Direct2D.GradientStop>(gradientStops.Length); for (int i = 0; i < gradientStops.Length; i++) { gradientStopList.Add(gradientStops[i].InternalGradientStop); } var props = new LinearGradientBrushProperties(); props.StartPoint = startPoint.InternalPointF; props.EndPoint = endPoint.InternalPointF; m_startPoint = startPoint; m_endPoint = endPoint; var internalRt = m_renderTargetOwner.InternalRenderTarget; m_internalGradientStopCollection = new GradientStopCollection(internalRt, gradientStopList.ToArray(), Gamma.Linear, (SlimDX.Direct2D.ExtendMode)extendMode); m_internalLinearGradientBrush = new SlimDX.Direct2D.LinearGradientBrush(internalRt, m_internalGradientStopCollection, props); }
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(); }
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)); }
public RadialGradientBrush CreateRadialGradientBrush(GradientStop[] gradientStops, ExtendMode extendMode, PointF centerPoint, PointF gradientOriginOffset, SizeF radius) { return new RadialGradientBrush(m_renderTargetResourceOwner, gradientStops, extendMode, centerPoint, gradientOriginOffset, radius); }
public LinearGradientBrush CreateLinearGradientBrush(GradientStop[] gradientStops, ExtendMode extendMode, PointF startPoint, PointF endPoint) { return new LinearGradientBrush(m_renderTargetResourceOwner, gradientStops, extendMode, startPoint, endPoint); }