ImageGear for .NET
Working with Gradient Filling

Gradient filling properties are encapsulated in ImGearVectorGradient Class. Objects of this class are attached to ImGearVectorFilltype Class objects.

There are two types of gradient fillings: linear and radial. They are represented by ImGearVectorGradientLinear Class and ImGearVectorGradientRadial Class, respectively.

A linear gradient is defined by its start and end points. A radial gradient is defined by a start point and an outer circle. The start point should be located inside the outer circle, but not necessarily in its center. Coordinates of the gradient can be absolute or relative (to the bounding rectangle of the entity that uses the gradient).

The color of the gradient is defined by an array of stops. A stop comprises a pair of offset and color. Stop offsets are relative to gradient coordinates. 0.0 corresponds to the start point, 1.0 corresponds to the end points, in the case of a linear gradient, or to a point at the outer circle, in the case of radial gradient. If the first stop offset is greater than 0.0, or the last stop offset is less than 1.0, the gradient is expanded according to its SpreadMethod. Gradient color is linearly interpolated between the stops.

A gradient filling can be transformed with an affine matrix.  

 

 


©2014. Accusoft Corporation. All Rights Reserved.

Send Feedback