This is my take to the "real" question:
CNC, as I guess 90% of us know, stands for "Computerized Numerical Control" machines. These can be things as a Industrial 5-axis multi-tool CNC, to a "simple" XY lazer engraver or plotter.
So, taking as a starting point the simplest XY lazer engraver, the first thing you need to establish is the workplate size and how it will scale in the screen.
Then, its a matter of "mapping" every non white point coordinate. You will also need to establish if your tool moves will be relative to last position or absolute coordinates.
The mapping can be done by converting your workplate into a canvas and sweep it to find the pixels.
This, to me, is the simplest...
And yes, B4A can do anything you wish, as long as YOU, the developer, have the needed skills to do it