* * *

Author Topic: [solved] Projects in C:\lazarus\examples - motiongraphics  (Read 146 times)

PeterX

  • Full Member
  • ***
  • Posts: 208
[solved] Projects in C:\lazarus\examples - motiongraphics
« on: May 12, 2017, 12:31:06 pm »
This is not a bugfix - simply makes it look better, to me ..

- on resizing the window ! -


Quote
procedure TForm1.FormPaint(Sender: TObject);
var
  lPoints: array[0..2] of TPoint;
begin
  lPoints[0].X := Self.Width  div 4;
  lPoints[0].Y := Self.Height div 4;
  lPoints[1].X := Self.Width  div 2;
  lPoints[1].Y := 0;
  lPoints[2].X := Self.Width  div 2;
  lPoints[2].Y := Self.Height div 2;
  ...


with additionally ..
Quote
function TForm1.RotatePoint(APoint, ACenter: TPoint; AAngle: Double): TPoint;
var
  dx, dy: Double;
begin
  dx := (ACenter.Y * Sin(AAngle)) - (ACenter.X * Cos(AAngle)) + ACenter.X +10;
  dy := -(ACenter.X * Sin(AAngle)) - (ACenter.Y * Cos(AAngle)) + ACenter.Y +Self.Height div 4;
  ...
« Last Edit: May 15, 2017, 02:02:20 pm by PeterX »
usually using latest Lazarus release version
with Windows 10 at home
and Windows 7 on the job

wp

  • Hero Member
  • *****
  • Posts: 3512
Re: Projects in C:\lazarus\examples - motiongraphics
« Reply #1 on: May 12, 2017, 12:48:25 pm »
Done in r54877, together with a little refactoring to avoid multiple calculation of sin(AAngle) and cos(AAngle).
Lazarus trunk / fpc 3.0.0 / Win32

 

Recent

Get Lazarus at SourceForge.net. Fast, secure and Free Open Source software downloads Open Hub project report for Lazarus