Beispiel #1
0
        public virtual void DrawTextLayout(
            System.Numerics.Vector2 origin,
            IDWriteTextLayout textLayout,
            ID2D1Brush defaultFillBrush,
            D2D1_DRAW_TEXT_OPTIONS options
            )
        {
            var fp = GetFunctionPointer(28);

            if (m_DrawTextLayoutFunc == null)
            {
                m_DrawTextLayoutFunc = (DrawTextLayoutFunc)Marshal.GetDelegateForFunctionPointer(fp, typeof(DrawTextLayoutFunc));
            }

            m_DrawTextLayoutFunc(m_ptr, origin, textLayout != null ? textLayout.Ptr : IntPtr.Zero, defaultFillBrush != null ? defaultFillBrush.Ptr : IntPtr.Zero, options);
        }
Beispiel #2
0
        public virtual int CreateTextLayout(
            ref ushort _string,
            uint stringLength,
            IDWriteTextFormat textFormat,
            float maxWidth,
            float maxHeight,
            out IDWriteTextLayout textLayout
            )
        {
            var fp = GetFunctionPointer(18);

            if (m_CreateTextLayoutFunc == null)
            {
                m_CreateTextLayoutFunc = (CreateTextLayoutFunc)Marshal.GetDelegateForFunctionPointer(fp, typeof(CreateTextLayoutFunc));
            }
            textLayout = new IDWriteTextLayout();
            return(m_CreateTextLayoutFunc(m_ptr, ref _string, stringLength, textFormat != null ? textFormat.Ptr : IntPtr.Zero, maxWidth, maxHeight, out textLayout.PtrForNew));
        }
Beispiel #3
0
        public virtual int CreateGdiCompatibleTextLayout(
            ref ushort _string,
            uint stringLength,
            IDWriteTextFormat textFormat,
            float layoutWidth,
            float layoutHeight,
            float pixelsPerDip,
            ref DWRITE_MATRIX transform,
            int useGdiNatural,
            out IDWriteTextLayout textLayout
            )
        {
            var fp = GetFunctionPointer(19);

            if (m_CreateGdiCompatibleTextLayoutFunc == null)
            {
                m_CreateGdiCompatibleTextLayoutFunc = (CreateGdiCompatibleTextLayoutFunc)Marshal.GetDelegateForFunctionPointer(fp, typeof(CreateGdiCompatibleTextLayoutFunc));
            }
            textLayout = new IDWriteTextLayout();
            return(m_CreateGdiCompatibleTextLayoutFunc(m_ptr, ref _string, stringLength, textFormat != null ? textFormat.Ptr : IntPtr.Zero, layoutWidth, layoutHeight, pixelsPerDip, ref transform, useGdiNatural, out textLayout.PtrForNew));
        }