Convert camera Size To Int using Bit - Android Camera

Android examples for Camera:Camera Size

Description

Convert camera Size To Int using Bit

Demo Code


//package com.java2s;

public class Main {
    public static int cameraSizeToInt(int width, int height) {
        int iSize = 0x00000000 | width;
        iSize = iSize | (height << 16);
        return iSize;
    }//from w w  w  .  j a  va2s  .co  m
    public static int intToCameraWidth(int size) {
        return size & 0x0000ffff;
    }
    public static int intToCameraHeight(int size) {
        return size >> 16;
    }    
}

Related Tutorials