Hi,
I am having a minor issue with the colours in BGRABitmap under MacOSX
On Windows and Linux, they all come out as expected, is there an easy fix to get them consistent under MacOSX
The original Gifs or JPegs are rendered fine in the OS, and indeed they are currently encapsulated into a resource file with lazres, although that has not made any difference to the colours against direct loading from the individual files.
The colours are consistently Black=>Dark Blue, Green -> Mauve, Red -> Cyan and light Grey -> Slightly bluish light grey (so not bad in that last case ;-)
Also, the following will give a cyan circle for the part where Brush:=clGreen, and the text will be Dark Blue, not black.
procedure TLamp.Paint;
var
x, y: Integer;
Size, TextHeight, TextWidth: Integer;
Bitmap: TBGRABitmap;
HSRect: tRect;
aStyle: tTextStyle;
begin
If (Display or (State.phoneState=Calling)) then
begin
Bitmap := TBGRABitmap.Create(Width, Height, BGRABlack); //White);
try
TextHeight:=0; TextWidth:=0;
If DisplayText then
begin
TextHeight:=Bitmap.Canvas.TextHeight(State.Name);
TextWidth:=Bitmap.Canvas.TextWidth(State.Name);
end;
Size:=Height - 5- TextHeight;
// Draws the background
Bitmap.Canvas.Pen.Color := clWhite;
Bitmap.Canvas.Rectangle(1, 1, Width, Height);
x:=Width div 2;
Case State.phoneState of
.....
Calling : begin
aStyle:=Bitmap.Canvas.TextStyle;
aStyle.SingleLine:=False;
aStyle.Wordbreak:=True;
Bitmap.Canvas.TextRect(Rect(0,0,Bitmap.Canvas.Width,Bitmap.Canvas.Height),5,5, RingingDetails, aStyle);
Bitmap.Canvas.Brush.Color:=clRed;
Bitmap.Canvas.Ellipse(Width-15, Height - 15, Width - 1, Height - 1);
end;
SelfRinging : Begin
aStyle:=Bitmap.Canvas.TextStyle;
aStyle.SingleLine:=False;
aStyle.Wordbreak:=True;
Bitmap.Canvas.TextRect(Rect(0,0,Bitmap.Canvas.Width,Bitmap.Canvas.Height),5,5, RingingDetails, aStyle);
Bitmap.Canvas.Brush.Color:=clGreen;
Bitmap.Canvas.Ellipse(Width-15, 1, Width - 1, 15);
end;
...
end;
BitMap.Draw(Canvas, 0,0);
finally
Bitmap.Free;
end;
end;
inherited Paint;
end;
BGRABitMap v 7.2; Lazarus 1.0.8 and FPC 2.6.2