public void Resize(D2D1SizeU pixelSize) { this.renderTarget.Resize(ref pixelSize); }
public D2D1BitmapRenderTarget CreateCompatibleRenderTarget(D2D1SizeF desiredSize, D2D1SizeU desiredPixelSize, D2D1PixelFormat desiredFormat) { ID2D1BitmapRenderTarget bitmapRenderTarget; GCHandle desiredSizeHandle = GCHandle.Alloc(desiredSize, GCHandleType.Pinned); GCHandle desiredPixelSizeHandle = GCHandle.Alloc(desiredPixelSize, GCHandleType.Pinned); GCHandle desiredFormatHandle = GCHandle.Alloc(desiredFormat, GCHandleType.Pinned); try { this.GetHandle<ID2D1RenderTarget>().CreateCompatibleRenderTarget( desiredSizeHandle.AddrOfPinnedObject(), desiredPixelSizeHandle.AddrOfPinnedObject(), desiredFormatHandle.AddrOfPinnedObject(), D2D1CompatibleRenderTargetOptions.None, out bitmapRenderTarget); } finally { desiredSizeHandle.Free(); desiredPixelSizeHandle.Free(); desiredFormatHandle.Free(); } return new D2D1BitmapRenderTarget(bitmapRenderTarget); }
public D2D1Bitmap CreateBitmap(D2D1SizeU size, D2D1BitmapProperties bitmapProperties) { ID2D1Bitmap bitmap; this.GetHandle<ID2D1RenderTarget>().CreateBitmap(size, IntPtr.Zero, 0U, ref bitmapProperties, out bitmap); return new D2D1Bitmap(bitmap); }
public D2D1BitmapRenderTarget CreateCompatibleRenderTarget(D2D1SizeU desiredPixelSize, D2D1CompatibleRenderTargetOptions options) { ID2D1BitmapRenderTarget bitmapRenderTarget; GCHandle desiredPixelSizeHandle = GCHandle.Alloc(desiredPixelSize, GCHandleType.Pinned); try { this.GetHandle<ID2D1RenderTarget>().CreateCompatibleRenderTarget( IntPtr.Zero, desiredPixelSizeHandle.AddrOfPinnedObject(), IntPtr.Zero, options, out bitmapRenderTarget); } finally { desiredPixelSizeHandle.Free(); } return new D2D1BitmapRenderTarget(bitmapRenderTarget); }
public D2D1Bitmap CreateBitmap(D2D1SizeU size, IntPtr srcData, uint pitch, D2D1BitmapProperties bitmapProperties) { ID2D1Bitmap bitmap; this.GetHandle<ID2D1RenderTarget>().CreateBitmap(size, srcData, pitch, ref bitmapProperties, out bitmap); return new D2D1Bitmap(bitmap); }