Пример #1
0
        public virtual void SetInterpolationMode(
            D2D1_BITMAP_INTERPOLATION_MODE interpolationMode
            )
        {
            var fp = GetFunctionPointer(10);

            if (m_SetInterpolationModeFunc == null)
            {
                m_SetInterpolationModeFunc = (SetInterpolationModeFunc)Marshal.GetDelegateForFunctionPointer(fp, typeof(SetInterpolationModeFunc));
            }

            m_SetInterpolationModeFunc(m_ptr, interpolationMode);
        }
Пример #2
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);
        }
Пример #3
0
        public static void DrawBitmap(this ID2D1RenderTarget renderTarget,
                                      ID2D1Bitmap bitmap,
                                      float opacity = 1,
                                      D2D1_BITMAP_INTERPOLATION_MODE interpolationMode = D2D1_BITMAP_INTERPOLATION_MODE.D2D1_BITMAP_INTERPOLATION_MODE_NEAREST_NEIGHBOR,
                                      D2D_RECT_F?destinationRectangle = null,
                                      D2D_RECT_F?sourceRectangle      = null)
        {
            if (renderTarget == null)
            {
                throw new ArgumentNullException(nameof(renderTarget));
            }

            using (var drc = destinationRectangle.StructureToMemory())
            {
                using (var src = sourceRectangle.StructureToMemory())
                {
                    renderTarget.DrawBitmap(bitmap, drc.Pointer, opacity, interpolationMode, src.Pointer);
                }
            }
        }
        public static void DrawBitmap(this ID2D1DeviceContext device,
                                      ID2D1Bitmap bitmap,
                                      float opacity,
                                      D2D1_BITMAP_INTERPOLATION_MODE interpolationMode,
                                      D2D_RECT_F?destinationRectangle = null,
                                      D2D_RECT_F?sourceRectangle      = null)
        {
            if (device == null)
            {
                throw new ArgumentNullException(nameof(device));
            }

            using (var drc = destinationRectangle.StructureToMemory())
            {
                using (var src = sourceRectangle.StructureToMemory())
                {
                    device.DrawBitmap(bitmap, drc.Pointer, opacity, interpolationMode, src.Pointer);
                }
            }
        }
        public static void DrawBitmap(this ID2D1DeviceContext device,
                                      ID2D1Bitmap bitmap,
                                      float opacity,
                                      D2D1_BITMAP_INTERPOLATION_MODE interpolationMode,
                                      D2D_RECT_F?destinationRectangle = null,
                                      D2D_RECT_F?sourceRectangle      = null)
        {
            if (device == null)
            {
                throw new ArgumentNullException(nameof(device));
            }

            using (var drc = destinationRectangle.StructureToMemory())
            {
                using (var src = sourceRectangle.StructureToMemory())
                {
#pragma warning disable CA2010 // Always consume the value returned by methods marked with PreserveSigAttribute
                    device.DrawBitmap(bitmap, drc.Pointer, opacity, interpolationMode, src.Pointer);
#pragma warning restore CA2010 // Always consume the value returned by methods marked with PreserveSigAttribute
                }
            }
        }
 public void DrawBitmap([NativeTypeName("ID2D1Bitmap *")] ID2D1Bitmap *bitmap, [NativeTypeName("const D2D1_RECT_F *")] D2D_RECT_F *destinationRectangle = null, [NativeTypeName("FLOAT")] float opacity = 1.0f, D2D1_BITMAP_INTERPOLATION_MODE interpolationMode = D2D1_BITMAP_INTERPOLATION_MODE_LINEAR, [NativeTypeName("const D2D1_RECT_F *")] D2D_RECT_F *sourceRectangle = null)
 {
     ((delegate * stdcall <ID2D1BitmapRenderTarget *, ID2D1Bitmap *, D2D_RECT_F *, float, D2D1_BITMAP_INTERPOLATION_MODE, D2D_RECT_F *, void>)(lpVtbl[26]))((ID2D1BitmapRenderTarget *)Unsafe.AsPointer(ref this), bitmap, destinationRectangle, opacity, interpolationMode, sourceRectangle);
 }
 public HRESULT DrawSpriteBatch(ID2D1SpriteBatch *spriteBatch, [NativeTypeName("UINT32")] uint startIndex, [NativeTypeName("UINT32")] uint spriteCount, ID2D1Bitmap *bitmap, D2D1_BITMAP_INTERPOLATION_MODE interpolationMode, D2D1_SPRITE_OPTIONS spriteOptions)
 {
     return(((delegate * unmanaged <ID2D1CommandSink4 *, ID2D1SpriteBatch *, uint, uint, ID2D1Bitmap *, D2D1_BITMAP_INTERPOLATION_MODE, D2D1_SPRITE_OPTIONS, int>)(lpVtbl[32]))((ID2D1CommandSink4 *)Unsafe.AsPointer(ref this), spriteBatch, startIndex, spriteCount, bitmap, interpolationMode, spriteOptions));
 }
Пример #8
0
 public void SetInterpolationMode(D2D1_BITMAP_INTERPOLATION_MODE interpolationMode)
 {
     ((delegate * unmanaged <ID2D1BitmapBrush *, D2D1_BITMAP_INTERPOLATION_MODE, void>)(lpVtbl[10]))((ID2D1BitmapBrush *)Unsafe.AsPointer(ref this), interpolationMode);
 }
Пример #9
0
 public static void DrawBitmap(this IComObject <ID2D1RenderTarget> renderTarget,
                               IComObject <ID2D1Bitmap> bitmap,
                               float opacity = 1,
                               D2D1_BITMAP_INTERPOLATION_MODE interpolationMode = D2D1_BITMAP_INTERPOLATION_MODE.D2D1_BITMAP_INTERPOLATION_MODE_NEAREST_NEIGHBOR,
                               D2D_RECT_F?destinationRectangle = null,
                               D2D_RECT_F?sourceRectangle      = null) => DrawBitmap(renderTarget?.Object, bitmap?.Object, opacity, interpolationMode, destinationRectangle, sourceRectangle);
 public static void DrawBitmap(this ComObject <ID2D1DeviceContext> device,
                               ComObject <ID2D1Bitmap> bitmap,
                               float opacity,
                               D2D1_BITMAP_INTERPOLATION_MODE interpolationMode,
                               D2D_RECT_F?destinationRectangle = null,
                               D2D_RECT_F?sourceRectangle      = null) => DrawBitmap(device?.Object, bitmap?.Object, opacity, interpolationMode, destinationRectangle, sourceRectangle);
Пример #11
0
 public D2D1_BITMAP_BRUSH_PROPERTIES(D2D1_EXTEND_MODE extendModeX = D2D1_EXTEND_MODE_CLAMP, D2D1_EXTEND_MODE extendModeY = D2D1_EXTEND_MODE_CLAMP, D2D1_BITMAP_INTERPOLATION_MODE interpolationMode = D2D1_BITMAP_INTERPOLATION_MODE_LINEAR)
 {
     this = BitmapBrushProperties(extendModeX, extendModeY, interpolationMode);
 }