How would you store 10+ images in an array from the same folder using Visual Basic 2008?
The images are named 1.jpg, 2.jpg, etc..
The reason I need to do this is because I need to know how many times the picture has been displayed. For example,
1. Program Start--> Image[0][0]
2. Image[0] is used once--> Image[0][1]
Image[0][1]
[0] is the image
[1] is an integer counting how many times it has been used
First, you have to load each picture into memory. Take a byte array to hold the data, for example. Next, you set the first few bytes to zero. Those bytes represent an integer, so to speak, which will be your counter.
Now you can simply use the first bytes each time an image has been used, and at the same time you also have the image ready for displaying at any given time.
[code]
'Creates an array that can hold 10 images, with 0 and 1 values
Dim Image_Array(9,1) As Integer
Image_Array(0,0)
Image()
Image_Array(x+1, y+1)
Private Function Image As Action
If Image_Array(0,0)
PictureBox.Image = "Image1.jpg"
[code]
Okay sorry I haven't done VB in a while.
Basically make an array of integers, load up your .jpgs, and each .jpg represents an individual integer, etc..
Name:
Anonymous2009-05-20 16:33
>>8
Damn BBcode Fail... Anyways you'll end up with at least 3 functions, here's a general idea of what I'm talking about:
'Loads the images
Private Function LoadImages() As Action
Dim Image1 As Image = Image.FromFile("D:\Project\1.jpg")
Dim Image2 As Image = Image.FromFile("D:\Project\2.jpg")
Dim Image3 As Image = Image.FromFile("D:\Project\3.jpg")
'etc... up to Image10
End Function
'Main Function (example on button Start click)
Dim counter As Integer
Do Until counter = 18 'All images will be used twice
DisplayImage()
ImageArray(x)(y)
x = x + 1
y = y + 1
counter = counter + 1
Loop
'DisplayImage Function
Private Function DisplayImage() As Action
If x = 1
Display Image1
If x = 2
Display Image2
If x = 3
Display Image3
...
Else
Display ImageError
End Function
The classic example used is that of the infinite hotel paradox, also called Hilbert's paradox of the Grand Hotel. Suppose you are an innkeeper at a hotel with an infinite number of rooms. The hotel is full, and then a new guest arrives. It's possible to fit the extra guest in by asking the guest who was in room 1 to move to room 2, the guest in room 2 to move to room 3, and so on, leaving room 1 vacant. We can explicitly write a segment of this mapping:
1 ↔ 2
2 ↔ 3
3 ↔ 4
...
n ↔ n + 1
...
Name:
Anonymous2013-08-31 23:44
However, the earliest attestable accounts of mathematical infinity come from Zeno of Elea (c. 490 BCE? – c. 430 BCE?), a pre-Socratic Greek philosopher of southern Italy and member of the Eleatic School founded by Parmenides. Aristotle called him the inventor of the dialectic. He is best known for his paradoxes, described by Bertrand Russell as "immeasurably subtle and profound".
Name:
Anonymous2013-09-01 0:29
As to date, analysis of the radiation patterns recorded by the WMAP spacecraft hints that the universe has a flat topology. This would be consistent with an infinite physical universe.
Name:
Anonymous2013-09-01 1:14
Many mathematical concepts can be defined precisely using only set theoretic concepts. For example, mathematical structures as diverse as graphs, manifolds, rings, and vector spaces can all be defined as sets satisfying various (axiomatic) properties.
Name:
Anonymous2013-09-01 2:00
The axiom of choice was formulated in 1904 by Ernst Zermelo in order to formalize his proof of the well-ordering theorem.
Name:
Anonymous2013-09-01 2:44
The restriction to ZF renders any claim that relies on either the axiom of choice or its negation unprovable. For example, the Banach–Tarski paradox is neither provable nor disprovable from ZF alone: it is impossible to construct the required decomposition of the unit ball in ZF, but also impossible to prove there is no such decomposition.
Name:
Anonymous2013-09-01 3:30
Every infinite game G_S in which S is a Borel subset of Baire space is determined.