1 //建立逻辑坐标系
2 paint.setARGB(255, 255, 0, 0);
3 paint.setStrokeWidth(3);
4 canvas->drawLine(0, 0, bitmap->width(), 0, paint);
5 canvas->drawLine(0, 0, 0, bitmap->height(), paint);
6
7 paint.setARGB(255, 255, 200, 200);
8 canvas->drawText("X/2", 4, bitmap->width() / 2 + 10, 10, paint);
9 canvas->drawText("Y/2", 4, 5, bitmap->height() / 2, paint);
10
11 paint.setARGB(255, 255, 200, 0);
12 canvas->drawText("X", 2, bitmap->width()-10, 10, paint);
13 canvas->drawText("Y", 2, 5, bitmap->height(), paint);