Esempio n. 1
0
        public virtual void DrawGeometry(
            ID2D1Geometry geometry,
            ID2D1Brush brush,
            float strokeWidth,
            ID2D1StrokeStyle strokeStyle
            )
        {
            var fp = GetFunctionPointer(22);

            if (m_DrawGeometryFunc == null)
            {
                m_DrawGeometryFunc = (DrawGeometryFunc)Marshal.GetDelegateForFunctionPointer(fp, typeof(DrawGeometryFunc));
            }

            m_DrawGeometryFunc(m_ptr, geometry != null ? geometry.Ptr : IntPtr.Zero, brush != null ? brush.Ptr : IntPtr.Zero, strokeWidth, strokeStyle != null ? strokeStyle.Ptr : IntPtr.Zero);
        }
Esempio n. 2
0
        public virtual void DrawEllipse(
            ref D2D1_ELLIPSE ellipse,
            ID2D1Brush brush,
            float strokeWidth,
            ID2D1StrokeStyle strokeStyle
            )
        {
            var fp = GetFunctionPointer(20);

            if (m_DrawEllipseFunc == null)
            {
                m_DrawEllipseFunc = (DrawEllipseFunc)Marshal.GetDelegateForFunctionPointer(fp, typeof(DrawEllipseFunc));
            }

            m_DrawEllipseFunc(m_ptr, ref ellipse, brush != null ? brush.Ptr : IntPtr.Zero, strokeWidth, strokeStyle != null ? strokeStyle.Ptr : IntPtr.Zero);
        }
Esempio n. 3
0
        public virtual void DrawRoundedRectangle(
            ref D2D1_ROUNDED_RECT roundedRect,
            ID2D1Brush brush,
            float strokeWidth,
            ID2D1StrokeStyle strokeStyle
            )
        {
            var fp = GetFunctionPointer(18);

            if (m_DrawRoundedRectangleFunc == null)
            {
                m_DrawRoundedRectangleFunc = (DrawRoundedRectangleFunc)Marshal.GetDelegateForFunctionPointer(fp, typeof(DrawRoundedRectangleFunc));
            }

            m_DrawRoundedRectangleFunc(m_ptr, ref roundedRect, brush != null ? brush.Ptr : IntPtr.Zero, strokeWidth, strokeStyle != null ? strokeStyle.Ptr : IntPtr.Zero);
        }
Esempio n. 4
0
        public virtual void DrawRectangle(
            ref System.Numerics.Vector4 rect,
            ID2D1Brush brush,
            float strokeWidth,
            ID2D1StrokeStyle strokeStyle
            )
        {
            var fp = GetFunctionPointer(16);

            if (m_DrawRectangleFunc == null)
            {
                m_DrawRectangleFunc = (DrawRectangleFunc)Marshal.GetDelegateForFunctionPointer(fp, typeof(DrawRectangleFunc));
            }

            m_DrawRectangleFunc(m_ptr, ref rect, brush != null ? brush.Ptr : IntPtr.Zero, strokeWidth, strokeStyle != null ? strokeStyle.Ptr : IntPtr.Zero);
        }
Esempio n. 5
0
        public virtual int CreateStrokeStyle(
            ref D2D1_STROKE_STYLE_PROPERTIES strokeStyleProperties,
            ref float dashes,
            uint dashesCount,
            out ID2D1StrokeStyle strokeStyle
            )
        {
            var fp = GetFunctionPointer(11);

            if (m_CreateStrokeStyleFunc == null)
            {
                m_CreateStrokeStyleFunc = (CreateStrokeStyleFunc)Marshal.GetDelegateForFunctionPointer(fp, typeof(CreateStrokeStyleFunc));
            }
            strokeStyle = new ID2D1StrokeStyle();
            return(m_CreateStrokeStyleFunc(m_ptr, ref strokeStyleProperties, ref dashes, dashesCount, out strokeStyle.PtrForNew));
        }
Esempio n. 6
0
        public virtual int GetWidenedBounds(
            float strokeWidth,
            ID2D1StrokeStyle strokeStyle,
            ref System.Numerics.Matrix3x2 worldTransform,
            float flatteningTolerance,
            out System.Numerics.Vector4 bounds
            )
        {
            var fp = GetFunctionPointer(5);

            if (m_GetWidenedBoundsFunc == null)
            {
                m_GetWidenedBoundsFunc = (GetWidenedBoundsFunc)Marshal.GetDelegateForFunctionPointer(fp, typeof(GetWidenedBoundsFunc));
            }

            return(m_GetWidenedBoundsFunc(m_ptr, strokeWidth, strokeStyle != null ? strokeStyle.Ptr : IntPtr.Zero, ref worldTransform, flatteningTolerance, out bounds));
        }
Esempio n. 7
0
        public virtual int Widen(
            float strokeWidth,
            ID2D1StrokeStyle strokeStyle,
            ref System.Numerics.Matrix3x2 worldTransform,
            float flatteningTolerance,
            ID2D1SimplifiedGeometrySink geometrySink
            )
        {
            var fp = GetFunctionPointer(16);

            if (m_WidenFunc == null)
            {
                m_WidenFunc = (WidenFunc)Marshal.GetDelegateForFunctionPointer(fp, typeof(WidenFunc));
            }

            return(m_WidenFunc(m_ptr, strokeWidth, strokeStyle != null ? strokeStyle.Ptr : IntPtr.Zero, ref worldTransform, flatteningTolerance, geometrySink != null ? geometrySink.Ptr : IntPtr.Zero));
        }
Esempio n. 8
0
        public virtual void DrawLine(
            System.Numerics.Vector2 point0,
            System.Numerics.Vector2 point1,
            ID2D1Brush brush,
            float strokeWidth,
            ID2D1StrokeStyle strokeStyle
            )
        {
            var fp = GetFunctionPointer(15);

            if (m_DrawLineFunc == null)
            {
                m_DrawLineFunc = (DrawLineFunc)Marshal.GetDelegateForFunctionPointer(fp, typeof(DrawLineFunc));
            }

            m_DrawLineFunc(m_ptr, point0, point1, brush != null ? brush.Ptr : IntPtr.Zero, strokeWidth, strokeStyle != null ? strokeStyle.Ptr : IntPtr.Zero);
        }
Esempio n. 9
0
        public virtual int StrokeContainsPoint(
            System.Numerics.Vector2 point,
            float strokeWidth,
            ID2D1StrokeStyle strokeStyle,
            ref System.Numerics.Matrix3x2 worldTransform,
            float flatteningTolerance,
            out int contains
            )
        {
            var fp = GetFunctionPointer(6);

            if (m_StrokeContainsPointFunc == null)
            {
                m_StrokeContainsPointFunc = (StrokeContainsPointFunc)Marshal.GetDelegateForFunctionPointer(fp, typeof(StrokeContainsPointFunc));
            }

            return(m_StrokeContainsPointFunc(m_ptr, point, strokeWidth, strokeStyle != null ? strokeStyle.Ptr : IntPtr.Zero, ref worldTransform, flatteningTolerance, out contains));
        }