账号密码登录
微信安全登录
微信扫描二维码登录

登录后绑定QQ、微信即可实现信息互通

手机验证码登录
找回密码返回
邮箱找回 手机找回
注册账号返回
其他登录方式
分享
  • 收藏
    X
    如图,从代码中可以看出,单机触发截图方法,但是现实中为什么是双击才触发呢?
    54
    0
    <img  id="jp" src="../../../images/common/img/jt.png" onclick="catchScreen()"/>'
    
    
    function catchScreen(){
        
        PrintScreen.BeginCatchScreen();
    }
    
    var PrintScreen = {
            BeginCatchScreen:function(){
                try{
                    var catchScreen = document.getElementById("CatchScreen");
                    if(catchScreen.getVersion()<1002){
                        Ext.Msg.alert("消息","第一次使用截图工具,请先下载安装控件!谢谢!",function(val){
                            if(val=="ok"){
                                var isWnd = window.open("down.html","activex","");
                                isWnd.moveTo(0,0);
                                isWnd.focus();
                            }
                        });
                        return;
                    } 
                    //alert(serverName+serverPort+basepath);
                    catchScreen.BeginCatchScreen(serverName,serverPort,basepath+"/fileUploadAction.do?functionType=catchscreen",1);
                }catch(e){
                    Ext.Msg.alert("消息","第一次使用截图工具,请先下载安装控件!谢谢!",function(val){
                        if(val=="ok"){
                            var isWnd = window.open("down.html","activex","");
                            isWnd.moveTo(0,0);
                            isWnd.focus();
                        }
                    });
                }
                
            },
            showPrintScreen:function(){
                var catchScreen = Ext.getDom("CatchScreen");
                var filepath = catchScreen.GetFileName();
                //alert(filepath);
                var inputMsg =document.getElementById("message");
                var img = '<img width="210px" height="150px" ondblclick="screenDblclick(\''+filepath+'\')" src="../../../'+filepath+'"  alt="screenimg">';
                //只发送一张截图
            //    var inputMsgHtml = inputMsg.innerHTML;
                MsgNode.msg = filepath;
                inputMsg.innerHTML = img;
            },
            filterContent:function(content){
                var newContent = content;
                if(newContent.indexOf("screenimg")!=-1){
                    filepath = newContent.split("=")[1];
                    newContent = '<img class=\"catchScreenImg\" ondblclick="screenDblclick(\''+filepath+'\')" src="../'+filepath+'"  alt="screenimg">';
                }
                for(var p in emotions){
                    while(newContent.indexOf('[#'+emotions[p].EMOCODE+']')!=-1){        
                        newContent = newContent.replace('[#'+emotions[p].EMOCODE+']','<img src="images/emotion/'+emotions[p].SRC+'" />');
                    }
                }
                return newContent;
            }
    }
    

    很奇怪的一个问题,从代码中可以看出,是单击《img》标签的时候,触发截图方法,打断点aler也是这样走的,但是实际情况却是:单击没有反应,只有双击才能触发截图方法,感觉很奇怪

    2
    打赏
    收藏
    点击回答
    您的回答被采纳后将获得:提问者悬赏的 11 元积分
        全部回答
    • 0
    • 隔壁妹妹 普通会员 1楼

      在程序设计中,双击和单击触发截图的方法取决于你的操作系统和编程语言。一般来说,操作系统在单击事件处理程序时,会自动调用系统默认的截图方法。而在双击事件处理程序中,通常会更详细地处理用户点击事件。

      但是,有些编程语言和操作系统可能允许用户手动调用截图方法。例如,如果你使用的是Python编程语言,你可以使用pyautogui.screenshot()函数来手动调用截图方法。如果你使用的是Windows操作系统,你可以使用Windows API来手动调用截图方法。

      因此,单击和双击触发截图的方法取决于你的编程语言和操作系统。

    更多回答
    扫一扫访问手机版
    • 回到顶部
    • 回到顶部