나는이 바보 같은 질문을 안다.하지만 나는 튜토리얼을 살펴 보았고, 아래의 코드 줄을 이해하는 것만 같다. 내 머리카락이이 기하학적 알고리즘을 이해하고, 하지만 ..... 오 !!! 이것은 아주 간단하다 그러나 나는 다만 그것을 얻는 것을 보이지 않는다. 제발 도와주세요 .... 나는기하학적 개념에 대한 설명
private void drawPict(Canvas canvas, int x, int y, int w, int h,
float sx, float sy) {
canvas.save();
canvas.translate(x, y);
canvas.clipRect(0, 0, w, h);
canvas.scale(0.5f, 0.5f);
canvas.scale(sx, sy, w, h);
canvas.drawPicture(mPicture);
canvas.restore();
}
@SuppressWarnings("unused")
@Override
protected void dispatchDraw(Canvas canvas) {
super.dispatchDraw(mPicture.beginRecording(getWidth(), getHeight()));
mPicture.endRecording();
int x = getWidth()/2;
int y = getHeight()/2;
if (false) {
canvas.drawPicture(mPicture);
} else {
drawPict(canvas, 0, 0, x, y, 1, 1);
drawPict(canvas, x, 0, x, y, -1, 1);
drawPict(canvas, 0, y, x, y, 1, -1);
drawPict(canvas, x, y, x, y, -1, -1);
}
}
나는 다시 들여다 ... 그리고 canvas.scale 내가 가정 점의 좌표 인 4 개 매개 변수를 가지고 있음을 이해합니다 ... 초보자입니다. ..하지만 나는 아직도 float sx를 이해할 수 없다. float sy ...
sx = -1 그리고 sy = 1 ... 그것은 확장 될 것이고 동의하지만 ... 더 좋은 방법은 없을까?
흠 ...... 감사합니다 !!! 많이 설명해. –