function SplineHorzTransform(img: TImage32; const leftSpline: TPathD; splineType: TSplineType; backColor: TColor32; reverseFill: Boolean; out offset: TPoint): Boolean;

Deforms an image in the horizontal plane. 'leftSpline' control points (either FlattenQSpline or FlattenCSpline points) define the left (curved) edge of the transformed image.

'backColor' and 'reverseFill' are only meaningful when the splines induce image overlap (see SplineVertTransform for an example). Normal rendering is from top to bottom unless reverseFill = true, in which case rendering will be from bottom to top. If 'backColor' = clNone32, then the image will be rendered on 'back' regions as if the image is double sided, otherwise 'back' regions will be filled with 'backColor'.

The returned 'offset', is the offset of the top-left corner of the transformed (and resized) image (using the same axes as the spline coordinates) so that the transformed image can easily be aligned with the supplied control points.

  uses Img32, Img32.Fmt.PNG, Img32.Transform;
  leftPath: TPathD;
  pt: TPoint;
  img := TImage32.Create;
  leftPath := MakePathI([402,2, 336,44, 495,122, 402,174]);
  SplineHorzTransform(img, leftPath, stCubic, clNone32, false, pt);

See Also

Img32.Layers, SplineVertTransform, FlattenCSpline, FlattenQSpline, TSplineType