This method return the color defined by the current position of the cursor.
Syntax
unsigned long Read(
void
) ;
Parameters
This method does not have a parameter.
Return value
return the color defined by the current position of the cursor. The color is a 32 bit integer with 8 bits for the red, green and blue components of the color.
Remarks
The value of "Cur_Value" variable is not updated automatically, when the user drag the mouse over the slider, you need to call "Read" and assign the returned value to the "Cur_Value" variable and then call "Adjust" for the graphic to reflect the new value.
Requirements
Header:
TomoVision_Util.hpp
TomoVision_Tools.hpp
Library:
TomoVision_Util.lib
TomoVision_Tools.lib
Example
|
static Color_Edit demo ;
extern "C" __declspec(dllexport) int Ctrl_Click( HWND wnd, int up_down, short x, short y )
{
// --- We only refresh the image when we release the button ---
if ( ! up_down ) {
return( 0 ) ;
}
// ------------------------------------------------
// We received a mouse click, now we try to find in
// which tool the click was. For this we use the
// "select" method.
// ------------------------------------------------
if ( demo.Select( up_down ) ) {
demo.Cur_Value = demo.Read() ;
demo.Adjust() ;
unsigned char red = RED_BYTE(demo.Cur_Value) ;
unsigned char grn = GRN_BYTE(demo.Cur_Value) ;
unsigned char blu = BLU_BYTE(demo.Cur_Value) ;
Error_Fct( hwnd, ERROR_CODE_REPORT, "Click in color edit, color= R:%d G:%d B:%d", red, grn, blu) ;
return( 1 ) ;
}
return( 0 ) ;
}
|
|
See also