找回密码
 立即注册

QQ登录

只需一步,快速开始

sxj

注册会员

3

主题

19

帖子

133

积分

注册会员

积分
133
最新发帖
sxj
注册会员   /  发表于:2017-5-10 10:37  /   查看:7182  /  回复:17
我在使用medical测试加载图片时,图片一直加载不出来;
查看Leadtools.Controls.Medical.js 后发现了这段代码

好像是set_imageURL时没有设置上!

我的代码如下:
window.onload = function () {
            // Get the parent DIV
            var imageViewerDiv = document.getElementById("MedicalViewerParentDiv");

            // Create the medical viewer control, and specify the number or rows and columns.
            var viewer = new lt.Controls.Medical.MedicalViewer(imageViewerDiv, 2, 2);

            // [optional] Update the splitter size so it become thick and easy to move.
            viewer.get_gridLayout().set_splitterSize(7);

            // Create a cell name var  
            cellName = 'MedicalCell' + Date.now();

            // Create a cell. It will contain an image or a series of images, based on how many Frames are added (see below for more details).
            var cell = new lt.Controls.Medical.Cell(viewer, viewer.get_divId(), 1, 1);

            // Set the show border to "true", to show a border around the cell.
            cell.set_showFrameBorder(true);

            // Add the cell to the viewer.  
            viewer.layout.get_items().add(cell);

            // [optional] Select the cell (it can also be selected by clicking on it.)
            cell.set_selected(true);

            // Now create a frame object which will hold the image inside the cell.
            var cellFrame = new lt.Controls.Medical.Frame(cell);

            cellFrame.set_imageURL("http://localhost/testLT/script/img/a.jpg");
            // Add the frame to the cell class.
            cell.get_frames().add(cellFrame);
            console.log(cellFrame.imageURL);
            // Now load an image inside the frame by using the following method (and change the url to a valid image url).
            //cellFrame.set_imageURL("http://pic6.huitu.com/res/20130116/84481_20130116142820494200_1.jpg");
            // [optional] Add an action that allows the user to move the loaded image using either the mouse or by touch and drag. we are adding an offset action.
            //            var cellFrame2 = new lt.Controls.Medical.Frame(cell);
            //            cell.get_frames().add(cellFrame2);
            //            cellFrame2.set_imageURL("script/img/b.jpg");
            cell.setCommand(1, new lt.Controls.Medical.OffsetAction());

            // [optional] Run the action. Now if the user clicks or touches the image and drags it, the image will move correspondingly.
            cell.runCommand(1);

            // [optional] Create an overlay text that will appear at the top of the loaded image.
            var overlay = new lt.Controls.Medical.OverlayText();

            // [optional] Set the aligment for the overlay text.
            overlay.set_alignment(lt.Controls.Medical.OverlayAlignment.topLeft);

            // [optional] Set the row index of overlay text.
            overlay.set_positionIndex(0);

            // [optional] Specify that this overlay text is filled by the user through the method (set_text) which is called after this line.
            overlay.set_type(lt.Controls.Medical.OverlayTextType.userData);

            // [optional] Specify the overlay text.
            overlay.set_text("testing overlay text");

            // [optional] Add this overlay to the overlay list of the cell. Currently there is only one overlay, but the user can add multiple overlay texts.
            cell.get_overlays().add(overlay);
        };



<div id="MedicalViewerParentDiv" style="width: 600px; height: 600px; "></div>

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?立即注册

x

17 个回复

正序浏览
Richard.Ma讲师达人认证 悬赏达人认证 SpreadJS 开发认证
超级版主   /  发表于:2017-5-15 12:22:19
18#
不客气
回复 使用道具 举报
sxj
注册会员   /  发表于:2017-5-15 09:31:02
17#
Richard.Ma 发表于 2017-5-12 18:05
没有其他的方法,这个问题我再和厂商沟通,可能确实是一个bug,谢谢你反馈。有了处理结果我再联系你。

...

好的,多谢
回复 使用道具 举报
Richard.Ma讲师达人认证 悬赏达人认证 SpreadJS 开发认证
超级版主   /  发表于:2017-5-12 18:05:32
16#
sxj 发表于 2017-5-12 17:20
不使用Frame下的imageURL;
有其它方法设置图片显示没?我还没找到合适的实例

没有其他的方法,这个问题我再和厂商沟通,可能确实是一个bug,谢谢你反馈。有了处理结果我再联系你。

我建议你直接看html5演示程序的源代码,里面是从后台取的数据显示的,流程都没有问题,你可以部署运行起来,配合源代码还有我发你的文档看。
回复 使用道具 举报
sxj
注册会员   /  发表于:2017-5-12 17:20:57
15#
Richard.Ma 发表于 2017-5-12 16:41
是三月份发布的,如果你是在三月份以后下载的应该就是新版的,我刚才给你发的那句的意思是,将set_imageU ...

不使用Frame下的imageURL;
有其它方法设置图片显示没?我还没找到合适的实例
回复 使用道具 举报
sxj
注册会员   /  发表于:2017-5-12 17:18:37
14#
sxj 发表于 2017-5-12 17:12
我是这周下载的试用版
我明白你的那样设置的意思,我的意思是,他那个属性可读写,写(赋值)的时候它会 ...

那样赋值也试了,也不行
回复 使用道具 举报
sxj
注册会员   /  发表于:2017-5-12 17:17:26
13#
Richard.Ma 发表于 2017-5-12 16:41
是三月份发布的,如果你是在三月份以后下载的应该就是新版的,我刚才给你发的那句的意思是,将set_imageU ...

https://www.leadtools.com/downloads
我是从这个地址下载的

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?立即注册

x
回复 使用道具 举报
sxj
注册会员   /  发表于:2017-5-12 17:12:12
12#
Richard.Ma 发表于 2017-5-12 16:41
是三月份发布的,如果你是在三月份以后下载的应该就是新版的,我刚才给你发的那句的意思是,将set_imageU ...

我是这周下载的试用版
我明白你的那样设置的意思,我的意思是,他那个属性可读写,写(赋值)的时候它会去调用set_ImageURL,跟直接调用set_ImageURL是一样的,读的时候回去调用get_ImageURL也就是var testRImageURL=cellFrame.imageURL;这样
回复 使用道具 举报
Richard.Ma讲师达人认证 悬赏达人认证 SpreadJS 开发认证
超级版主   /  发表于:2017-5-12 16:41:43
11#
sxj 发表于 2017-5-12 16:15
最新修改的版本什么时候发布?

是三月份发布的,如果你是在三月份以后下载的应该就是新版的,我刚才给你发的那句的意思是,将set_imageURL的一行替换为cellFrame.imageURL=“xx.jpg”,如果还存在问题的话,就是接口或者官方文档确实有问题了,我再和美国leadtools沟通
回复 使用道具 举报
sxj
注册会员   /  发表于:2017-5-12 16:15:49
10#
Richard.Ma 发表于 2017-5-12 14:32
有的,提供的接口相关的文档都有
https://www.leadtools.com/help/leadtools/v19m/dh/javascript/cm/int ...

最新修改的版本什么时候发布?
回复 使用道具 举报
12下一页
您需要登录后才可以回帖 登录 | 立即注册
返回顶部