/*** Irregular "graphic button control" **/public class trapezoidimagebutton extends imagebutton {public trapezoidimagebutton (context, attributeset attrs, int defstyle) {super (context, attrs, defstyle);} public trapezoidimagebutton (context, attributeset attrs) {super (context, attrs);} public trapezoidimagebutton (context) {super (context );} @ override public Boolean ontouchevent (motionevent Event) {If (istouchpointinview (event. getx (), event. Gety () | event. getaction ()! = Motionevent. action_down) {return Super. ontouchevent (event);} else {return false;} protected Boolean istouchpointinview (float localx, float localy) {Bitmap bitmap = bitmap. createbitmap (getwidth (), getheight (), config. argb_8888); canvas = new canvas (Bitmap); Draw (canvas); int x = (INT) localx; int y = (INT) localy; if (x <0 | x> = getwidth () return false; If (Y <0 | Y> = getheight () r Eturn false; int pixel = bitmap. getpixel (x, y); If (pixel & 0xff000000 )! = 0) {// return true in the non-transparent area;} else {return false ;}}}