Topic: Random Image in Panel
Hello Mvd!
I need a sample on random image in panel when when form is shown.... anybody from the wizards of MVD family.
Thanks!
My Visual Database → General → Random Image in Panel
Hello Mvd!
I need a sample on random image in panel when when form is shown.... anybody from the wizards of MVD family.
Thanks!
Hi Manixs,
I suppose the 'correct' way would be to read through the images in a directory and load the file names into some sort of stringlist etc.
But if the number of images is fixed, I'd probably do it very simply as per the attached example (if you have a large number of images, use a batch utility to rename them 1.jpg, 2.jpg, 3.jpg ,4.jpg etc and then alter the script to however many images you have).
Derek
Hello Derek
There was an error with me... please..
thanks!
manixs2013,
The Random function has recently changed. Try the following:
vrandompicture := 'images\' + inttostr(random(6)) + '.jpg';
YESSSSS
Thanks to ehwagner.. and derek!
manixs2013,
Derek mentioned about another option which would be to extract the file list from the image directory into a stringlist. I went ahead and put together such a project. See attached.
Doing it this way, you do not need to rename all images and you do not need to know the number of files in the folder for the random number.
Thank 5x very much ehwagner!
My Visual Database → General → Random Image in Panel
Powered by PunBB, supported by Informer Technologies, Inc.
Theme Hydrogen by Kushi