TImage's Canvas.Pixels raise exception
Original Reporter info from Mantis: Shebuka
-
Reporter name: Anton S.
Original Reporter info from Mantis: Shebuka
- Reporter name: Anton S.
Description:
There is some sort of bug in CarbonCanvas GetPixel, and probably also in CarbonObject RawImage_FromCarbonBitmap
Discovered with GreenScreen("Tween" two images) test project by TheBlackSheep
(http://www.lazarus.freepascal.org/index.php/topic,16940.msg93453.html#msg93453 needs BGRABitmap)
Additional information:
In TCarbonBitmapContext.GetPixel the is an assignment
R := Classes.Rect(X, Y, 1, 1);
The R is the propagated to TCarbonWidgetSet.RawImage_FromCarbonBitmap and in this piece of code
Width := R.Right - R.Left;
Height := R.Bottom - R.Top;
Width and Height become negative... If i put S.X, S.Y instead of 1, 1 and remove the Right and Bottom it still not fixed because after returning back to GetPixel i then get "Invalid horizontal pixel index error" in
Result := IntfImage.TColors[X, Y];
Seems all ok after setting [X-1, Y-1], but sometimes instead of green color i get blue, brown or clBlack color.
Also sporadically it raise an access violation on the first assignment line (VBytes.Ah := B0;) of TLazIntfImage.GetColor_BPP32_A8R8G8B8_BIO_TTB
Mantis conversion info:
- Mantis ID: 22111
- Version: 1.1 (SVN)