Well, if you need a complete solution, you need to add height and with the image before cropping:
var smsTopBg = new Image(); smsTopBg.onload = function() { var smsTopBg_image = new Kinetic.Image({ image: smsTopBg, x: 200, y: 20, width: 50, height: 20, crop: { x: 20, y: 10, width: 50, height: 50 } }); sms_layer.add(smsTopBg_image); stage.add(sms_layer); }
Thanks!
source share