text Alphabet.pde
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了text Alphabet.pde相关的知识,希望对你有一定的参考价值。
PImage img, img1, img2, img3, img4; // Declare a variable of type PImage
int bigdistance = 2000;
int distance = 100;
int gridpoints = (bigdistance/distance);
int picheight = 210,picwidth = 210;
String string1 = "the0tsuvi0are0slavers";
int numberofcharacters = string1.length();
int x = picwidth/2;
int y = (height/2)+(picwidth/2);
int h = 1;
static final color BG = -3;
void setup() {
size(6000,1000);
imageMode(CENTER);
noLoop();
}
void draw() {
background(BG);
for (int j = 0; j < numberofcharacters; j++){
pushMatrix();
string1.charAt(j);
img = loadImage(string1.charAt(j)+"i.png");
img.resize(picheight,picwidth);
translate(x,y);
if ((h % 2) == 0){
rotate(radians(180));
}
image(img,0,0);
h++;
x += distance;
popMatrix();
/*saveTransparentCanvas(BG, "umimg");*/
}
PImage text = get(0,0,((picwidth*numberofcharacters)),(picwidth*2));
text.save("text.png");
saveTransparentCanvas(BG, "img");
println("Ready");
}
void mousePressed() {
// Pass same color used for background():
saveTransparentCanvas(BG, "img");
}
void saveTransparentCanvas(final color bg, final String name) {
final PImage canvas = get(0,0,((distance*numberofcharacters)+picwidth),(picwidth+(picwidth/2)));
canvas.format = ARGB;
final color p[] = canvas.pixels, bgt = bg & ~#000000;
for (int i = 0; i != p.length; ++i) if (p[i] == bg) p[i] = bgt;
canvas.updatePixels();
canvas.save(string1 + ".png");
}
以上是关于text Alphabet.pde的主要内容,如果未能解决你的问题,请参考以下文章
<!-- text --> 和 /* text */ 注释有啥区别?
VB中 如何复制Text1.text的字体到剪贴板? 如何剪切?
VB 加减乘除
text-decoration:[ text-decoration-line ] || [ text-decoration-style ] || [ text-decoration-color ]
.text 和 .get_text() 之间的区别
javascript或css:如何隐藏标签内的文本中的任何数字,后跟点前缀“1.text”,“2.text”...“30.text”