Raunaq Patel
Raunaq Patel

Reputation: 280

how to display random image using C# in application development of windows phone 7?

I am making an application in which when the user will start the application a random image will be displayed(all this images will be along with this app). please help me how to get through it?

Upvotes: 1

Views: 1129

Answers (2)

MarcinJuraszek
MarcinJuraszek

Reputation: 125650

You should include that images into the solution (make sure that they are marker as 'Copy if newer' or 'Copy always'). That make the images are copied into xap file and moved to the user device when he install the application.

The randomization process is quite simple: use Random class to generate random integer and depending on that integer choose one of the photos.

Upvotes: 0

Jason
Jason

Reputation: 89169

pseudocode

  1. int imgcount = number of images available
  2. int ndx = random number between 0 and imgcount-1
  3. display image[ndx]

Upvotes: 1

Related Questions