ImageEn, unit iexBitmaps

TIEBitmap.BlackValue

TIEBitmap.BlackValue


Declaration

property BlackValue: double;


Description

Specifies (along with WhiteValue) the value range from black to white.

For example, if your image is a gray scale (256 levels) where only values from 100 to 200 are used (100 is black and 200 is white), to display the image you must write:

ImageEnView.IEBitmap.BlackValue := 100;
ImageEnView.IEBitmap.WhiteValue := 200;
ImageEnView.Update;


Valid ranges will depend on the format, e.g.
ie8g, ie24RGB: 0 - 255
ie16g: 0 - 65536
ie32f: 0.0 - 1.0

Notes:
- To permanently apply the range to the image, use StretchValues
- Set both BlackValue and WhiteValue to 0 to disable stretching

Default: 0


Demos

Demo  Demos\Display\DisplayAdjust\Display.dpr
Demo  Demos\InputOutput\DicomRange\Dicom.dpr


Examples

// Calculate Window Center and Width
WindowWidth := Round( ImageEnView1.IEBitmap.WhiteValue - ImageEnView1.IEBitmap.BlackValue + 1 );
WindowCenter := Round( ImageEnView1.IEBitmap.BlackValue + 0.5 + ( ImageEnView1.IEBitmap.WhiteValue - ImageEnView1.IEBitmap.BlackValue ) / 2 );
Caption := 'WindowWidth: ' + IntToStr( WindowWidth ) + ' - WindowCenter: ' + IntToStr( WindowCenter );

// Set black and white values based on Window Center and Width
ImageEnView1.IEBitmap.BlackValue := WindowCenter - 0.5 - ( WindowWidth - 1) / 2;
ImageEnView1.IEBitmap.WhiteValue := WindowCenter - 0.5 + ( WindowWidth - 1) / 2;