Add Frames or Borders to images in Android

user2047120 picture user2047120 · Feb 18, 2013 · Viewed 12.9k times · Source

I am new in Android Application development, I want to create one application where I can add borders or frames to the images in the gallery. I have searched through some blogs but I didn't get the answer.

i want to create like this https://play.google.com/store/apps/details?id=com.tndev.loveframes&hl=en

Could anyone tell me the idea or any concept about how to do that application?

Answer

Shail Adi picture Shail Adi · Feb 18, 2013

Programmatically :

ImageView i = new ImageView(mContext);
Drawable d = null;
i.setImageDrawable(d);
        i.setAdjustViewBounds(true);
        i.setScaleType(ScaleType.CENTER_INSIDE);
        i.setBackgroundColor(Color.WHITE); //providing color to the background. 
        i.setPadding(3,3,3,3);//providing padding to the image.
        i.setLayoutParams(new Gallery.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));

To overlay one image over another use Canvas class and check these links : Android: How to overlay-a-bitmap/draw-over a bitmap?