Namespaces

Variants
Actions

Please note that as of October 24, 2014, the Nokia Developer Wiki will no longer be accepting user contributions, including new entries, edits and comments, as we begin transitioning to our new home, in the Windows Phone Development Wiki. We plan to move over the majority of the existing entries over the next few weeks. Thanks for all your past and future contributions.

Como mostrar a câmera e tirar fotos em Java ME

From Wiki
Jump to: navigation, search
Article Metadata

Artigo
Tradução:
Por maiconherverton
Última alteração feita por lpvalente em 05 Jan 2014

Este artigo mostra como abrir a câmera e tirar fotos, usando Java ME.

O código a seguir é usado para mostrar a câmera no display:

public void cameraPlayer() {
try {
player = Manager.createPlayer("capture://video");
player.realize();
 
videoControl = (VideoControl)player.getControl("VideoControl");
player.start();
} catch (Exception e) {}
}


O código a seguir é usado para capturar imagens usando a câmera em Java ME:

byte[] raw = videoControl .getSnapshot(null);
Image image = Image.createImage(raw, 0, raw.length);

TODO: listar os modos disponíveis, e quando você precisar usar um localizador diferente

Link's úteis:

http://developers.sun.com/mobility/midp/articles/picture/

http://www.java-tips.org/java-me-tips/midp/capturing-video-on-j2me-devices.html

This page was last modified on 5 January 2014, at 15:04.
226 page views in the last 30 days.

Was this page helpful?

Your feedback about this content is important. Let us know what you think.

 

Thank you!

We appreciate your feedback.

×