Пример #1
0
        public D2D1TransformedGeometry CreateTransformedGeometry(D2D1Geometry sourceGeometry, D2D1Matrix3X2F transform)
        {
            if (sourceGeometry == null)
            {
                throw new ArgumentNullException("sourceGeometry");
            }

            ID2D1TransformedGeometry transformedGeometry;

            this.factory.CreateTransformedGeometry(sourceGeometry.GetHandle <ID2D1Geometry>(), ref transform, out transformedGeometry);
            return(new D2D1TransformedGeometry(transformedGeometry));
        }
Пример #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="D2D1LayerParameters"/> struct.
 /// </summary>
 /// <param name="contentBounds">The content bounds of the layer. Content outside these bounds is not guaranteed to render.</param>
 /// <param name="geometricMask">The geometric mask specifies the area of the layer that is composited into the render target.</param>
 /// <param name="maskAntialiasMode">A value that specifies the antialiasing mode for the geometricMask.</param>
 /// <param name="maskTransform">A value that specifies the transform that is applied to the geometric mask when composing the layer.</param>
 /// <param name="opacity">An opacity value that is applied uniformly to all resources in the layer when compositing to the target.</param>
 /// <param name="opacityBrush">A brush that is used to modify the opacity of the layer. The brush is mapped to the layer, and the alpha channel of each mapped brush pixel is multiplied against the corresponding layer pixel.</param>
 /// <param name="layerOptions">A value that specifies whether the layer intends to render text with ClearType antialiasing.</param>
 public D2D1LayerParameters(
     D2D1RectF contentBounds,
     D2D1Geometry geometricMask,
     D2D1AntialiasMode maskAntialiasMode,
     D2D1Matrix3X2F maskTransform,
     float opacity,
     D2D1Brush opacityBrush,
     D2D1LayerOptions layerOptions)
 {
     this.contentBounds     = contentBounds;
     this.geometricMask     = geometricMask == null ? null : geometricMask.GetHandle <ID2D1Geometry>();
     this.maskAntialiasMode = maskAntialiasMode;
     this.maskTransform     = maskTransform;
     this.opacity           = opacity;
     this.opacityBrush      = opacityBrush == null ? null : opacityBrush.GetHandle <ID2D1Brush>();
     this.layerOptions      = layerOptions;
 }