|
-
March 31st, 2001, 12:40 PM
#1
how can i generate random pictures?
i am currently working a game. i draw out imageboxes named "imgControl" (using index property) in a form.
my problem is how can i generate random picked pictures that are stored in a folder and display them in the imgControl? (by the way the random pictures must be picked up twice) e.g: picA picA, picD, picD.
-
March 31st, 2001, 08:46 PM
#2
Re: how can i generate random pictures?
name you pictures pic1.bmp, pic2.bmp, etc, say upto pic10.bmp. Then in your code,
for i= 1 to 10
num = 1 + int(rnd*10)
filepath = app.path & "\pic" & num & ".bmp"
imgControl.Picture = LoadPicture (filepath)
imgControlAnother.Picture = LoadPicture(filepath)
next
-
March 31st, 2001, 09:48 PM
#3
Re: how can i generate random pictures?
lets say my pic1.bmp to pic10.bmp are stored in location " C:\myfolders\picXX.bmp".
where shall i put in the "C:\myfolders\.."??
and if i am not wrong, u are including another imagebox called "imgControlAnother" right?
-
March 31st, 2001, 10:02 PM
#4
Re: how can i generate random pictures?
filepath = "C:\myfolder" & "\pic" & num &".bmp"
Yes, you wanted the same file to be used twice, didn't you? I was just trying to show that you can use it as many times, and in any way you like.
-
March 31st, 2001, 10:17 PM
#5
Re: how can i generate random pictures?
thank you,
well, i draw imgControl using loops and imgControl index property is set 0.
i just wanted to random place pictures in imgControl provided that the pics must appear twice.
i am trying to attach my form here and try if i am able to do that...seems like i can't attach my program here. how can i attach my program here?? ( i am using "micosoft internet explorer")
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|