*sharath* 0 Junior Poster in Training

I am trying to dynamically resize an image which is in the relative layout using the code

int height = v.getHeight();
   int width = v.getWidth();
height += 50;
width += 50; 
RelativeLayout.LayoutParams layout = new RelativeLayout.LayoutParams(height, width);
layout.setMargins(200, 200, 200, 200);
layout.addRule(RelativeLayout.CENTER_IN_PARENT);
    v.setLayoutParams(layout);

The rule works perfectly. The image gets placed in the center but what i want to get is the image should be placed where it is. That is if the image is at the location (100,100) it's size should be increased and the image should be placed at the same location or the location where i need to place it. Can anyone suggest me please.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.