I've created a playing card descendent of TCustomControl and I want it to have rounded corners. The card is displayed in a Paint procedure where I determine the bitmap and then use a Canvas.Draw(0, 0, FCardBMP); This approach works well except - no rounded corners. Setting FCardBMP.Transparent := true; doesn't work when the card is dragged onto the table which has a different color background. It seems that "Transparent" just sets the corner, transparent pixels to the color of the initial background, but doesn't change pixels colors when the card is dragged.
With no success I've tried to use
Cnt := GenRegion(Par, FCardBMP,
(FCardBMP.Width - FCardBMP.Width+1) div 2,
(FCardBMP.Height - FCardBMP.Height+1) div 2);
hRegion := CreatePolygonRgn(Par, Cnt, ALTERNATE);
SetWindowRgn(FCardBMP.handle, hRegion, true);
I believe the secret is to useSetWindowRgn but I'm stymied. Any help would be appreciated. Thanks.