• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps Error empty height width

pietjuhhh1990

Well-Known Member
I want an generated bitmap to show in an imageview.

values of vars
cameraWidth = 360
cameraHeight = 480
rgb = int[] for color codes

al vars ar confirmed.

this is the code
Code:
public void runBitmap(int cameraWidth, int cameraHeight){
        Bitmap bmp = Bitmap.createBitmap(rgb, cameraHeight, cameraWidth, Bitmap.Config.RGB_565);
        ImageView mBitmapPreview = ((ImageView) findViewById(R.id.imageView1));
        try {        
            mBitmapPreview.setImageBitmap(bmp);
        } catch (Exception e){
            e.printStackTrace();
        }
    }
I included an image where you can see the value of heigt an width is -1.
How can i fix this?

63414528.png

63414528.png
 
Back
Top Bottom