LVectorBase::SetAmbientColor

#include "ltwrappr.h"

virtual L_INT LVectorBase::SetAmbientColor(color)

L_COLOR color;

/* the new ambient color */

Sets the ambient (room) light used when drawing a vector image.

Parameter

Description

color

The RGB value of the ambient light to set.

Returns

SUCCESS

The function was successful.

< 1

An error occurred. Refer to Return Codes.

Comments

This function will only be effective if the use of lights has been enabled using LVectorBase::SetUseLights.

The default ambient light is white (RGB(255, 255, 255)).

This function has no effect in the GDI engine.

Required DLLs and Libraries

LVKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions:

LVectorBase::GetAmbientColor, LVectorBase::SetUseLights, LVectorBase::GetUseLights, LVectorBase::SetEngine

Topics:

Viewing a Vector Images

 

Vector Images: Viewing a Vector Image

Example

void Example30(LVectorBase &Vector)
{
   L_COLOR  OldColor;   // Current ambient light 
   L_COLOR  NewColor;   // New ambient light 

   //Get current ambient light
   L_INT nRet = Vector.GetAmbientColor(&OldColor);

   //Increase the color, wrapping around if greater than 255
   NewColor = RGB( (GetRValue( OldColor ) + 10) % 255, 
                   (GetGValue( OldColor ) + 10) % 255, 
                   (GetBValue( OldColor ) + 10) % 255  );

   //Set new ambient color 
   Vector.SetAmbientColor(NewColor );
}