error with setPixels

前端 未结 5 1656
清歌不尽
清歌不尽 2020-12-17 08:48

i am trying to edit images. but i am getting errors with setPixels.

        picw = pic.getWidth();
        pich = pic.getHeight();
        picsize = picw*pic         


        
5条回答
  •  离开以前
    2020-12-17 09:34

    I was facing this problem and finally fixed after long time.

    public static void filterApply(Filter filter){
        Bitmap bitmcopy = PhotoModel.getInstance().getPhotoCopyBitmap();
        //custom scalling is important to apply filter otherwise it will not apply on image
        Bitmap scaledBitmap = Bitmap.createScaledBitmap(bitmcopy, bitmcopy.getWidth()-1, bitmcopy.getHeight()-1, false);
        filter.processFilter(scaledBitmap);
        filterImage.setImageBitmap(scaledBitmap);
    }
    

提交回复
热议问题