i'm trying to paint vcl style background from TSeStyleFont like in Bitmap Style Designer .. is there any way to draw the background ?
i have make a try : - draw the object first in a bitmap using DrawElement . - than copy current bitmap to a nother clean bitmap using 'Bitmap.Canvas.CopyRect' the problem is that : this methode does not work correctly with objects that has Glyph such as CheckBox ...
var
bmp, bmp2: TBitmap;
Details: TThemedElementDetails;
R, Rn: TRect;
begin
bmp := TBitmap.Create;
bmp2 := TBitmap.Create;
R := Rect(0, 0, 120, 20);
Rn := Rect(0 + 4, 0 + 4, 120 - 4, 20 - 4);
bmp.SetSize(120, 20);
bmp2.SetSize(120, 20);
Details := StyleServices.GetElementDetails(TThemedButton.tbPushButtonHot);
StyleServices.DrawElement(bmp.Canvas.Handle, Details, R);
bmp2.Canvas.CopyRect(R, bmp.Canvas, Rn);
Canvas.Draw(10, 10, bmp2);
bmp.Free;
bmp2.Free;
end;