We are about to switch to a new forum software. Until then we have removed the registration on this forum.
PFont f;
void setup() {
background(255);
size(700, 700);
f=createFont("HelveticaLTStd-BoldCond.otf", 300);
smooth();
fill(0);
textFont(f);
text("D", 270, 400);
}
void draw() {
stroke(random(255), random(255), random(255), random(255));
line(290, random(180, 400), random(350, 430), random(180, 400));
if (mousePressed) {
stop();
}
}
This is the code to the application, I'm drawing a letter D and i want to draw lines above it but only on the letter itself, not on the white inside and outside of it. Is there any way I can do this?
Answers
At pixel level, probably. Otherwise, probably not. Unless,the line is of the same color as the background, which is not the case.
sure there is a way
and what is that @Chrisir ?
@Krashan --
The concept you are looking for is a mask. In Processing, this is implemented through PImage.mask().
https://processing.org/reference/PImage_mask_.html
Maybe there is a better way (Edited ** I am referring to my post). Here is my attempt:
Kf
I did not know that, thanks for the answer.
Thank you so much!