Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @Override
- protected void onDraw(Canvas canvas) {
- super.onDraw(canvas);
- Bitmap bitmap = ((BitmapDrawable)this.getDrawable()).getBitmap();
- final int w = bitmap.getWidth();
- final int h = bitmap.getHeight();
- int pixel;
- int redValue;
- int blueValue;
- int greenValue;
- for (int x = 0; x < w; x++) {
- for (int y = 0; y < h; y++) {
- pixel = bitmap.getPixel(x, y);
- redValue = Color.red(pixel);
- blueValue = Color.blue(pixel);
- greenValue = Color.green(pixel);
- if (redValue == 255 && greenValue == 254 && blueValue == 0){
- Paint paint = new Paint();
- paint.setColor(Color.BLACK);
- paint.setTextSize(35);
- canvas.drawText("Some Text", x, y, paint);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement