AFIANL frame inside the finalbitmap load network picture

Source: Internet
Author: User

in the afianl Frame, Finalbitmap How to load a network picture ? Is there any easy way? Now let the Wheat Academy's android development teacher Talk about the Afina framework inside the finalbitmap Load Network picture method ,afinal inside finalbitmap: Used to visualize bitmap images without thinking about thread concurrency and oom and other questions.

1. Test Pleading

Use the page to open http://avatar.csdn.net/C/6/8/1_bz419927089.jpg " you can see an image.

2. new finalbitmap Target

1

Finalbitmap bitmap = Finalbitmap.create (this);

3. Set the URI address of the image

1

String uri = "http://avatar.csdn.net/C/6/8/1_bz419927089.jpg";

4. Loading Images

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21st

22

Privateimageview IV;

iv= (ImageView) Findviewbyid (R.id.imageview);

// Initialize images that appear when loading

Bitmap loadingbitmap = Bitmapfactory.decoderesource (Getresources (), R.DRAWABLE.SNAPSHOTMG);/* R.DRAWABLE.SNAPSHOTMG for tacit display of images * *

// Initialize the image to load the failed display

Bitmap failbitmap = Bitmapfactory.decoderesource (Getresources (), R.DRAWABLE.SNAPSHOTMG);

/// The first method: Image is the control to show the image

Bitmap.display (iv, URI);

/// second method:loadingbitmap is the image that appears when loading

//bitmap.display (iv, Uri, LOADINGBITMAP);

/// Third method:loadingbitmap for loading the image,failbitmap for loading the losing image

//Bitmap.display (iv, URI, Loadingbitmap, failbitmap);

// Fourth method: We can also set the size of the loaded image

//bitmap.display (iv, URI, +, +);

/// Fifth method: Set the size of the loaded image and the load and load the lost image

//bitmap.display (iv, URI, +, +, Loadingbitmap, failbitmap);

The above mentioned is the whole content of this article, we hope we can enjoy.

For Android app Development tutorial, go to: Http://www.maiziedu.com/course/android/

AFIANL frame inside the finalbitmap load network picture

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.