Recent

Author Topic: A bug ?  (Read 2432 times)

BubikolRamios

  • Sr. Member
  • ****
  • Posts: 350
A bug ?
« on: January 04, 2025, 04:24:22 pm »
See last two lines of code, first says expected tPoint got Trect ..., does not want to compile
The second works fine.
Code: Pascal  [Select][+][-]
  1.  
  2. procedure TForm1.Button24Click(Sender: TObject);
  3. var
  4.    Bitmap: Tbitmap;
  5.    image: TBGRABitmap;
  6.    Source: TRect;
  7.    Dest: TRect;
  8. begin
  9.  
  10.   Bitmap := TBitmap.Create;
  11.  
  12.  
  13.   try
  14.     with Bitmap do
  15.     begin
  16.       Width := PaintBox1.Width;
  17.       Height := PaintBox1.Height;
  18.       Dest := Rect(0, 0, Width, Height);
  19.     end;
  20.     with PaintBox1 do
  21.       Source := Rect(0, 0, Width, Height);
  22.  
  23.       Bitmap.Canvas.CopyRect(Dest, PaintBox1.Canvas, Source);
  24.  
  25.       image := image.FilterTwirl(Dest,round(Height/2));
  26.       image := image.FilterTwirl(Rect(0,0,Width,Height),Point(round(Width/2),round(Height/2)),round(Height/2));            
  27.  
« Last Edit: January 04, 2025, 04:26:14 pm by BubikolRamios »
lazarus 3.2-fpc-3.2.2-win32/win64

Remy Lebeau

  • Hero Member
  • *****
  • Posts: 1501
    • Lebeau Software
Re: A bug ?
« Reply #1 on: January 05, 2025, 05:25:45 am »
The bug is yours. The 1st line does not match either of the available overloads of FilterTwirl(). But the 2nd line matches the 2nd overload.

Code: [Select]
function FilterTwirl(ACenter: TPoint; ARadius: Single; ATurn: Single=1; AExponent: Single=3; ACopyProperties: Boolean=False): TBGRACustomBitmap; overload; virtual; abstract;
function FilterTwirl(ABounds: TRect; ACenter: TPoint; ARadius: Single; ATurn: Single=1; AExponent: Single=3; ACopyProperties: Boolean=False): TBGRACustomBitmap; overload; virtual; abstract;
« Last Edit: January 05, 2025, 05:29:34 am by Remy Lebeau »
Remy Lebeau
Lebeau Software - Owner, Developer
Internet Direct (Indy) - Admin, Developer (Support forum)

 

TinyPortal © 2005-2018