Fct_Change_Scale

 

This function change the scaling factor for all the selected frames.

 

 

Syntax

 

void  Fct_Change_Scale(

          SliceO_Window *window,

          float value,

          float factor

) ;

 

 

Parameters

 

window

Pointer to the currently selected window.

 

value

If not zero, this value will be the next scaling factor.

 

factor

If not zero, this factor will be multiplied to the current scaling factor to obtain the next scaling factor.

 

 

Return value

 

This function does not return a value.

 

 

Remarks

 

The new scaling factor is compute with:

if ( value )

                    scale = value ;

          if ( factor )

                    scale *= factor ;

 

 

Requirements

 

Header:

          sliceO_include.hpp

 

 

Library:

          sliceO_Structures.lib

 

 

Example

 

from frame_ctrl.cpp

          ...

 

          if ( but_scale_plus.Select( up_down ) ) {

                    but_scale_plus.Cur_Value = 1 ;

                    but_scale_plus.Adjust() ;

 

                    // --- we need the current window ---

                    SliceO_Window *Window_Cur = (SliceO_Window *) Fct_Variable_Value( "$WINDOW_CUR" ) ;

                    if ( Window_Cur )

                              Fct_Change_Scale( Window_Cur, 0.0f, 1.5f ) ;

 

                    but_scale_plus.Cur_Value = 0 ;

                    but_scale_plus.Adjust() ;

          }

 

          if ( but_scale_one.Select( up_down ) ) {

                    but_scale_one.Cur_Value = 1 ;

                    but_scale_one.Adjust() ;

 

                    // --- we need the current window ---

                    SliceO_Window *Window_Cur = (SliceO_Window *) Fct_Variable_Value( "$WINDOW_CUR" ) ;

                    if ( Window_Cur )

                              Fct_Change_Scale( Window_Cur, 1.0f, 0.0f ) ;

 

                    but_scale_one.Cur_Value = 0 ;

                    but_scale_one.Adjust() ;

          }

 

          if ( but_scale_minus.Select( up_down ) ) {

                    but_scale_minus.Cur_Value = 1 ;

                    but_scale_minus.Adjust() ;

 

                    // --- we need the current window ---

                    SliceO_Window *Window_Cur = (SliceO_Window *) Fct_Variable_Value( "$WINDOW_CUR" ) ;

                    if ( Window_Cur )

                              Fct_Change_Scale( Window_Cur, 0.0f, 2.0f/3.0f ) ;

 

                    but_scale_minus.Cur_Value = 0 ;

                    but_scale_minus.Adjust() ;

          }

 

          ...

 

See also