| View previous topic :: View next topic |
| Author |
Message |
drschubi Member
Joined: 20 Aug 2003 Posts: 4
|
Posted: 20/08/03 16:57 Post subject: Selects randomly an image from the image list and loades it |
|
|
Hallo,
at first thank you for picshow, my english is not so good, but i want try to ask.
I don't want randomize the picshow, i want see the picshow in turn.
It is possible to implement this funktion in your component , and then the user can change it from the form or you can me tell, how I must change the democode below the comment in my subject.
Sorry for my very bad english. I hope somebody understand me. Maybe in german.
Thank you veryy much
|
|
| Back to top |
|
 |
Kambiz Administrator

Joined: 07 Mar 2003 Posts: 206
|
Posted: 21/08/03 20:02 Post subject: |
|
|
Hi,
PicShow just get one single image to display and doesn't manage a list of images. It's the developer responsibility to feed the images to the component as she/he wants. When OnStart event of PicShow is triggered, the component doesn't need the image anymore and after that you can assign a new image to the Picture property.
I think you want to show a list of image files to the user, and when user selects one image, you display it. For this purpose you code should be something like this:
| Code: | if PicShow.Busy then
PicShow.Stop;
PicShow.Picture.LoadFromFile(Path_To_Image_File);
PicShow.Execute; |
I hope I could answer to your question.
Regards,
Kambiz
|
|
| Back to top |
|
 |
drschubi Member
Joined: 20 Aug 2003 Posts: 4
|
Posted: 22/08/03 14:01 Post subject: Show Pictures from |
|
|
Hi Kambiz,
thank you very much for your answer, but I want only show the images from the created filelist in turn.
When I delete the "random" in this code below, I get an error.
I want show e.g. pic01.jpg then pic02.jpg and not random. Sorry for my english, but I am a beginner in english and Delphi.
// Selects randomly an image from the image list and loades it into PicShow
procedure TMainForm.LoadNextImage;
var
Index: Integer;
begin
LoadedImage := EmptyStr;
if Pictures.Count > 0 then
begin
repeat
Index := Random(Pictures.Count); //What must I change there ???
until (Pictures.Count <= 1) or (ShownImage <> Pictures[Index]);
LoadedImage := Pictures[Index];
PicShow.Picture.LoadFromFile(PicPath + LoadedImage);
end;
NextFilename.Caption := 'Next: ' + LoadedImage;
NextFilename.Update;
findwort;
end;
|
|
| Back to top |
|
 |
Kambiz Administrator

Joined: 07 Mar 2003 Posts: 206
|
Posted: 22/08/03 18:06 Post subject: |
|
|
In the attachment you can find the main unit of the demo, which is adapted for your purpose.
| Description: |
| Adapted version of main unit of PicShow demo for showing images sequentially. |
|
 Download |
| Filename: |
Main.pas |
| Filesize: |
9.18 KB |
| Downloaded: |
22 Time(s) |
|
|
| Back to top |
|
 |
drschubi Member
Joined: 20 Aug 2003 Posts: 4
|
Posted: 22/08/03 18:50 Post subject: Thank you very much, I am so happyy |
|
|
Hello Kambiz,
that is very nice from you, this is exactly what I want. I will try to learn from your code. Many thanks and best wishes from Germany.
Best regards
René
|
|
| Back to top |
|
 |
|