/**
* 绘制提示界面(屏幕中心提示框120*90)
*
* @param img提示图片
* @param cueType提示类型(0邮件,1删除,2等待,3错误)
* @param SCREEN_WIDTH屏幕宽度
* @param SCREEN_HEIGHT屏幕高度
* @param g
*/
public static void drawCueCanvas(Image img, int cueType, String[] cueStr,
int SCREEN_WIDTH, int SCREEN_HEIGHT, boolean type, Graphics g) {
// 当前提示图片数量为4;
int imgWidth = img.getWidth() / 4;
int imgHeight = img.getHeight();
// 28
int top_x = SCREEN_WIDTH / 2 - 120 / 2;
// 59
int top_y = SCREEN_HEIGHT / 2 - 90 / 2;
// 绘制黑色边框
g.setColor(0);
g.drawLine(top_x + 5, top_y, top_x + 120 - 5, top_y);
g.drawLine(top_x + 2, top_y + 1, top_x + 120 - 2, top_y + 1);
g.drawLine(top_x + 1, top_y + 2, top_x + 120 - 1, top_y + 2);
g.drawLine(top_x + 1, top_y + 3, top_x + 120 - 1, top_y + 3);
// 中间
g.fillRect(top_x, top_y + 4, 120, 90 - 8);
// 下端
g.drawLine(top_x + 5, top_y + 90, top_x + 120 - 5, top_y + 90);
g.drawLine(top_x + 2, top_y + 89, top_x + 120 - 2, top_y + 89);
g.drawLine(top_x + 1, top_y + 88, top_x + 120 - 1, top_y + 88);
g.drawLine(top_x + 1, top_y + 87, top_x + 120 - 1, top_y + 87);
g.drawLine(top_x + 1, top_y + 86, top_x + 120 - 1, top_y + 86);
// 黄色框
g.setColor(0xFFCC00);
g.drawLine(top_x + 4, top_y + 1, top_x + 120 - 4, top_y + 1);
g.drawLine(top_x + 2, top_y + 2, top_x + 120 - 3, top_y + 2);
g.drawLine(top_x + 1, top_y + 4, top_x + 1, top_y + 90 - 4);
g.drawLine(top_x + 2, top_y + 2, top_x + 2, top_y + 90 - 3);
// 绘制中心黄框
g.setColor(0xFFFFDD);
g.fillRect(top_x + 3, top_y + 3, 114, 84);
g.setColor(0);
if (type) {
for (int i = 0; i < cueStr.length; i++) {
g.drawString(cueStr[i], top_x + 50, top_y + 20 + i
* MainCanvas.FONT_HEIGHT, Graphics.TOP | Graphics.LEFT);
}
g.setClip(top_x + 10, top_y + 10, imgWidth, imgHeight);
// 绘制图片
g.drawImage(img, top_x + 10 - cueType * imgWidth, top_y + 10,
Graphics.TOP | Graphics.LEFT);
} else {
for (int i = 0; i < cueStr.length; i++) {
g.drawString(cueStr[i], top_x + 60, top_y + 65 + i
* MainCanvas.FONT_HEIGHT, Graphics.BASELINE
| Graphics.HCENTER);
}
g.setClip(top_x + 60 - 20, top_y + 10, imgWidth, imgHeight);
// 绘制图片
g.drawImage(img, top_x + 60 - 20 - cueType * imgWidth, top_y + 10,
Graphics.TOP | Graphics.LEFT);
}
g.setClip(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT);
}
* 绘制提示界面(屏幕中心提示框120*90)
*
* @param img提示图片
* @param cueType提示类型(0邮件,1删除,2等待,3错误)
* @param SCREEN_WIDTH屏幕宽度
* @param SCREEN_HEIGHT屏幕高度
* @param g
*/
public static void drawCueCanvas(Image img, int cueType, String[] cueStr,
int SCREEN_WIDTH, int SCREEN_HEIGHT, boolean type, Graphics g) {
// 当前提示图片数量为4;
int imgWidth = img.getWidth() / 4;
int imgHeight = img.getHeight();
// 28
int top_x = SCREEN_WIDTH / 2 - 120 / 2;
// 59
int top_y = SCREEN_HEIGHT / 2 - 90 / 2;
// 绘制黑色边框
g.setColor(0);
g.drawLine(top_x + 5, top_y, top_x + 120 - 5, top_y);
g.drawLine(top_x + 2, top_y + 1, top_x + 120 - 2, top_y + 1);
g.drawLine(top_x + 1, top_y + 2, top_x + 120 - 1, top_y + 2);
g.drawLine(top_x + 1, top_y + 3, top_x + 120 - 1, top_y + 3);
// 中间
g.fillRect(top_x, top_y + 4, 120, 90 - 8);
// 下端
g.drawLine(top_x + 5, top_y + 90, top_x + 120 - 5, top_y + 90);
g.drawLine(top_x + 2, top_y + 89, top_x + 120 - 2, top_y + 89);
g.drawLine(top_x + 1, top_y + 88, top_x + 120 - 1, top_y + 88);
g.drawLine(top_x + 1, top_y + 87, top_x + 120 - 1, top_y + 87);
g.drawLine(top_x + 1, top_y + 86, top_x + 120 - 1, top_y + 86);
// 黄色框
g.setColor(0xFFCC00);
g.drawLine(top_x + 4, top_y + 1, top_x + 120 - 4, top_y + 1);
g.drawLine(top_x + 2, top_y + 2, top_x + 120 - 3, top_y + 2);
g.drawLine(top_x + 1, top_y + 4, top_x + 1, top_y + 90 - 4);
g.drawLine(top_x + 2, top_y + 2, top_x + 2, top_y + 90 - 3);
// 绘制中心黄框
g.setColor(0xFFFFDD);
g.fillRect(top_x + 3, top_y + 3, 114, 84);
g.setColor(0);
if (type) {
for (int i = 0; i < cueStr.length; i++) {
g.drawString(cueStr[i], top_x + 50, top_y + 20 + i
* MainCanvas.FONT_HEIGHT, Graphics.TOP | Graphics.LEFT);
}
g.setClip(top_x + 10, top_y + 10, imgWidth, imgHeight);
// 绘制图片
g.drawImage(img, top_x + 10 - cueType * imgWidth, top_y + 10,
Graphics.TOP | Graphics.LEFT);
} else {
for (int i = 0; i < cueStr.length; i++) {
g.drawString(cueStr[i], top_x + 60, top_y + 65 + i
* MainCanvas.FONT_HEIGHT, Graphics.BASELINE
| Graphics.HCENTER);
}
g.setClip(top_x + 60 - 20, top_y + 10, imgWidth, imgHeight);
// 绘制图片
g.drawImage(img, top_x + 60 - 20 - cueType * imgWidth, top_y + 10,
Graphics.TOP | Graphics.LEFT);
}
g.setClip(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT);
}