Help!!! (Image Manipulation)


Last Updated:

  1. SWhite

    SWhite Member This Topic's Starter

    Joined:
    Apr 15, 2010
    Messages:
    17
    Likes Received:
    1
    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:
     

    Advertisement
  2. Irrelephant

    Irrelephant New Member

    Joined:
    Sep 6, 2010
    Messages:
    3
    Likes Received:
    0
    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...