java - No enclosing instance of type Camera is accessible -
hi developing application need use camera , i'm having problem on code:
no enclosing instance of type camera accessible. must qualify allocation enclosing instance of type camera (e.g. x.new a() x instance of camera) on line "this.presize_ = new camera(0,0); help? or suggestion?
private void setupcamera() { this.camera_ = camera.open(); camera localcamera = this.camera_; localcamera.getclass(); this.presize_ = new camera.size(0,0); camera.parameters localparameters = this.camera_.getparameters(); iterator<camera.size> localiterator1 = localparameters.getsupportedpreviewsizes().iterator(); camera.size localsize2; { if (!localiterator1.hasnext()) break; localsize2 = (camera.size)localiterator1.next(); this.presize_ = localsize2; } while ((localsize2.width != this.previewwidth) && (localsize2.height != this.previewheight)); localparameters.setpreviewsize(this.presize_.width, this.presize_.height); iterator<camera.size> localiterator2 = localparameters.getsupportedpicturesizes().iterator(); camera.size localsize1; { if (!localiterator2.hasnext()) break; localsize1 = (camera.size)localiterator2.next(); this.procsize_ = localsize1; } while ((localsize1.width != this.processwidth) && (localsize1.height != this.processheight)); localparameters.setpicturesize(this.procsize_.width, this.procsize_.height); this.camera_.setparameters(localparameters); this.camera_.setdisplayorientation(90); try { this.camera_.setpreviewdisplay(this.surfaceholder_); this.camera_.startpreview(); return; } catch (exception localexception) { while (true) localexception.printstacktrace(); } }
size class non-static class of camera. can create enclosing instance of camera class. this:
this.presize_ = localcamera.new size(0,0);
Comments
Post a Comment