Document Solutions for PDF
DS.Documents.DX.Windows Assembly / GrapeCity.Documents.DX.Direct2D Namespace / Bitmap Class / CopyFromStream Method / CopyFromStream(Stream,Int32,Int32,RectL) Method
The stream to copy the data from.
The stride, or pitch, of the source bitmap stored in srcData. The stride is the byte count of a scanline (one row of pixels in memory). The stride can be computed from the following formula: pixel width * bytes per pixel + memory padding.
Length in bytes of the data to copy from the stream.
In the current bitmap, the upper-left corner of the area to which the region specified by srcRect is copied.

In This Topic
    CopyFromStream(Stream,Int32,Int32,RectL) Method
    In This Topic
    Copies the specified region from a stream into the current bitmap.
    Syntax
    'Declaration
     
    Public Overloads Sub CopyFromStream( _
       ByVal stream As System.IO.Stream, _
       ByVal pitch As System.Integer, _
       ByVal length As System.Integer, _
       ByVal destinationArea As RectL _
    ) 
    public void CopyFromStream( 
       System.IO.Stream stream,
       System.int pitch,
       System.int length,
       RectL destinationArea
    )

    Parameters

    stream
    The stream to copy the data from.
    pitch
    The stride, or pitch, of the source bitmap stored in srcData. The stride is the byte count of a scanline (one row of pixels in memory). The stride can be computed from the following formula: pixel width * bytes per pixel + memory padding.
    length
    Length in bytes of the data to copy from the stream.
    destinationArea
    In the current bitmap, the upper-left corner of the area to which the region specified by srcRect is copied.

    Return Value

    If the method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.
    Remarks
    This method does not update the size of the current bitmap. If the contents of the source bitmap do not fit in the current bitmap, this method fails. Also, note that this method does not perform format conversion; the two bitmap formats should match. Passing this method invalid input, such as an invalid destination rectangle, can produce unpredictable results, such as a distorted image or device failure. Calling this method may cause the current batch to flush if the bitmap is active in the batch. If the batch that was flushed does not complete successfully, this method fails. However, this method does not clear the error state of the render target on which the batch was flushed. The failing System.Int32 and tag state will be returned at the next call to {{EndDraw}} or {{Flush}}.
    See Also