私は KineticJS を使用しており、適切なズーム機能を取得しようとしています。必要な元のサイズで背景画像を追加したレイヤーがあります。
ただし、(layer.setScale()を介して)ズームインすると、他のすべてのものと一緒にズームインすると、画像が縮小します(露出した白い領域が残ります)。
では、このような場合でもイメージを繰り返すにはどうすればよいでしょうか? 画像を追加するために使用したコードは次のとおりです。
var imageObj = new Image();
imageObj.onload = function() {
var image = new Kinetic.Image({
image: imageObj,
width: width,
height: height
});
// add the shape to the layer
main_layer.add(image);
// add the layer to the stage
stage.add(main_layer);
};
imageObj.src = 'images/blueprint_background.png';