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 >>

TMS Smooth Controls Pack
Adding pictures to the TGDIPPictureContainer at runtime

It is equally possible to add pictures to the TGDIPPictureContainer at run-time. Below is a code snippet that shows how an image is loaded from file and added to the TGDIPPictureContainer and subsequently used for display in a TAdvSmoothListBox control:
with GDIPPictureContainer.Items.Add do
begin
Picture.LoadFromFile('myimage.png’);
Name := 'NEW';
end;
AdvSmoothListBox.Items.Add.Caption := 'This uses the new image : ';
To remove a picture from the TGDIPPictureContainer later:
with GDIPPictureContainer.Items.Items[0].Free; 
To control size of the picture displayed, additional tags WIDTH and HEIGHT can be used.
This is also explained at page 14 of the PDF Developers Guide.