Frequently Asked Component Specific Questions

Options

Display all FAQ items

Search FAQ items:


Displaying items 1 to 1 of 1, page 1 of 1

<< previous next >>

TAdvCardList
How to custom draw an image

You'd need to do this using the event: OnDrawCardItem:
procedure TForm4.AdvCardList1DrawCardItem(Sender: TObject; Card: TAdvCard;
  Item: TAdvCardItem; Canvas: TCanvas; Rect: TRect); 
begin
end;
This event returns the card & item that should be drawn and from this event, you'd need to perform the drawing in the Canvas passed as parameter and rectangle Rect, ie. something like:
procedure TForm4.AdvCardList1DrawCardItem(Sender: TObject; Card: TAdvCard;
  Item: TAdvCardItem; Canvas: TCanvas; Rect: TRect); 
begin
  imagelist1.Draw(rect.Left,rect.Top, item.Tag); 
end;
if you'd have stored the index of an imagelist image in the item's Tag property.