Good morning. I'm writing an app to display and analyze GPR maps. Unfortunately the maps i've been given are txt files where char 0x00 represents black and 0xFF represents white. The app it's at an early stage and I've managed to display those files on the screen using the following code:
public class DrawMap extends View {
// ...
public void onDraw(Canvas canvas) {
super.onDraw(canvas);
this.paint.setStyle(Paint.Style.FILL);
this.paint.setStrokeWidth(1);
for (int x = 0; x < this.map.getSize(); x++) {
for (int y = 0; y < this.map.getSize(); y++) {
char val = this.map.getPixel(x, y);
this.paint.setColor(Color.argb(0xff, val, val, val));
canvas.drawPoint(10+x, 10+y, this.paint);
}
}
}
}
Since the size (width x height) of the map may vary, it would be easier to draw the map on a Bitmap, or something like that, first, and then display it to fit the size of the screen. I don't know how to achieve that. I need your help, please.