Java Android在可触摸区域绘图

Java Android在可触摸区域绘图,java,android,image,touch,draw,Java,Android,Image,Touch,Draw,我想得到一些关于如何做一些事情的提示,比如画笔windows应用程序 当用户触摸我想要绘制的可触摸区域时,会有一个具有可触摸区域的图像(如何在图像上定义可触摸区域?),就像使用不同颜色的画笔一样(如何在android上绘制?我应该使用哪个小部件?imageview?) 这里有一些图片可以帮助你 触摸前: 触摸后: 我不是在寻找整个解决方案,我在寻找一些提示,也许还有一些片段。 提前多谢;) 编辑: 高级问题:我还想测量字母上方的触摸有多好,如果不够好,我想知道,可能是做可触摸区域和不可触摸区

我想得到一些关于如何做一些事情的提示,比如画笔windows应用程序

当用户触摸我想要绘制的可触摸区域时,会有一个具有可触摸区域的图像(如何在图像上定义可触摸区域?),就像使用不同颜色的画笔一样(如何在android上绘制?我应该使用哪个小部件?imageview?)

这里有一些图片可以帮助你

触摸前:

触摸后:

我不是在寻找整个解决方案,我在寻找一些提示,也许还有一些片段。 提前多谢;)

编辑:
高级问题:我还想测量字母上方的触摸有多好,如果不够好,我想知道,可能是做可触摸区域和不可触摸区域,并计算其中一个,并得出一个百分比?谢谢

这将对ofc有所帮助!我该怎么画黄色画笔之类的东西呢?谢谢
One way is use get the color where user touched and compare that with the touchable area here (gray) in your case. If the pixel color is gray means user is touching at right spot if white that means untouchable area 

You can get the pixel color like this-

imageView.setOnTouchListener(new OnTouchListener(){
        @Override
        public boolean onTouch(View v, MotionEvent event){
        int x = (int)event.getX();
        int y = (int)event.getY();
        int pixel = bitmap.getPixel(x,y);

        //then do what you want with the pixel data, e.g
        int redValue = Color.red(pixel);
        int blueValue = Color.blue(pixel);
        int greenValue = Color.green(pixel);        
        return false;
        }
   });


Hope this helps