user1352798
user1352798

Reputation: 41

zbar - scanner frame, how to make it in landscape

I have issue in setting the camera/scanner in landscape mode, even i change the screen to landscape, but the camera/scanner still appears to be in vertical.

may i know what should be done to fix this ? on the camera APi or should change on the zbar library ?

Thanks.

Upvotes: 1

Views: 670

Answers (1)

myr0
myr0

Reputation: 47

you have to set the orientation mask for the reader:

reader.supportedOrientationsMask = ZBarOrientationMaskAll;

you can edit the mask in ZBarReaderViewController:

// orientation set support
#define ZBarOrientationMask(orient) (1 << orient)
#define ZBarOrientationMaskAll \
(ZBarOrientationMask(UIInterfaceOrientationPortrait) | \     
ZBarOrientationMask(UIInterfaceOrientationPortraitUpsideDown) | \
ZBarOrientationMask(UIInterfaceOrientationLandscapeLeft) | \
ZBarOrientationMask(UIInterfaceOrientationLandscapeRight))

Upvotes: 1

Related Questions