android - Enlarging the width of a bitmap -
i wrote acode create width of abitmap bigger when apply it, width bigger size of entire image smaller,, please help me code :
public void max (view v){ bmpnew = bitmap.createbitmap( bmp1.getwidth()*3, bmp1.getheight()*3, bitmap.config.argb_8888); bmpnew = bmpnew.copy(bitmap.config.argb_8888 ,true); int a=0; /////x bmp1 int b=0; /////y bmp1 int h=0; /////x bmpnew int k=0; /////y bmpnew while (b<= hight-1){ while( a<=width-1){ int colorr= bmp1.getpixel(a, b); bmpnew.setpixel(h, k, colorr); bmpnew.setpixel(h+1, k, colorr); h+=2; a++; } b++; k++; a=0; h=0; } iv.setimagebitmap(bmpnew);
why scale bitmap yourself? can utilize bitmap.createscaledbitmap().
android
No comments:
Post a Comment