當前位置: 首頁>>代碼示例>>C#>>正文


C# PictureBox.GetHashCode方法代碼示例

本文整理匯總了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("圖片數目和圖片說明數量不一致!");
                }
            }
        }
開發者ID:Spritutu,項目名稱:ntxx,代碼行數:67,代碼來源:OperatePhoto.cs


注:本文中的System.Windows.Forms.PictureBox.GetHashCode方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。