为此,我在这里写了一些人告诉我使用一种叫做"bitmap.getPixel(int x, int y)“的方法,它给出了像素的颜色。为了控制,如果点击没有触摸到手,我写"bitmap.getPixel(x, y) != Color.TRASPARENT",但不能完美地工作。在此下面我编写了SurfaceView的代码。switch(event.getAction()) case MotionEvent.ACTION_DOWN:
int c = hand.sprite.g
我正试着用Roboelectic通过位图和Getpixel方法运行一些测试:((BitmapDrawable)Robolectric.application.getResources().getDrawable(R.drawable.color_test_1)).getBitmap().getPixel(100,100);,但是不管我怎么尝试,我总是得到0作为颜色。bm.getPixels(pixels, 0, 10, 0, 0, 10, 10); int p =