fresco icon indicating copy to clipboard operation
fresco copied to clipboard

Use new ResizeOptions invalid

Open libanghui opened this issue 11 years ago • 3 comments

Uri sourceUri =  Uri.parse("content://media/external/images/media/"  
                + item.imageList.get(0).imageId);
        GenericDraweeHierarchy genericDraweeHierarchy = new GenericDraweeHierarchyBuilder(
                act.getResources())
                .setPlaceholderImage(Drawables.sPlaceholderDrawable)
                .setFailureImage(Drawables.sErrorDrawable)
                // .setRoundingParams(RoundingParams.asCircle())
                .setRoundingParams(RoundingParams.fromCornersRadius(10))
                .setActualImageScaleType(ScaleType.CENTER_CROP)
                // .setProgressBarImage(new ProgressBarDrawable())
                .setPressedStateOverlay(Drawables.pressDrawable).build();
        holder.iv.setHierarchy(genericDraweeHierarchy);
        ImageRequest imageRequest = ImageRequestBuilder
                .newBuilderWithSource(sourceUri)
                .setResizeOptions(
                        new ResizeOptions(Device.getWidth() / 6, Device.getWidth()/6)).build();
        DraweeController draweeController = Fresco
                .newDraweeControllerBuilder().setImageRequest(imageRequest)
                .setOldController(holder.iv.getController())
                // .setControllerListener(simpleDraweeView.getListener())
                .setAutoPlayAnimations(false).build();
        holder.iv.setController(draweeController);

libanghui avatar Apr 26 '15 12:04 libanghui

I load the local picture, no matter what size I am down to is invalid, but the display picture clarity

Document which said that only support scaling jpeg format, but I saw the picture on my phone is jpeg's, If the other mobile phone sent to me is that you can zoom in, if I can not beat myself up My phone is Samsung s4

libanghui avatar Apr 26 '15 12:04 libanghui

Is your problem:

  1. the images do not load at all? or 2) the images do load, but are unclear?

I also do not recognize the Device class you are using. Try this instead:

DisplayMetrics metrics = new DisplayMetrics();
getWindowManager().getDefaultDisplay().getMetrics(metrics);
... newResizeOptions(metrics.widthPixels / 6, metrics.widthPixels / 6)...

tyronen avatar Apr 27 '15 10:04 tyronen

reaping

plamenko avatar Jul 08 '15 13:07 plamenko