/// <summary> /// 显示比对不同点的位置 /// </summary> public void showDiffImage() { //在此处弹出不一样图 Bitmap newMap = Utils.DrawRectangleInPicture(showDiffMap, new Point(draw_x, draw_y), new Point(draw_x + 30, draw_y + 30), Color.Red, 2, 0); if (newMap is Image) { int sizeX = newMap.Size.Width + 10; int sizeY = newMap.Size.Height + 10; ImageShow imageShow = new ImageShow(); imageShow.Size = new Size(sizeX, sizeY); Image image = (Image)newMap; imageShow.BackgroundImage = image; imageShow.TopMost = true; imageShow.ShowDialog(); } }
注意:先设置topmost,再showDialog();