Recent

Author Topic: [SOLVED] TBGRABitmap.FillRect overload problems  (Read 399 times)

indydev

  • Full Member
  • ***
  • Posts: 131
[SOLVED] TBGRABitmap.FillRect overload problems
« on: November 27, 2025, 07:45:12 pm »
I am trying to use the FillRect method here:

Code: Pascal  [Select][+][-]
  1. FBuffer.FillRect(FBricks[i].X, FBricks[i].Y,
  2.                        FBricks[i].X + FBricks[i].Width,
  3.                        FBricks[i].Y + FBricks[i].Height,
  4.                        FBricks[i].Color, dmSet, OPAQUE);

where FBuffer is defined FBuffer : TBGRABitmap; , const OPAQUE = 65535

and

FBuffer := TBGRABitmap.Create(BounceBox.Width, BounceBox.Height, BGRA(0, 0, 0, 255));


But I get these compiler messages. The signature is there, but not being picked up.

unit1.pas(242,55) Error: Incompatible type for arg no. 7: Got "Word", expected "TPoint"
unibitmap.inc(3171,34) Hint: Found declaration: FillRect(LongInt;LongInt;LongInt;LongInt;IBGRAScanner;TDrawMode;TPoint;Word=`65535`);
unibitmap.inc(3156,34) Hint: Found declaration: FillRect(LongInt;LongInt;LongInt;LongInt;IBGRAScanner;TDrawMode;Word=`65535`);
unibitmapgeneric.inc(94,15) Hint: Found declaration: FillRect(LongInt;LongInt;LongInt;LongInt;const TBGRAPixel;TDrawMode=`0`;Word=`65535`);
bgracustombitmap.inc(1407,29) Hint: Found declaration: FillRect(LongInt;LongInt;LongInt;LongInt;IBGRAScanner;TDrawMode;TDitheringAlgorithm);


Thanks for help with this.
« Last Edit: November 28, 2025, 01:46:19 am by indydev »

Lulu

  • Sr. Member
  • ****
  • Posts: 362
Re: TBGRABitmap.FillRect overload problems
« Reply #1 on: November 27, 2025, 09:14:03 pm »
Hi, I tried
Code: Pascal  [Select][+][-]
  1. var ima: TBGRABitmap;
  2.   const OPAQUE=65535;
  3. begin
  4.   ima.FillRect(1, 1, 10, 10, BGRA(200,200,200), dmSet, OPAQUE);
  5.  
and it compile.
Are you sure FBricks.X, .Y, .Width and .Height are integer ? FBricks[].Color is TBGRAPixel ?

Edit: the color field work also if it is a TColor
« Last Edit: November 27, 2025, 09:16:41 pm by Lulu »
wishing you a nice life!
GitHub repositories https://github.com/Lulu04

indydev

  • Full Member
  • ***
  • Posts: 131
[SOLVED] Re: TBGRABitmap.FillRect overload problems
« Reply #2 on: November 28, 2025, 01:45:34 am »
Great deduction. I didn't even look at the record, so I didn't provide it. I was up late, but no excuse here. Somewhere I decided to use `Single` for the physics and then forgot. Oh my.  ::)

Thanks.

Lulu

  • Sr. Member
  • ****
  • Posts: 362
Re: [SOLVED] TBGRABitmap.FillRect overload problems
« Reply #3 on: November 28, 2025, 05:05:40 pm »
no problem, this kind of thing happens to me too  :)
wishing you a nice life!
GitHub repositories https://github.com/Lulu04

 

TinyPortal © 2005-2018