Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Multimedia (https://www.delphipraxis.net/16-multimedia/)
-   -   Delphi 9 picture problem (https://www.delphipraxis.net/131677-9-picture-problem.html)

dangerduck 28. Mär 2009 20:05


9 picture problem
 
Liste der Anhänge anzeigen (Anzahl: 1)
Servus!
It's me again :mrgreen:

I have 9 pictures like that :

http://www.shrani.si/f/V/uu/VEOwEh/slika1.png

and i want that one of 9 picture wil show randomly

like that:

http://www.shrani.si/f/34/l0/3HpdGM9d/slika-2.png

the image can be showed for 2000 msec and when disaper must add point and go to star of the loop =)


Please help me =)

Noedel 28. Mär 2009 20:18

Re: 9 picture problem
 
and what´s the problem?

1)get a random digit from 1 to 9
2)show the belonging image
3)Take a timer with an interval of 2sec
4)After 2 sec the timer will hide the image
5)the user has to click on the space, where the image was

Did i understand that correctly?

dangerduck 28. Mär 2009 20:24

Re: 9 picture problem
 
i know how to create random digit
but i must show picture and i dont know how to combine that 2 things :? other things i know but i will better use wait() then ttimer

dangerduck 28. Mär 2009 20:29

Re: 9 picture problem
 
sory for double post but i try like that
i gave image picture like that
Skica1
Skica2 ......
then i write code like that

Delphi-Quellcode:
procedure TForm17.Timer1Timer(Sender: TObject);
type
skica=timage;
begin
skica+random(9).show=true
end;
But it wont work :wall:

Klaus01 28. Mär 2009 21:01

Re: 9 picture problem
 
Zitat:

Zitat von dangerduck
Delphi-Quellcode:
procedure TForm17.Timer1Timer(Sender: TObject);
type
  skica=timage;
begin
  TImage(FindComponent(skica+IntToStr(random(9)))).show=true
end;


dangerduck 28. Mär 2009 21:06

Re: 9 picture problem
 
Zitat:

Zitat von Klaus01
Delphi-Quellcode:
procedure TForm17.Timer1Timer(Sender: TObject);
type
  skica=timage;
begin
  TImage(FindComponent(skica+IntToStr(random(9)))).show=true
end;

thx 10000x there is no error's more just
[DCC Error] Unit17.pas(46): E2010 Incompatible types: 'string' and 'Class reference'

Flips 28. Mär 2009 21:32

Re: 9 picture problem
 
Delphi-Quellcode:
procedure TForm17.Timer1Timer(Sender: TObject);
begin
  TImage(FindComponent('skica'+IntToStr(random(9)))).show=true
end;

dangerduck 28. Mär 2009 21:36

Re: 9 picture problem
 
Zitat:

Zitat von Flips
Delphi-Quellcode:
procedure TForm17.Timer1Timer(Sender: TObject);
begin
  TImage(FindComponent('skica'+IntToStr(random(9)))).show=true
end;

[DCC Error] Unit17.pas(44): E2064 Left side cannot be assigned to
[DCC Error] Unit17.pas(45): E2014 Statement expected, but expression of type 'Boolean' found
[DCC Fatal Error] Project16.dpr(5): F2063 Could not compile used unit 'Unit17.pas'

Klaus01 28. Mär 2009 21:39

Re: 9 picture problem
 
Delphi-Quellcode:
procedure TForm17.Timer1Timer(Sender: TObject);
begin
  TImage(FindComponent('skica'+IntToStr(random(9)))).show;
end;
.. is it to late for you?

Klaus

dangerduck 28. Mär 2009 21:45

Re: 9 picture problem
 
same withotu :
is
[DCC Error] Unit17.pas(44): E2029 ':=' expected but '=' found
with:
is
[DCC Error] Unit17.pas(44): E2064 Left side cannot be assigned to
[DCC Error] Unit17.pas(45): E2014 Statement expected, but expression of type 'Boolean' found

Klaus01 28. Mär 2009 21:49

Re: 9 picture problem
 
pls see my corrections in #9

Regards
Klaus

dangerduck 28. Mär 2009 22:09

Re: 9 picture problem
 
it's work but there is another problem :wall:

http://www.shrani.si/f/2f/Le/3uWFo2E...herproblem.png

Medium 29. Mär 2009 05:27

Re: 9 picture problem
 
You might want to create the 9 TImage components named 'skica1' to 'skica9' before you try to access them. And after that, you should really consider some lecture of basic programming and delphi tutorials. Pretty much all questions here probably won't even emerge if you did that in the first place.

Edit: random(9) is a bit wrong too. If you read the help for "random", you'll see what I mean.

dangerduck 29. Mär 2009 10:53

Re: 9 picture problem
 
sorry i never work with pictures but i have 9 pictures skica1 to sica9 ;-)
the problem was that picture cant be showen twice :)
THX everybody for help ^^

Servus


Alle Zeitangaben in WEZ +1. Es ist jetzt 22:01 Uhr.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz