DELPHI AREA
MESSAGE BOARD
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Selects randomly an image from the image list and loades it

 
   Reply to topic    DELPHI AREA Forum Index -> DELPHI AREA's Products
View previous topic :: View next topic  
Author Message
drschubi
Member


Joined: 20 Aug 2003
Posts: 4

PostPosted: 20/08/03 16:57    Post subject: Selects randomly an image from the image list and loades it Reply with quote

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
View user's profile
Kambiz
Administrator


Joined: 07 Mar 2003
Posts: 206

PostPosted: 21/08/03 20:02    Post subject: Reply with quote

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
View user's profile Send e-mail Visit poster's website
drschubi
Member


Joined: 20 Aug 2003
Posts: 4

PostPosted: 22/08/03 14:01    Post subject: Show Pictures from Reply with quote

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
View user's profile
Kambiz
Administrator


Joined: 07 Mar 2003
Posts: 206

PostPosted: 22/08/03 18:06    Post subject: Reply with quote

In the attachment you can find the main unit of the demo, which is adapted for your purpose.


Main.pas
 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
View user's profile Send e-mail Visit poster's website
drschubi
Member


Joined: 20 Aug 2003
Posts: 4

PostPosted: 22/08/03 18:50    Post subject: Thank you very much, I am so happyy Reply with quote

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
View user's profile
Display posts from previous:   
   Reply to topic    DELPHI AREA Forum Index -> DELPHI AREA's Products All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB 2.0.6 © 2001, 2002 phpBB Group