Hello!
I have an lazarus app that runs fine on OS X + Carbon, but since carbon is going to be deprecated in the next OS X release, I 'm trying to switch to Cocoa Widgetset.
I'm stuck with direct pixels access. The code that worked in Carbon doesn't work anymore, RawImage.Data is just returning all zeroes.
I made a small testing procedure:
procedure TForm1.TestBitmaps;
var Bmp : TBitmap;
begin
Bmp:=TBitmap.Create;
Bmp.Width:=32;
Bmp.Height:=32;
Bmp.PixelFormat:=pf32bit;
Bmp.Canvas.Pixels[0,0]:=$123456;
ShowMessage(ColorToString(Bmp.Canvas.Pixels[0,0]));
Bmp.BeginUpdate();
Bmp.EndUpdate();
ShowMessage(ColorToString(Bmp.Canvas.Pixels[0,0]));
Bmp.Free;
end;
First message shows $00123456, but after calling BeginUpdate / EndUpdate, second message shows $00000000,
so Begin/EndUpdate seem to vipe all the bitmap data.
I tried using LazIntfImage to access pixels, but once again I'm getting zeroes instead of real color values.
Can anyone help me with that?
I'm using Lazarus 1.8.4/FPC3.0.4
Thanks in advance!