/// <summary> /// 刷新游戏缩略图 /// </summary> private Bitmap RefreshGameWindow_pictureBox() { if (GameWindow_GamePicture_pictureBox.Image != null) { Image i = GameWindow_GamePicture_pictureBox.Image; GameWindow_GamePicture_pictureBox.Image = null; i.Dispose(); } try { if (GlobalObject.GameHandle.IsSuccess) { var temp = GlobalObject.GameHandle.GetGameBitmap(); GameWindow_GamePicture_pictureBox.Image = FunctionBitmap.ResizeImage(temp, 200, 120, false); return(temp); } else { GameWindow_GamePicture_pictureBox.Image = FunctionBitmap.ResizeImage(Properties.Resources.CrawlFailed, 200, 120, true); } } catch (Exception) { /*************** * 在这里加入失败图像 ***************/ if (GameWindow_GamePicture_pictureBox.Image != null) { Image i = GameWindow_GamePicture_pictureBox.Image; GameWindow_GamePicture_pictureBox.Image = FunctionBitmap.ResizeImage(Properties.Resources.CrawlFailed, 200, 120, true); i.Dispose(); } } return(null); }
/// <summary> /// 点击树状图上的某一节点,刷新图像 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void GameWindow_treeView_Click(object sender, EventArgs e) { if (GameWindow_HandleList_treeView.SelectedNode != null) { // 将当前节点文本添加到文本框 this.GameWindow_InputIntPtr_textBox.Text = GameWindow_HandleList_treeView.SelectedNode.Text; if (GameWindow_GamePicture_pictureBox.Image != null) { Image i = GameWindow_GamePicture_pictureBox.Image; GameWindow_GamePicture_pictureBox.Image = null; i.Dispose(); } try { GameWindow_GamePicture_pictureBox.Image = FunctionBitmap.ResizeImage(FunctionBitmap.PrtGameWindow(Function.Functions.StrToIntPtr(GameWindow_HandleList_treeView.SelectedNode.Text)), 200, 120, true); } catch (Exception) { /*************** * 在这里加入失败图像 ***************/ } } }