Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

konva crop outside width and height of image

var src = 'https://picsum.photos/id/237/200/300';

var stage = new Konva.Stage({
  container: 'container',
  width: 400,
  height: 300,
});

// with help of clipFunc on the layer
var layer = new Konva.Layer({
  clipFunc: function(ctx) {
    ctx.arc(130, 140, 70, 0, Math.PI * 2, false);
  }
});
stage.add(layer);

Konva.Image.fromURL('https://picsum.photos/id/237/200/300', function(theDog) {
  theDog.setAttrs({
    x: 0,
    y: 0,
    scaleX: 1,
    scaleY: 1,
  });
  layer.add(theDog);
  layer.batchDraw();
});
Comment

PREVIOUS NEXT
Code Example
Java :: int[] left = Arrays.copyOfRange(arr, l, m + 1); 
Java :: gradle project load test data json file with jackson 
Java :: java application security best practices 
Java :: lelen suratlari ramkasidagi oltinlar 
Java :: how-to-use-volley-string-request-in-android 
Java :: how to getobject from id in controlp5 
Java :: java reverse a word 
Java :: setting a hint on a text field in javafx 
Java :: dna exercise 
Java :: firebase persistence enable android 
Java :: java -jar -l resourceses.porperties -i ejemplo.txt -o inject.bin 
Java :: hybrid inheritance in java 
Java :: ex javaloop 
Java :: quick sort in java progrmmieren 
Java :: java to run colored lines 
Java :: Add Future Date in AndroidStudio 
Java :: jdbc outside of ide 
Java :: 13 live 
Java :: how to iterate list in java selenium 
Java :: How to efficiently solve the knpasack problem, in Java? 
Java :: actionevent java swing 
Java :: spring down load 
Java :: how do you create a txt file in java 
Java :: how to get index of while loop java 
Java :: java random number generator 6 
Java :: variables en java 
Java :: converting temperature from fahrenheit to celsius 
Java :: get alpha from image java 
Java :: spring boot return 201 created 
Java :: speak function in java 
ADD CONTENT
Topic
Content
Source link
Name
3+4 =