Frequently Asked Component Specific Questions
Options |
Display all FAQ items |
Displaying items 1 to 1 of 1, page 1 of 1
<< previous next >>
Initializing images
There is not much code needed to initialize and start using the component. First of all, images need to be added to the image collection, either in design time or in code.
Directly loading the pictures in code:
for I := 1 to 12 do begin with GUIMotions1.Images.Add do begin //Add picture already loaded Picture.LoadFromFile(‘image1.jpg’); //Same for adding alternate picture but specify AlternatePicture //Set some properties… end; end;
for I := 1 to 12 do begin with GUIMotions1.Images.Add do begin //Just set reference to the image filename, GUIMotions will load the //image when needed PictureLocation := ‘image1.jpg’; //Same for adding alternate picture but specify AlternatePicture //Set some properties… end; end;
for I := 1 to 12 do begin with GUIMotions1.Images.Add do begin //Just set reference to the image filename, GUIMotions will load the //image when needed ThreadPictureLocation := ‘image1.jpg’; end; end;
GUIMotions1.AddImagesFromFolder('.\Images\*.jpg'); GUIMotions1.AddImageLocationsFromFolder('.\Images\*.jpg'); //or any other format supported by TPicture GUIMotions1.AddThreadedImageLocationsFromFolder('.\Images\*.jpg'); //images are loaded in a separate thread