Shikhar13 / codenameone

Automatically exported from code.google.com/p/codenameone
0 stars 0 forks source link

Capture.capturePhoto() function for J2ME phones #315

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Can anyone give me sample example for capturing images using 
Capture.capturePhoto(); function or by other way.
I tried following code on some J2ME handsets

Capture.capturePhoto(new ActionListener() {

                        public void actionPerformed(ActionEvent evt) {
                            try {
                                String src = (String) evt.getSource();
                                Label l;
                                if(src==null)
                                    l= new Label("No Image Captured");
                                else
                                    l= new Label(Image.createImage(src));
                                Button b = new Button("close");
                                b.addActionListener(new ActionListener() {

                                    public void actionPerformed(ActionEvent evt) {
                                        dialog.dispose();
                                    }
                                });
                                dialog.addComponent(l);
                                dialog.addComponent(b);
                                dialog.show();
                            } catch (Exception ex) {
                                ex.printStackTrace();
                            }

                        }
                    });

but its not working on any of them.
Thanks in advance..

Original issue reported on code.google.com by abhishek...@gmail.com on 4 Sep 2012 at 9:12

GoogleCodeExporter commented 9 years ago
I understand this is already resolved.

Original comment by shai.almog on 4 Sep 2012 at 5:22