使用 DraweeController 与 Fresco 进行 JPEG 流式处理
此示例假定你已将 Fresco 添加到你的应用程序中(请参阅此示例 ):
SimpleDraweeView img = new SimpleDraweeView(context);
ImageRequest request = ImageRequestBuilder
.newBuilderWithSource(Uri.parse("http://example.com/image.png"))
.setProgressiveRenderingEnabled(true) // This is where the magic happens.
.build();
DraweeController controller = Fresco.newDraweeControllerBuilder()
.setImageRequest(request)
.setOldController(img.getController()) // Get the current controller from our SimpleDraweeView.
.build();
img.setController(controller); // Set the new controller to the SimpleDraweeView to enable progressive JPEGs.