1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
| var AStyle,aElement : TFMXObject;
aBounds : TBounds;
aRect : TRect;
begin
// obtenir image du style Selection
aBitMap := TBitmap.Create(40,40);
AStyle:=TStyleManager.ActiveStyle(Self);
aElement:=aStyle.FindStyleResource('listviewstyle.selection');
if aElement is TStyleObject then
begin
if Assigned(TStyleObject(aElement).SourceLink) then
begin
aBounds:=TBitmapLinks(TStyleObject(aElement).SourceLink).Links[0].SourceRect;
aRect:=TRect.Create(Trunc(aBounds.Left),Trunc(aBounds.Top),Trunc(aBounds.Right),Trunc(aBounds.Bottom));
ABitmap.Width:=ARect.Right-ARect.Left;
ABitmap.Height:=ARect.Bottom-ARect.Top;
aBitmap.CopyFromBitmap(TImage(aStyle.FindStyleResource(TStyleObject(aElement).sourcelookup)).Bitmap,aRect,0,0);
end
else ABitmap.Clear($FF3FB8C6);;
end;
.... |
Partager