随机化背景图像。 [英] Randomizing a background image.

查看:75
本文介绍了随机化背景图像。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

获取从目录中的一组图像中随机选择的网页背景图像所涉及的步骤。 我想在每次调用主页时加载一个不同的图像。

What are the steps involved in getting an background image of a webpage to be randomly selected from a set of images in a directory.  I'd like a different image to load up with the main page each time it is called.

我正在使用Blend 4. 要温柔,我是新手...... 提前谢谢。

I'm using Blend 4.  Be gentle, I'm new to it...  thanks in advance.

推荐答案

你只需创建一个简单的随机函数

You just have to create a simple random function

例如。如果你有10张照片

eg. if you have 10 pictures


private in GetPicture(int min, int max)
{
 Random rnd = new Random();
 return rnd.Next(min,max);
}


这篇关于随机化背景图像。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆