示例#1
0
        public virtual int Resize(
            ref D2D_SIZE_U pixelSize
            )
        {
            var fp = GetFunctionPointer(58);

            if (m_ResizeFunc == null)
            {
                m_ResizeFunc = (ResizeFunc)Marshal.GetDelegateForFunctionPointer(fp, typeof(ResizeFunc));
            }

            return(m_ResizeFunc(m_ptr, ref pixelSize));
        }
示例#2
0
        public virtual int CreateBitmap(
            D2D_SIZE_U size,
            IntPtr sourceData,
            uint pitch,
            ref D2D1_BITMAP_PROPERTIES1 bitmapProperties,
            out ID2D1Bitmap1 bitmap
            )
        {
            var fp = GetFunctionPointer(57);

            if (m_CreateBitmapFunc == null)
            {
                m_CreateBitmapFunc = (CreateBitmapFunc)Marshal.GetDelegateForFunctionPointer(fp, typeof(CreateBitmapFunc));
            }
            bitmap = new ID2D1Bitmap1();
            return(m_CreateBitmapFunc(m_ptr, size, sourceData, pitch, ref bitmapProperties, out bitmap.PtrForNew));
        }
示例#3
0
        public virtual int CreateCompatibleRenderTarget(
            ref D2D_SIZE_F desiredSize,
            ref D2D_SIZE_U desiredPixelSize,
            ref D2D1_PIXEL_FORMAT desiredFormat,
            D2D1_COMPATIBLE_RENDER_TARGET_OPTIONS options,
            out ID2D1BitmapRenderTarget bitmapRenderTarget
            )
        {
            var fp = GetFunctionPointer(12);

            if (m_CreateCompatibleRenderTargetFunc == null)
            {
                m_CreateCompatibleRenderTargetFunc = (CreateCompatibleRenderTargetFunc)Marshal.GetDelegateForFunctionPointer(fp, typeof(CreateCompatibleRenderTargetFunc));
            }
            bitmapRenderTarget = new ID2D1BitmapRenderTarget();
            return(m_CreateCompatibleRenderTargetFunc(m_ptr, ref desiredSize, ref desiredPixelSize, ref desiredFormat, options, out bitmapRenderTarget.PtrForNew));
        }