制作半透明的提示框
关键是要生成半透明的背景,我的方法是生成三条半透明的图线
// 生成用于提示的半透明背景图int w = getWidth() - 8;int[] imgInts = new int[w];for (int i = 0; i < w; i++) {imgInts[i] = 0xb0008000;}lineImg0 = Image.createRGBImage(imgInts, w, 1, true);lineImg1 = Image.createRGBImage(imgInts, w - 2, 1, true);lineImg2 = Image.createRGBImage(imgInts, w - 4, 1, true);
为什么要用三条图线呢,注意提示框的四个角,第一条线是短了两个象素的,第二条是少了一个象素的,圆角的效果就出来了! 1 楼 jyasa 2009-07-27 恩,谢谢楼主分享,东西不错
呵呵