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

Apps Help!!! (Image Manipulation)

SWhite

Newbie
I am trying to create one large image to display as a background from smaller images. Think of it as a collage. Take pictures set them next to each other and stick'em together with tape.

Problem is i cant figure out how this is done in android or java.

HELP!!!!!!

:confused:
 
Well I'm actually kinda new to Java and XML, but I know something you could try. In your java file, make a linear layout like this'n right here.

Code:
ViewGroup mLinearLayout = new LinearLayout(this);

Put all your pictures in the drawable resource thingy and add this:
Code:
        ImageView i = new ImageView(this);
        i.setImageResource(R.drawable.image_name);
        i.setAdjustViewBounds(true); 
        i.setLayoutParams(new Gallery.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));

There's one picture. I'm sure you could figure out a way to add a bunch more using that. I'm not sure, I'm probably not helping lol whatever. Use this to add it to the UI.

Code:
        mLinearLayout.addView(i);
        setContentView(mLinearLayout);

Aaaaand I'm outta here. Good luck.
 
Back
Top Bottom