Most appropriate sub-area of p5.js?
p5.js version
1.11.13
Web browser and version
150.0.2
Operating system
Windows
Steps to reproduce this
Steps:
- Load Image 1
- Create Image 2 object
- Copy part of Image 1 into new Image 2 Object
- The image does not change
- The image changes only when I update one pixel in the new Image 2 Object
- Also tried
updatePixels()
Snippet:
P5JS website example: https://editor.p5js.org/HTsuyoshi/full/Y8dWgkFhX
let img,
imgCrop;
function setup() {
createCanvas(400, 400, WEBGL);
img = loadImage('./Screenshot.png');
imgCrop = createImage(100, 100);
}
function draw() {
imgCrop.copy(
img,
mouseX - (width * .5), mouseY - (height * .5), img.width, img.height,
0, 0, imgCrop.width, imgCrop.height
);
//imgCrop.set(0, 0, color(0, 0, 0));
background(220);
image(imgCrop, 0, 0, imgCrop.width, imgCrop.height);
}
Most appropriate sub-area of p5.js?
p5.js version
1.11.13
Web browser and version
150.0.2
Operating system
Windows
Steps to reproduce this
Steps:
updatePixels()Snippet:
P5JS website example: https://editor.p5js.org/HTsuyoshi/full/Y8dWgkFhX