本文整理汇总了C#中System.Windows.Forms.PictureBox.GetHashCode方法的典型用法代码示例。如果您正苦于以下问题:C# PictureBox.GetHashCode方法的具体用法?C# PictureBox.GetHashCode怎么用?C# PictureBox.GetHashCode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Forms.PictureBox
的用法示例。
在下文中一共展示了PictureBox.GetHashCode方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: createLeftPictureBoxList
/// <summary>
/// 这个函数的功能就是读取图片,初始化左边面板图片列表
/// </summary>
/// <param name="strLabelList"></param>
/// <param name="str"></param>
private void createLeftPictureBoxList(List<string> strLabelList, string str = "filter", string mirrorDirection= "mirrorRight", int coolingType = 5)
{
string imagePath = "../../image/" + str;
ImageList imageList = getLeftImageUrl(imagePath);
//两个If防止清空作用
if (leftPictureBoxDictionary != null && leftPictureBoxDictionary.Count > 0)
{
leftPictureBoxDictionary.Clear();
}
if (leftLabelDictionary != null && leftLabelDictionary.Count > 0)
{
leftLabelDictionary.Clear();
}
if (imageList != null)
{
if (imageList.Images.Count == strLabelList.Count)
{
//设置pictruebox 中文件名称需要,他的长度和imageList相同,同时文件名称一一对应
// string[] imagePathArray = Directory.GetFiles(imagePath);
// List<string> tempImageFileNameList = getimageFileName(imagePathArray);
//修改时间2012-7-12
List<GraphicText> tempImageFileNameList = GraphicControlService.initLeftGraphicText(str);
List<string> imageEntityNameList = ImageBlockBLL.getImageNames(coolingType);
for (int i = 0; i < imageList.Images.Count; i++)
{
string simpleImageEntityName = tempImageFileNameList.ElementAt(i).realLetterAndNumName.ToString().Substring(1, 3);
if(imageEntityNameList.Contains(simpleImageEntityName)){
PictureBox leftPb = new PictureBox();
// leftPb.Name = "pictrueBox" + tempImageFileNameList.ElementAt(i).ToString();
//注意此处必须进行这样命名
//leftPb.Name = "pictrueBox" + tempImageFileNameList.ElementAt(i).realLetterAndNumName.ToString().Substring(1,3);
leftPb.Name = tempImageFileNameList.ElementAt(i).realLetterAndNumName.ToString().Substring(1, 3);
if (mirrorDirection.Equals("mirrorRight"))
{
leftPb.Image = imageList.Images[i];
}
else
{
Bitmap bmp = new Bitmap(imageList.Images[i]);
bmp.RotateFlip(RotateFlipType.RotateNoneFlipX);
leftPb.Image = bmp;
}
leftPb.Width = imageList.Images[i].Width + 2;
leftPb.Height = imageList.Images[i].Height + 3;
leftPictureBoxDictionary.Add(leftPb.GetHashCode().ToString(), leftPb);
Label leftLabel = new Label();
leftLabel.Text = strLabelList.ElementAt(i).ToString();
leftLabelDictionary.Add(leftPb.GetHashCode().ToString(), leftLabel);
}
}
}
else
{
MessageBox.Show("图片数目和图片说明数量不一致!");
}
}
}