1. Download our Official Android App: Forums for Android!

Apps Help!!! (Image Manipulation)

Discussion in 'Android Development' started by SWhite, Sep 17, 2010.

  1. SWhite

    SWhite Newbie
    Thread Starter
    Rank:
    None
    Points:
    16
    Posts:
    17
    Joined:
    Apr 15, 2010

    Apr 15, 2010
    17
    1
    16
    Student, Developer
    Louisiana
    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!!!!!!

    :thinking:
     

    Advertisement

  2. Irrelephant

    Irrelephant Lurker
    Rank:
    None
    Points:
    5
    Posts:
    3
    Joined:
    Sep 6, 2010

    Sep 6, 2010
    3
    0
    5
    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 (Text):
    1. ViewGroup mLinearLayout = new LinearLayout(this);
    Put all your pictures in the drawable resource thingy and add this:
    Code (Text):
    1.         ImageView i = new ImageView(this);
    2.         i.setImageResource(R.drawable.image_name);
    3.         i.setAdjustViewBounds(true);
    4.         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 (Text):
    1.         mLinearLayout.addView(i);
    2.         setContentView(mLinearLayout);
    Aaaaand I'm outta here. Good luck.
     

Share This Page

Loading...