/// <summary> /// 显示图像 /// </summary> /// <param name="htWindow">图像视窗</param> /// <param name="image">图像数据</param> /// <param name="region">区域数据</param> public void ShowImage(HTWindowControl htWindow, HObject image, HObject region) { if (htWindow.InvokeRequired) { htWindow.Invoke(new ShowImageDelegate(ShowImage), new object[] { htWindow, image, region }); } else { lock (htWindow) { htWindow.ColorName = "yellow"; htWindow.SetInteractive(false); if (htWindow.Image == null) { htWindow.RefreshWindow(image, region, "fit"); } else { htWindow.RefreshWindow(image, region, "fit"); } htWindow.SetInteractive(true); htWindow.ColorName = "green"; } } }
public void ShowImage(HTWindowControl htWindow, HObject image, HObject region) { if (this.InvokeRequired) { this.BeginInvoke(new ShowImageDelegate(ShowImage), new object[] { htWindow, image, region }); } else { htWindow.ColorName = "green"; htWindow.SetInteractive(false); if (htWindow.Image == null || !htWindow.Image.IsInitialized()) { htWindow.RefreshWindow(image, region, "fit");//适应窗口 } else { htWindow.RefreshWindow(image, region, "");//可以不显示区域 } htWindow.SetInteractive(true); } }