找回密码
 立即注册

QQ登录

只需一步,快速开始

sxj

注册会员

3

主题

19

帖子

133

积分

注册会员

积分
133
最新发帖
sxj
注册会员   /  发表于:2017-5-10 10:37  /   查看:7158  /  回复: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 个回复

倒序浏览
sxj
注册会员   /  发表于:2017-5-10 10:53:09
沙发
回复 使用道具 举报
Richard.Ma讲师达人认证 悬赏达人认证 SpreadJS 开发认证
超级版主   /  发表于:2017-5-10 16:06:24
板凳
验证了,确实存在这个问题,需要跟厂商进行沟通,这两天有结果了会及时回复你
回复 使用道具 举报
sxj
注册会员   /  发表于:2017-5-12 11:42:20
地板
有Medical Web View 相关JS的详细说明文档吗?感觉文档好少,看起来好吃力
回复 使用道具 举报
sxj
注册会员   /  发表于:2017-5-12 13:39:15
5#
Richard.Ma 发表于 2017-5-10 16:06
验证了,确实存在这个问题,需要跟厂商进行沟通,这两天有结果了会及时回复你

有Medical Web View 相关JS的详细说明文档吗?感觉文档好少,看起来好吃力
回复 使用道具 举报
Richard.Ma讲师达人认证 悬赏达人认证 SpreadJS 开发认证
超级版主   /  发表于:2017-5-12 14:32:52
6#
sxj 发表于 2017-5-12 13:39
有Medical Web View 相关JS的详细说明文档吗?感觉文档好少,看起来好吃力

有的,提供的接口相关的文档都有
https://www.leadtools.com/help/l ... m/introduction.html
https://www.leadtools.com/help/l ... o/introduction.html
之前的那个问题问过厂商,给的答复是3月的版本已经修复了这个问题,使用cellFrame.imageURL=“xx.jpg”
但是我这边版本早一些,暂时未做验证,你试试看结果如何
回复 使用道具 举报
sxj
注册会员   /  发表于:2017-5-12 15:12:30
7#
Richard.Ma 发表于 2017-5-12 14:32
有的,提供的接口相关的文档都有
https://www.leadtools.com/help/leadtools/v19m/dh/javascript/cm/int ...

这样赋值也是不行的,因为它的这属性也是调用了set_imageURL
回复 使用道具 举报
sxj
注册会员   /  发表于:2017-5-12 15:14:21
8#
sxj 发表于 2017-5-12 15:12
这样赋值也是不行的,因为它的这属性也是调用了set_imageURL

谢谢,之前没看到这个链接
回复 使用道具 举报
sxj
注册会员   /  发表于:2017-5-12 15:15:00
9#
sxj 发表于 2017-5-12 15:12
这样赋值也是不行的,因为它的这属性也是调用了set_imageURL

谢谢,之前没看到这个链接
回复 使用道具 举报
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下一页
您需要登录后才可以回帖 登录 | 立即注册
返回顶部