Visual Basic |
---|
Public Sub CopyPixelBuffer( _ ByVal Address As Long, _ ByVal Frame As Integer, _ ByVal RowStep As Long, _ ByVal ColumnStep As Long _ ) |
This function is primarily used to load data from an external frame buffer such as that produced by a video-grabber, into the pixel buffer, which should be allocated using AllocatePixelSpace if not already allocated by other means.
An entire frame is loaded in one call, using values from the DicomImage’s Attributes to determine the following parameters:
The height and width of the image (0028,0011) & (0028 & 0010)
The bit depth - currently only 8 or 16 bits allocated are supported (0028,0100)
The number of samples per pixel (0028,0002)
When capturing from devices that use top to bottom row ordering, RowStep may be negative, in which case Address should be increased appropriately so that it still points to the first pixel of the lowest row.
If samples per pixel is 3, then bits allocated must be 8. In this case it is assumed that the data is being copied from a Windows compatible bitmap ordered as BGR, and the bytes are swapped appropriately to produce the RGB ordering needed for DICOM.