예제 #1
0
        private void LittleGame_Loaded(object sender, RoutedEventArgs e)
        {
            ImageBrush imabush = new ImageBrush();

            try
            {
                textEvo   = commonC.GetSearchResult("雪");
                gameIma   = commonC.GetGameImageSearchResult("雪");
                listImage = gameIma.ToList();
                if (textEvo != null)
                {
                    imabush.ImageSource   = commonC.ConvertLayout(textEvo.FirstOrDefault().MinImage.ToArray());
                    ForeBorder.Background = imabush;
                }
                else
                {
                    Messagebox.Show("错误", "对不起,没有你要找的字,请重新输入!");
                }

                for (int i = 0; i < 9; i++)
                {
                    flage[i] = 0;  // 标记索引
                    fge[i]   = i + 1;
                }
            }
            catch (Exception ex)
            {
                Messagebox.Show("错误", ex.ToString());
            }
        }
예제 #2
0
 private void Search_ButtonClick(object sender, RoutedEventArgs e)
 {
     textEvo = commonC.GetSearchResult(searchText.Text.Trim());
     if (textEvo != null)
     {
         ImageFillIMage.Source = commonC.ConvertLayout(textEvo.FirstOrDefault().MinImage.ToArray());
         textFill.Text         = textEvo.FirstOrDefault().Text;
     }
     else
     {
         Messagebox.Show("错误", "对不起,没有你要找的字,请重新输入!");
     }
 }
예제 #3
0
        private void imageSearch_ButtonClick(object sender, RoutedEventArgs e)
        {
            ImageBrush imabush = new ImageBrush();

            textEvo = commonC.GetSearchResult(textSearch.Text.Trim());
            if (textEvo != null)
            {
                imabush.ImageSource    = commonC.ConvertLayout(textEvo.FirstOrDefault().MinImage.ToArray());
                imageResult.Background = imabush;
            }
            else
            {
                Messagebox.Show("错误", "对不起,没有你要找的字,请重新输入!");
            }
        }
예제 #4
0
 //此处定义输入文字后返回结果的事件
 private void Textbox_Enter(object sender, KeyEventArgs e)
 {
     //判断输入是否为回车键
     if (e.Key == Key.Enter)
     {
         textEvo = commonC.GetSearchResult(Message_Text.Text.Trim());
         if (textEvo != null)
         {
             ImageBrush imabush = new ImageBrush();
             imabush.ImageSource    = commonC.ConvertLayout(textEvo.FirstOrDefault().MinImage.ToArray());
             borderImage.Background = imabush;
         }
         else
         {
             Messagebox.Show("错误", "对不起,没有你要找的字,请重新输入!");
         }
     }
 }