ApplyMaskRgb am = new ApplyMaskRgb();
RgbImage rgb = am.Push((RgbImage)rs.Front(), imMask);
g.drawARGB(0, 0, 255, 0); // green
g.drawBitmap(
RgbImageAndroid.toBitmap(rgb),
new Rect(0, 0, rgb.getWidth(), rgb.getHeight()),
new Rect(
(g.getBitmapWidth() - rgb.getWidth())/2,
(g.getBitmapHeight() - rgb.getHeight())/2,
rgb.getWidth(),
rgb.getHeight()),
new Paint());
} else {
RgbImage rgb = (RgbImage) rs.Front();
g.drawARGB(0, 255, 0, 0); // red
g.drawBitmap(
RgbImageAndroid.toBitmap(rgb),
new Rect(0, 0, rgb.getWidth(), rgb.getHeight()),
new Rect(
(g.getBitmapWidth() - rgb.getWidth())/2,
(g.getBitmapHeight() - rgb.getHeight())/2,
rgb.getWidth(),
rgb.getHeight()),
new Paint());