Jquery图像镜头 - 动力学JS图像ID [英] Jquery Image Lens - Kinetic JS image id

查看:158
本文介绍了Jquery图像镜头 - 动力学JS图像ID的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在Kinetic JS画布上使用jquery图像镜头 http://jsfiddle.net/user373721 / 7f8qM / 15 / 。我遇到的挑战是如何在画布中找到图像的ID,我试过:

I am trying to use jquery image lens on Kinetic JS canvas http://jsfiddle.net/user373721/7f8qM/15/. The challenge I have is how to find the id of the image in the canvas, I tried:

  myImage.onload = function () {
            var yoda = new Kinetic.Image({
                x: 0,
                y: 0,
                image: myImage,
                width: 400,
                height: 400,
                id: 'thumb'
            });
            layer.add(yoda);
            layer.draw();
        };
        myImage.src = 'http://www.html5canvastutorials.com/demos/assets/yoda.jpg';
        $('#thumb').imageLens({ lensSize: 200 }); 

如果没有运气,我将非常感谢您的建议,谢谢。

Had no luck, I would appreciate your suggestions, thanks in advance.

推荐答案

在尝试时使用kineticjs和imageLens是不可行的。非常不同的技术。

It is not posible to use kineticjs and imageLens as you are trying. Very different techniques.

所以你有这样的方式:


  1. 不要使用kineticjs。仅适用于DOM图像。

  2. 将kineticjs对象转换为图像 http://www.html5canvastutorials.com/kineticjs/html5-canvas-shape-caching-with-kineticjs/ 然后将图像插入DOM,然后使用imageLens。

  1. Don't use kineticjs. Work only with DOM images.
  2. Convert kineticjs objects to image http://www.html5canvastutorials.com/kineticjs/html5-canvas-shape-caching-with-kineticjs/ then insert the image to DOM and then use imageLens.

这篇关于Jquery图像镜头 - 动力学JS图像ID的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆