I have an KineticJS Image.
I want to draw a border around this image.
To do that, I am using stroke.
var x = new Kinetic.Image({
image: img,
stroke: 'Red',
strokeWidth: 5
}
Can I achieve these with stroke or do I need drawing line etc. and create group with the image?
1) you can draw transparent Kinetic.Rect
with stroke and rounded corner with your image.
var rect = new Kinetic.Rect({
x : image.x(),
y : image.y(),
width :image.width(),
height : image.height(),
stroke : 'blue',
storkeWidth : 5,
cornerRadius : 10
});
2) There is no easy way to do this. Only if you wil draw stroke manually with Kinetic.Line
objects.