为图像分配值 [英] assign images a value
本文介绍了为图像分配值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
当以随机顺序选择图像时,使用哪个集合将图像链接到某个值,然后能够显示具有该值的图像
解决方案
试试这个
位图图片= 新位图(文件名); 字典<位图,> ImageInfo = 新字典<位图,> (); ImageInfo [image] = 1 ;
现在,您可以通过 ImageInfo [image]使用该值.
干杯...:)
我不明白您的问题.字典< value,system.drawing.image>可能是您正在寻找的答案,其中值是整数或其他任何值,但是如果您告诉我们所使用的图形框架,Click-Event的设计方式以及图像的引用方式,这将很有帮助.
which collections to use to to link images to a value then be able to display that image with that value, when select that image in a random sequence
解决方案
Try this
Bitmap image = new Bitmap(filename); Dictionary<bitmap,> ImageInfo = new Dictionary<bitmap,>(); ImageInfo[image] = 1;
Now you can use the value by ImageInfo[image].
Cheers... :)
i do not understand your question. A Dictionary<value,system.drawing.image> is probably the answer you are looking for, where value is an Integer or whatever, but it would help if you would tell us which Graphic-Framework you use, how the Click-Event is designed and how the Images are referred.
这篇关于为图像分配值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文