Android Draw Circle Pixel by Pixel
问题 I am trying to draw a circle on my bitmap, pixel by pixel, using this code: for(int j = ((int)x - 20); j < ((int)x + 20); j++){ for(int k = ((int)y - 20); k < ((int)y + 20); k++){ int colorX = bitmap.getPixel((int)j, (int)k); if(Color.red(colorX) == 0 && Color.green(colorX) == 0 && Color.blue(colorX) == 0){ if(Math.sqrt(((j - (( int ) x )) ^ 2 ) + ((k - (( int ) y )) ^ 2) ) <= 20) bitmap.setPixel(j, k, Color.YELLOW); } } } But there is a problem, this is not drawing a circle.. it looks like a