I am having trouble with incorrectly painted corners when drawing VCL-styled window elements. On styles that have rounded corners, I get a white background in the space between the control's bounding rect and the style's rounded window corner.
The above image was run using Aqua Light Slate, but any style with rounded corners will show this same problem. What am I missing?
type
TSample = class(TCustomControl)
protected
procedure Paint; override;
end;
{ TForm1 }
procedure TForm1.FormCreate(Sender: TObject);
var
R: TRect;
S: TSample;
begin
R := ClientRect;
InflateRect(R, -20, -20);
S := TSample.Create(Application);
S.Parent := Self;
S.BoundsRect := R;
end;
{ TSample }
procedure TSample.Paint;
var
Details: TThemedElementDetails;
begin
Details := StyleServices.GetElementDetails(twCaptionActive);
StyleServices.DrawParentBackground(Self.Handle, Canvas.Handle, Details, False);
StyleServices.DrawElement(Canvas.Handle, Details, ClientRect);
end;
StyleServices.DrawElement
method to see how it draw the bitmap in the canvas? – RRUZ