/// <summary> /// Creates a Direct2D bitmap from a pointer to in-memory source data. /// </summary> /// <param name="renderTarget">an instance of <see cref = "SharpDX.Direct2D1.RenderTarget" /></param> /// <param name="size">The dimension of the bitmap to create in pixels.</param> /// <param name="dataPointer">A pointer to the memory location of the image data, or NULL to create an uninitialized bitmap.</param> /// <param name="pitch">The byte count of each scanline, which is equal to (the image width in pixels * the number of bytes per pixel) + memory padding. If srcData is NULL, this value is ignored. (Note that pitch is also sometimes called stride.)</param> /// <param name="bitmapProperties">The pixel format and dots per inch (DPI) of the bitmap to create.</param> /// <msdn-id>dd371800</msdn-id> /// <unmanaged>HRESULT ID2D1RenderTarget::CreateBitmap([In] D2D_SIZE_U size,[In, Optional] const void* srcData,[In] unsigned int pitch,[In] const D2D1_BITMAP_PROPERTIES* bitmapProperties,[Out, Fast] ID2D1Bitmap** bitmap)</unmanaged> /// <unmanaged-short>ID2D1RenderTarget::CreateBitmap</unmanaged-short> public Bitmap(RenderTarget renderTarget, Size2 size, DataPointer dataPointer, int pitch, SharpDX.Direct2D1.BitmapProperties bitmapProperties) : base(IntPtr.Zero) { renderTarget.CreateBitmap(size, dataPointer == DataPointer.Zero ? IntPtr.Zero : dataPointer.Pointer, pitch, bitmapProperties, this); }