procedure RotateRect(const rec: TRect; angleRads: single; eraseColor: TColor32 = clNone32);
Rotates part of an image, but also clips those parts of the rotated image that fall outside rec. The 'eraseColor' parameter indicates the color to back fill the rotated corners.
uses Img32, Img32.Fmt.PNG; ... var img: TImage32; rec: TRect; begin img := TImage32.Create; img.LoadFromFile('fruit.png'); rec := img.Bounds; Windows.InflateRect(rec, -20,-20); img.RotateRect(rec, angle45); img.SaveToFile('fruit_rotrect45.png'); img.Free; end;
Copyright ©2010-2023 Angus Johnson - Image32 4.8 - Help file built on 17 Jan 2025