本帖最后由 Richard.Ma 于 2018-4-28 16:27 编辑
您的代码没有什么报错,之所以没有显示图像是因为缺少代码,在登录前需要先初始化MedicalWebViewer,也就是要先弹出一个web窗口,具体需要添加的代码如下
我建议您参考开发包里面的demo代码,目录“C:\LEADTOOLS 20\Shortcuts\Medical Viewers\.NET Framework Class Libraries\HTML5 Medical Viewer\Medical Web Viewer”
文件夹快捷方式:External Control C# Projects
- // Username a password to log in
- // This will be the username and password that you created when running the CSPacsDatabaseConfig.exe demo
- string username = "a";
- string password = "a";
- MedicalWebViewerExternalController controller = new MedicalWebViewerExternalController("http://localhost/MedicalViewer20");
- //MedicalWebViewerExternalController controller = new MedicalWebViewerExternalController("http://47.98.247.113/MedicalViewer20");
- MedicalWebViewerBrowser _selectedBrowser = MedicalWebViewerBrowser.GoogleChrome;
- controller.SelectedBrowser = _selectedBrowser;
- controller.ServiceURL = "http://localhost/MedicalViewerServiceWcf20";
- //controller.ServiceURL = "http://47.98.247.113/MedicalViewerServiceWcf20/";
- controller.Timeout = 30;
- ControllerReturnCode startres=controller.InitApplication(out applicationName, out version, externalControlPort);
- controller.SelectedBrowser = MedicalWebViewerBrowser.GoogleChrome;
- if (controller.IsStarted)
- {
- controller.Shutdown();
- }
- string a, v;
- controller.InitApplication(out a, out v, 8888);
- ControllerReturnCode loginRes = controller.UserLogin(username, password);
- controller.ShowPatient(patientId);
复制代码
|