I've created a TCard component that's a TCustomControl descendant. Below I show the gist of the Paint procedure. Depending on suit and rank I copy a certain portion of an ImageList into a previously defined BMP and then Draw the BMP. This works perfectly.
I also want to put a small green square on the card and write a number ('1' in this example) in that square. This is not working. What happens is - the square portion becomes transparent. If the card is on a gray background - that's the color of the square. The rest of the card is still what I expect.
This all worked fine in Delphi but I'm doing something wrong for Lazarus. Anyone have an idea?
Deck.CardList.GetBitmap(ord(FSuit) * 15 + FRank, FCardBMP);
with FCardBMP.Canvas do begin
Brush.color := clGreen;
FillRect(Bounds(1, 28, 16, 14));
Font.Style := [fsBold];
Font.Color:=clBlack;
TextOut(2, 28, '1');
end;
Canvas.Draw(0, 0, FCardBMP);