Sehr geil! Vielen Dank, das hat mir wirklich weiter geholfen. Habe allerdings eine kleine Änderung, damit die Bilder auch wirklich Leading sind:
Delphi-Quellcode:
class procedure TListViewHelper.SetListItemImage(const AListItem: TListViewItem; const ADrawableName: String; const ABitmap: TBitmap; const AOwnsBitmap: Boolean);
var
Drawable: TListItemDrawable;
begin
if Assigned(AListItem) then
begin
Drawable := AListItem.Objects.FindDrawable(ADrawableName);
if Assigned(Drawable) and (Drawable is TListItemImage) then
begin
(Drawable as TListItemImage).BeginUpdate;
try
(Drawable as TListItemImage).Bitmap := nil;
(Drawable as TListItemImage).OwnsBitmap := AOwnsBitmap;
(Drawable as TListItemImage).Bitmap := ABitmap;
--->
If Assigned(ABitmap) then begin
(Drawable as TListItemImage).Width := ABitmap.Width;
end;
--->
finally
(Drawable as TListItemImage).EndUpdate;
end;
end;
end;
end;
Ab jetzt nehme ich die Delphi Tags