my app has 3 controls: TThumbnailList (image viewer from TMS components), TImage, and TLabel. I wish that when I drag an image from TThumbnailList to TImage, and drop it, the TLabel object shows the size in bytes for that image. How do I get this? Thanks in advance.
procedure TForm1.AssignImage;
begin
//tl: TThumbnailList
if (tl.ItemIndex>=0) then begin
Image1.Picture.Assign(tl.Thumbnails.Items[tl.ItemIndex].Picture);
end;
end;
procedure TForm1.Image1DragDrop(Sender, Source: TObject; X, Y: Integer);
begin
if (Source is TThumbnailList) then AssignImage;
end;
procedure TForm1.Image1DragOver(Sender, Source: TObject; X, Y: Integer; State: TDragState;
var Accept: Boolean);
begin
Accept:= Source is TThumbnailList;
end;