Ejemplo n.º 1
1
        public virtual int DrawBitmap(
            ID2D1Bitmap bitmap,
            ref System.Numerics.Vector4 destinationRectangle,
            float opacity,
            D2D1_INTERPOLATION_MODE interpolationMode,
            ref System.Numerics.Vector4 sourceRectangle,
            ref D2D_MATRIX_4X4_F perspectiveTransform
            )
        {
            var fp = GetFunctionPointer(17);

            if (m_DrawBitmapFunc == null)
            {
                m_DrawBitmapFunc = (DrawBitmapFunc)Marshal.GetDelegateForFunctionPointer(fp, typeof(DrawBitmapFunc));
            }

            return(m_DrawBitmapFunc(m_ptr, bitmap != null ? bitmap.Ptr : IntPtr.Zero, ref destinationRectangle, opacity, interpolationMode, ref sourceRectangle, ref perspectiveTransform));
        }
Ejemplo n.º 2
0
        public virtual void SetBitmap(
            ID2D1Bitmap bitmap
            )
        {
            var fp = GetFunctionPointer(11);

            if (m_SetBitmapFunc == null)
            {
                m_SetBitmapFunc = (SetBitmapFunc)Marshal.GetDelegateForFunctionPointer(fp, typeof(SetBitmapFunc));
            }

            m_SetBitmapFunc(m_ptr, bitmap != null ? bitmap.Ptr : IntPtr.Zero);
        }
Ejemplo n.º 3
0
        public virtual void GetBitmap(
            out ID2D1Bitmap bitmap
            )
        {
            var fp = GetFunctionPointer(15);

            if (m_GetBitmapFunc == null)
            {
                m_GetBitmapFunc = (GetBitmapFunc)Marshal.GetDelegateForFunctionPointer(fp, typeof(GetBitmapFunc));
            }
            bitmap = new ID2D1Bitmap();
            m_GetBitmapFunc(m_ptr, out bitmap.PtrForNew);
        }
Ejemplo n.º 4
0
        public virtual int CopyFromBitmap(
            ref D2D_POINT_2U destPoint,
            ID2D1Bitmap bitmap,
            ref D2D_RECT_U srcRect
            )
        {
            var fp = GetFunctionPointer(8);

            if (m_CopyFromBitmapFunc == null)
            {
                m_CopyFromBitmapFunc = (CopyFromBitmapFunc)Marshal.GetDelegateForFunctionPointer(fp, typeof(CopyFromBitmapFunc));
            }

            return(m_CopyFromBitmapFunc(m_ptr, ref destPoint, bitmap != null ? bitmap.Ptr : IntPtr.Zero, ref srcRect));
        }
Ejemplo n.º 5
0
        public virtual int CreateBitmapFromWicBitmap(
            IWICBitmapSource wicBitmapSource,
            ref D2D1_BITMAP_PROPERTIES bitmapProperties,
            out ID2D1Bitmap bitmap
            )
        {
            var fp = GetFunctionPointer(5);

            if (m_CreateBitmapFromWicBitmapFunc == null)
            {
                m_CreateBitmapFromWicBitmapFunc = (CreateBitmapFromWicBitmapFunc)Marshal.GetDelegateForFunctionPointer(fp, typeof(CreateBitmapFromWicBitmapFunc));
            }
            bitmap = new ID2D1Bitmap();
            return(m_CreateBitmapFromWicBitmapFunc(m_ptr, wicBitmapSource != null ? wicBitmapSource.Ptr : IntPtr.Zero, ref bitmapProperties, out bitmap.PtrForNew));
        }
Ejemplo n.º 6
0
        public virtual void FillOpacityMask(
            ID2D1Bitmap opacityMask,
            ID2D1Brush brush,
            ref System.Numerics.Vector4 destinationRectangle,
            ref System.Numerics.Vector4 sourceRectangle
            )
        {
            var fp = GetFunctionPointer(91);

            if (m_FillOpacityMaskFunc == null)
            {
                m_FillOpacityMaskFunc = (FillOpacityMaskFunc)Marshal.GetDelegateForFunctionPointer(fp, typeof(FillOpacityMaskFunc));
            }

            m_FillOpacityMaskFunc(m_ptr, opacityMask != null ? opacityMask.Ptr : IntPtr.Zero, brush != null ? brush.Ptr : IntPtr.Zero, ref destinationRectangle, ref sourceRectangle);
        }
Ejemplo n.º 7
0
        public virtual int CreateBitmapBrush(
            ID2D1Bitmap bitmap,
            ref D2D1_BITMAP_BRUSH_PROPERTIES1 bitmapBrushProperties,
            ref D2D1_BRUSH_PROPERTIES brushProperties,
            out ID2D1BitmapBrush1 bitmapBrush
            )
        {
            var fp = GetFunctionPointer(66);

            if (m_CreateBitmapBrushFunc == null)
            {
                m_CreateBitmapBrushFunc = (CreateBitmapBrushFunc)Marshal.GetDelegateForFunctionPointer(fp, typeof(CreateBitmapBrushFunc));
            }
            bitmapBrush = new ID2D1BitmapBrush1();
            return(m_CreateBitmapBrushFunc(m_ptr, bitmap != null ? bitmap.Ptr : IntPtr.Zero, ref bitmapBrushProperties, ref brushProperties, out bitmapBrush.PtrForNew));
        }
Ejemplo n.º 8
0
        public virtual int CreateSharedBitmap(
            ref Guid riid,
            IntPtr data,
            ref D2D1_BITMAP_PROPERTIES bitmapProperties,
            out ID2D1Bitmap bitmap
            )
        {
            var fp = GetFunctionPointer(6);

            if (m_CreateSharedBitmapFunc == null)
            {
                m_CreateSharedBitmapFunc = (CreateSharedBitmapFunc)Marshal.GetDelegateForFunctionPointer(fp, typeof(CreateSharedBitmapFunc));
            }
            bitmap = new ID2D1Bitmap();
            return(m_CreateSharedBitmapFunc(m_ptr, ref riid, data, ref bitmapProperties, out bitmap.PtrForNew));
        }
Ejemplo n.º 9
0
        public virtual void DrawBitmap(
            ID2D1Bitmap bitmap,
            ref System.Numerics.Vector4 destinationRectangle,
            float opacity,
            D2D1_BITMAP_INTERPOLATION_MODE interpolationMode,
            ref System.Numerics.Vector4 sourceRectangle
            )
        {
            var fp = GetFunctionPointer(26);

            if (m_DrawBitmapFunc == null)
            {
                m_DrawBitmapFunc = (DrawBitmapFunc)Marshal.GetDelegateForFunctionPointer(fp, typeof(DrawBitmapFunc));
            }

            m_DrawBitmapFunc(m_ptr, bitmap != null ? bitmap.Ptr : IntPtr.Zero, ref destinationRectangle, opacity, interpolationMode, ref sourceRectangle);
        }
Ejemplo n.º 10
0
        public virtual int CreateBitmap(
            D2D_SIZE_U size,
            IntPtr srcData,
            uint pitch,
            ref D2D1_BITMAP_PROPERTIES bitmapProperties,
            out ID2D1Bitmap bitmap
            )
        {
            var fp = GetFunctionPointer(4);

            if (m_CreateBitmapFunc == null)
            {
                m_CreateBitmapFunc = (CreateBitmapFunc)Marshal.GetDelegateForFunctionPointer(fp, typeof(CreateBitmapFunc));
            }
            bitmap = new ID2D1Bitmap();
            return(m_CreateBitmapFunc(m_ptr, size, srcData, pitch, ref bitmapProperties, out bitmap.PtrForNew));
        }