×

Image loading method and device

  • US 10,719,909 B2
  • Filed: 03/26/2019
  • Issued: 07/21/2020
  • Est. Priority Date: 09/30/2016
  • Status: Active Grant
First Claim
Patent Images

1. An image loading method, comprising:

  • determining whether a native heap memory stores decoded data of a first image to be loaded based on cache record information of the native heap memory, wherein the cache record information of the native heap memory is stored in a Java heap memory, wherein the decoded data of the first image includes pixel array data obtained by decoding the first image;

    in response to determining that the native heap memory stores the decoded data of the first image, loading the first image based on the decoded data of the first image from the native heap memory by;

    determining whether a bitmap object currently displayed on an image view and corresponding to a second image satisfies a reuse condition for the decoded data of the first image by comparing a product of a width of the second image, a height of the second image, and a amount of memory occupied by each pixel of the second image to a data length of the decoded data of the first image, andin response to determining that the bitmap object currently displayed on the image view satisfies the reuse condition, copying the pixel array data from the native heap memory into the bitmap object currently displayed on the image view to obtain a new bitmap object, and rendering the new bitmap object into the image view to load the first image; and

    in response to determining that the native heap memory does not store the decoded data of the first image, loading the first image from a storage space storing the first image, and storing, into the native heap memory, decoded data of the first image obtained in the process of loading the first image.

View all claims
  • 3 Assignments
Timeline View
Assignment View
    ×
    ×