【发布时间】:2019-12-21 23:15:07
【问题描述】:
我想比较带有移动线的演示文稿中的两个图像(相同大小)。在这条线的左侧,应显示一个图像,而在右侧应显示另一张图像。
这是我尝试过的(位图和 ch 是图像)
PImage bitmap;
PImage ch;
int framerate = 1000;
void setup() {
size(502, 316);
bitmap = loadImage("bitmap_zentriert.jpg"); // Load an image into the program
ch = loadImage("Karte_schweiz_zentriert.jpg"); // Load an image into the program
frameRate(40); //framerate
}
void draw() {
background(255);
image(ch, 10, 10); // the one image in the back
image(bitmap, 10, 10, bitmap.width, bitmap.height, 10, 10, mouseX, bitmap.height); //show part of the second image in front
rect(mouseX, 10, 1, bitmap.height-1); //make line
}
但是图像“位图”是整个图像失真的。
我该怎么做?
【问题讨论】:
-
请记住,当事情没有按照您的预期进行时,请仔细检查文档:image() function description 应该清楚说明事情看起来失真的原因。
标签: image processing