java - How to draw a line on the camera screen with j2me? -
Currently I am developing an application to decode barcode using mobile phone.
How do I have a problem to capture a line or a square on the camera screen to easily capture the barcode
What is the easiest way to do this? Unfortunately this is not as easy as it sounds as easy if you have a preview with the phone's camera.
Image, it is often provided as an overlay, this means that the camera preview image does not actually create any part of the canvas of your application and you can not interact directly with pixels. The phone only pulls previews of your appliance completely above your apples.
If you draw a line on your screen, then this preview will be drawn under the image.
The path around it is not very beautiful. You really need to capture an image from the camera. Unfortunately it means capturing JPEG or PNG file in a byte buffer. You can then load this image using Image.createImage and render it on the screen. Then you can safely draw on top of it.
It also has an undesirable negative side to giving you a frightening frame-rate. You might want to calculate all the possible file formats that you can capture and try them all to see the fastest of them.
Comments
Post a Comment