private byte[] GetImageBytesFromRanger( RangerSides side )
{
RangerImageColorTypes colorType = RockConfig.Load().ImageColorType;
int imageByteCount;
imageByteCount = batchPage.rangerScanner.GetImageByteCount( (int)side, (int)colorType );
if ( imageByteCount > 0 )
{
byte[] imageBytes = new byte[imageByteCount];
// create the pointer and assign the Ranger image address to it
IntPtr imgAddress = new IntPtr( batchPage.rangerScanner.GetImageAddress( (int)side, (int)colorType ) );
// Copy the bytes from unmanaged memory to managed memory
Marshal.Copy( imgAddress, imageBytes, 0, imageByteCount );
return imageBytes;
}
else
{
return null;
}
}