I`m developing OCR app on Vuzix. I need to create rectangular bound in Surface view. My problem is image from camera was rotated 90 degree when using “Surface View”( It has no problem when use this app on Android Phone )
- Can I rotate image from Surface View ?
- Can I download Surface view extension as Java file ? (Is it open source ?)
- Use “Save Preview As File” then rotate it with Image Block in “SurfaceView.GotPreview”, then show it in Canvas.
-> Failed: It`s look like the Image was rotated only Image block. Canvas was not updated.
- When I show image from “Surface.GotPreview”, Image was rotated 90 degree again. That’s mean the image was rotated 180 degree from original.
myappvuzix.aia (16.6 KB)
there is two methods to rotate a view.
setRotation()(For all Views) method
For more details -
Use Animation like this
// Locate view
ImageView diskView = (ImageView) findViewById(R.id.imageView3);
// Create an animation instance
Animation an = new RotateAnimation(0.0f, 360.0f, pivotX, pivotY);
// Set the animation's parameters
an.setDuration(10000); // duration in ms
an.setRepeatCount(0); // -1 = infinite repeated
an.setRepeatMode(Animation.REVERSE); // reverses each repeat
an.setFillAfter(true); // keep rotation after animation
// Aply animation to image view
No, it is not open source. you can’t download it