Blackberry - how to resize image?

后端 未结 8 1974
栀梦
栀梦 2020-11-30 05:11

I wanted to know if we can resize an image. Suppose if we want to draw an image of 200x200 actual size with a size of 100 x 100 size on our blackberry screen.

Thanks

8条回答
  •  有刺的猬
    2020-11-30 05:38

    in this there is two bitmap.temp is holding the old bitmap.In this method you just pass
    bitmap ,width,height.it return new bitmap of your choice.
    
      Bitmap ImgResizer(Bitmap bitmap , int width , int height){
        Bitmap temp=new Bitmap(width,height);
        Bitmap resized_Bitmap = bitmap;
        temp.createAlpha(Bitmap.HOURGLASS);
        resized_Bitmap.scaleInto(temp , Bitmap.FILTER_LANCZOS);
        return temp;
    }
    

提交回复
热议问题