MatrixSkew

procedure MatrixSkew(var matrix: TMatrixD; dx, dy: double);


Adds an affine skew to the supplied matrix where dx represents the delta offset of an X coordinate as a fraction of its Y coordinate, and likewise for dy.

For example, if dx = 0.1, dy = 0 and the matrix is applied to the coordinate [20,15], then the transformed coordinate will become [20 + (15 * 0.1), 10] or [21.5, 10].


uses Image32, Image32_PNG, 
  Image32_Vector, Image32_Transform;
...
var
  img: TImage32;
  m: TMatrixD;
begin
  img := TImage32.Create;
  img.LoadFromFile('beetle.png');
    
  m := IdentityMatrix;
  //vertical skew
  MatrixSkew(m, 0,-0.5);
  //and rotate about the image center
  MatrixRotate(m, PointD(128,128), angle45);
  //apply the matrix to the image
  AffineTransformImage(img, m);

  img.SaveToFile('beetle_affine.png');
  img.Free;
end;