Пример #1
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));
        }
Пример #2
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));
        }
Пример #3
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));
        }