/// <summary>
 /// Copies pixel data using the supplied input parameters.
 /// </summary>
 /// <param name="rectangle">The rectangle.</param>
 /// <param name="width">The width.</param>
 /// <param name="height">The height.</param>
 /// <param name="guidDstFormat">The GUID DST format.</param>
 /// <param name="dstTransform">The DST transform.</param>
 /// <param name="stride">The stride.</param>
 /// <param name="output">The output.</param>
 /// <returns></returns>
 /// <unmanaged>HRESULT IWICBitmapSourceTransform::CopyPixels([In, Optional] const WICRect* prc,[In] unsigned int uiWidth,[In] unsigned int uiHeight,[In, Optional] GUID* pguidDstFormat,[In] WICBitmapTransformOptions dstTransform,[In] unsigned int nStride,[In] unsigned int cbBufferSize,[In] void* pbBuffer)</unmanaged>
 public unsafe void CopyPixels(RawBox rectangle, int width, int height, System.Guid guidDstFormat, SharpDX.WIC.BitmapTransformOptions dstTransform, int stride, DataStream output)
 {
     CopyPixels(new IntPtr(&rectangle), width, height, guidDstFormat, dstTransform, stride, (int)(output.Length - output.Position),
                output.PositionPointer);
 }
示例#2
0
 /// <summary>	
 /// <p>[This documentation is preliminary and is subject to change.]</p><p>Requests pixel data as it is natively stored within the DDS file.</p>	
 /// </summary>	
 /// <param name="boundsInBlocks"><dd>  <p>The rectangle to copy from the source. A <c>null</c> value specifies the entire texture.</p> <p>If the texture uses a block-compressed <strong><see cref="SharpDX.DXGI.Format"/></strong>, all values of the rectangle are expressed in number of blocks, not pixels.</p> </dd></param>	
 /// <param name="stride"><dd>  <p>The stride, in bytes, of the destination buffer. This represents the number of bytes from the buffer reference to the next row of data. If the texture uses a block-compressed <strong><see cref="SharpDX.DXGI.Format"/></strong>, a "row of data" is defined as a row of blocks which contains multiple pixel scanlines.</p> </dd></param>	
 /// <param name="destination"><dd>  <p>A reference to the destination buffer.</p> </dd></param>	
 /// <returns><p>If this method succeeds, it returns <strong><see cref="SharpDX.Result.Ok"/></strong>. Otherwise, it returns an <strong><see cref="SharpDX.Result"/></strong> error code.</p></returns>	
 /// <remarks>	
 /// <p>If the texture does not use a block-compressed <strong><see cref="SharpDX.DXGI.Format"/></strong>, this method behaves similarly to <strong><see cref="SharpDX.WIC.BitmapSource.CopyPixels"/></strong>. However, it does not perform any pixel format conversion, and instead produces the raw data from the DDS file.</p><p>If the texture uses a block-compressed <strong><see cref="SharpDX.DXGI.Format"/></strong>, this method copies the block data directly into the provided buffer. In this case, the <em>prcBoundsInBlocks</em> parameter is defined in blocks, not pixels. To determine if this is the case, call <strong>GetFormatInfo</strong> and read the <strong>DxgiFormat</strong> member of the returned <strong><see cref="SharpDX.WIC.DdsFormatInfo"/></strong> structure.	
 /// </p>	
 /// </remarks>	
 /// <include file='..\Documentation\CodeComments.xml' path="/comments/comment[@id='IWICDdsFrameDecode::CopyBlocks']/*"/>	
 /// <msdn-id>dn302087</msdn-id>	
 /// <unmanaged>HRESULT IWICDdsFrameDecode::CopyBlocks([In, Optional] const WICRect* prcBoundsInBlocks,[In] unsigned int cbStride,[In] unsigned int cbBufferSize,[In] void* pbBuffer)</unmanaged>	
 /// <unmanaged-short>IWICDdsFrameDecode::CopyBlocks</unmanaged-short>	
 public void CopyBlocks(RawBox? boundsInBlocks, int stride, DataStream destination)
 {
     CopyBlocks(boundsInBlocks, stride, (int)(destination.Length - destination.Position), destination.PositionPointer);
 }
示例#3
0
 /// <summary>	
 /// <p>Initializes the bitmap clipper with the provided parameters.</p>	
 /// </summary>	
 /// <param name="sourceRef"><dd>  <p>he input bitmap source.</p> </dd></param>	
 /// <param name="rectangleRef"><dd>  <p>The rectangle of the bitmap source to clip.</p> </dd></param>	
 /// <returns><p>If this method succeeds, it returns <strong><see cref="SharpDX.Result.Ok"/></strong>. Otherwise, it returns an <strong><see cref="SharpDX.Result"/></strong> error code.</p></returns>	
 /// <msdn-id>ee719677</msdn-id>	
 /// <unmanaged>HRESULT IWICBitmapClipper::Initialize([In, Optional] IWICBitmapSource* pISource,[In] const WICRect* prc)</unmanaged>	
 /// <unmanaged-short>IWICBitmapClipper::Initialize</unmanaged-short>	
 public unsafe void Initialize(SharpDX.WIC.BitmapSource sourceRef, RawBox rectangleRef)
 {
     Initialize(sourceRef, new IntPtr(&rectangleRef));
 }