CN108681472A - Picture loading method, device and electronic equipment - Google Patents
Picture loading method, device and electronic equipment Download PDFInfo
- Publication number
- CN108681472A CN108681472A CN201810476212.5A CN201810476212A CN108681472A CN 108681472 A CN108681472 A CN 108681472A CN 201810476212 A CN201810476212 A CN 201810476212A CN 108681472 A CN108681472 A CN 108681472A
- Authority
- CN
- China
- Prior art keywords
- bitmap file
- institute
- file
- bitmap
- loading
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/445—Program loading or initiating
- G06F9/44521—Dynamic linking or loading; Link editing at or after load time, e.g. Java class loading
- G06F9/44526—Plug-ins; Add-ons
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/445—Program loading or initiating
- G06F9/44521—Dynamic linking or loading; Link editing at or after load time, e.g. Java class loading
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/451—Execution arrangements for user interfaces
Abstract
The invention discloses a kind of picture loading method, device and electronic equipments.This method includes:The bitmap file for obtaining Target Photo to be loaded, determines whether bitmap file meets preset loading environment;When bitmap file does not meet loading environment, coded treatment is re-started to bitmap file, obtains the new bitmap file for meeting loading environment;Bitmap file is stored in the application memory of corresponding destination application, is used when loading Target Photo for destination application.According to the present invention, picture load failure is avoided the occurrence of so that application program, which can effectively Load Image, shows corresponding application interface, promotes user experience.
Description
Technical field
The present invention relates to field of computer technology, are set more particularly, to a kind of picture loading method, device and electronics
It is standby.
Background technology
Application program is corresponding to provide with user's progress human-computer interaction by loading corresponding picture presentation application interface
Application function.
Different users can use different types of electronic equipment, install identical application program and run using acquisition pair
The application function answered.During some user's uses, the application interface of application rollouts will appear the failure that Loads Image
Phenomenon, for example, when running application program using the user of the mobile phone of certain types, it is found that scheme in the application interface of displaying
Mark is displayed without the case where coming or becoming black icon.
Invention content
It is an object of the present invention to provide a kind of new solutions for Loading Image.
According to the first aspect of the invention, a kind of picture loading method is provided, wherein including:
The bitmap file for obtaining Target Photo to be loaded, determines whether institute's bitmap file meets preset load item
Part;
When institute's bitmap file does not meet the loading environment, coded treatment is re-started to institute's bitmap file, is obtained
Meet the new bitmap file of the loading environment;
Institute's bitmap file is stored in the application memory for the destination application for needing to load the Target Photo, with
It is used when loading the Target Photo for the destination application.
Optionally,
The loading environment, which is institute's bitmap file, has preset target code format;
The step of whether determining institute's bitmap file meets preset loading environment include:
Parsing institute bitmap file obtains corresponding byte stream, determines and whether there is key parameter, institute in the byte stream
It states key parameter and includes at least one of transparency parameter or color mode parameter;
When there are when the key parameter, determine institute's bitmap file with the target code lattice in the byte stream
Formula meets the loading environment;
When the key parameter is not present in the byte stream, determine that institute's bitmap file does not have the target code
Format does not meet the loading environment.
Optionally,
The loading environment is that institute's bitmap file and corresponding sample bitmap file are with uniformity;
The step of whether determining institute's bitmap file meets preset loading environment include:
Based on preset target code format, the sample bitmap file of the Target Photo is generated;
Compare all bytes of institute's bitmap file and the sample bitmap file;
When institute's bitmap file is identical as all bytes of sample bitmap file, institute's bitmap file and institute are determined
It is with uniformity to state sample file, meets the loading environment;
When institute's bitmap file and the sample bitmap file are there are when byte is different or file size difference, institute is determined
Bitmap file does not have consistency with the sample file, does not meet the loading environment.
Optionally,
The target code format is Bitmap.Config.ARGB_8888 formats.
Optionally, the method further includes:
Obtain the memory usage of the application memory;
When the memory usage is more than preset occupancy threshold value, carried out after institute's bitmap file is carried out compression processing
It preserves.
Optionally, described the step of bitmap file is carried out compression processing, includes:
Institute's bitmap file is recompiled as the new bitmap file with prescribed coding format.
Optionally, the prescribed coding format is Bitmap.Config.ARGB_565 formats.
Optionally, the method further includes:
When the memory usage is more than preset occupancy threshold value, institute's bitmap file is stored in anonymous shared drive
In;
And/or
When the memory usage is more than preset occupancy threshold value, release meets preset release in the application memory
After putting the process or task of memory conditions, implement the preservation bitmap file the step of.
The second aspect of the present invention provides a kind of picture loading device, wherein including:
Pretreatment unit is loaded, the bitmap file for obtaining Target Photo to be loaded determines that institute's bitmap file is
It is no to meet preset loading environment;
Coding processing unit, for working as, bitmap file does not meet the loading environment, is carried out to institute's bitmap file
Coded treatment obtains the new bitmap file for meeting the loading environment;
File storing unit, for institute's bitmap file to be stored in the destination application that need to load the Target Photo
Application memory in, so that the destination application loads the Target Photo.
According to the third aspect of the invention we, a kind of electronic equipment is provided, including:
Memory, for storing executable instruction;
Processor is executed for according to the control of the executable instruction, running the electronic equipment such as the present invention the
On the one hand the picture loading method described in any one provided.
According to one embodiment of present invention, by obtaining the bitmap file of picture to be loaded, determine that bitmap file is not inconsistent
When closing loading environment, coded treatment is re-started to bitmap file and obtains the new bitmap file for meeting loading environment, and is preserved
It in the application memory of corresponding application program, is used when Loading Image for application program, avoids the occurrence of picture load failure, make
Application program can effectively Load Image the corresponding application interface of displaying, promote user experience.
By referring to the drawings to the detailed description of exemplary embodiment of the present invention, other feature of the invention and its
Advantage will become apparent.
Description of the drawings
It is combined in the description and the attached drawing of a part for constitution instruction shows the embodiment of the present invention, and even
With its explanation together principle for explaining the present invention.
Fig. 1 is the block diagram of the example for the hardware configuration for showing the electronic equipment that can be used for realizing the embodiment of the present invention.
Fig. 2 shows the flow charts of the picture loading method of the embodiment of the present invention.
Fig. 3 shows flow chart the step of being determined for compliance with loading environment of the embodiment of the present invention.
Fig. 4 shows another flow chart the step of being determined for compliance with loading environment of the embodiment of the present invention.
Fig. 5 is the schematic diagram of the example of the picture loading method of the embodiment of the present invention.
Fig. 6 shows the block diagram of the picture loading device of the embodiment of the present invention.
Fig. 7 shows the block diagram of the electronic equipment of the embodiment of the present invention.
Specific implementation mode
Carry out the various exemplary embodiments of detailed description of the present invention now with reference to attached drawing.It should be noted that:Unless in addition having
Body illustrates that the unlimited system of component and the positioned opposite of step, numerical expression and the numerical value otherwise illustrated in these embodiments is originally
The range of invention.
It is illustrative to the description only actually of at least one exemplary embodiment below, is never used as to the present invention
And its application or any restrictions that use.
Technology, method and apparatus known to person of ordinary skill in the relevant may be not discussed in detail, but suitable
In the case of, the technology, method and apparatus should be considered as part of specification.
In shown here and discussion all examples, any occurrence should be construed as merely illustrative, without
It is as limitation.Therefore, other examples of exemplary embodiment can have different values.
It should be noted that:Similar label and letter indicate similar terms in following attached drawing, therefore, once a certain Xiang Yi
It is defined, then it need not be further discussed in subsequent attached drawing in a attached drawing.
<Hardware configuration>
Fig. 1 is the block diagram for showing may be implemented the hardware configuration of the electronic equipment 1000 of the embodiment of the present invention.
Electronic equipment 1000 can be portable computer, desktop computer, mobile phone, tablet computer etc..As shown in Figure 1, electric
Sub- equipment 1000 may include processor 1100, memory 1200, interface arrangement 1300, communication device 1400, display device
1500, input unit 1600, loud speaker 1700, microphone 1800 etc..Wherein, processor 1100 can be central processing unit
CPU, Micro-processor MCV etc..Memory 1200 is for example including ROM (read-only memory), RAM (random access memory), such as
The nonvolatile memory etc. of hard disk.Interface arrangement 1300 is such as including USB interface, earphone interface.Communication device 1400
Wired or wireless communication can be such as carried out, may include specifically Wifi communications, Bluetooth communication, 2G/3G/4G/5G communications etc..It is aobvious
Showing device 1500 is, for example, liquid crystal display, touch display screen etc..Input unit 1600 for example may include touch screen, keyboard,
Body-sensing input etc..User can pass through 1800 inputting/outputting voice information of loud speaker 1700 and microphone.
Electronic equipment shown in FIG. 1 is merely illustrative and is in no way intended to the invention, its application, or uses
Any restrictions.Using in an embodiment of the present invention, the memory 1200 of electronic equipment 1000 is for storing instruction, described
Instruction is operated for controlling the processor 1100 to execute any one picture provided in an embodiment of the present invention load side
Method.It will be appreciated by those skilled in the art that although showing multiple devices to electronic equipment 1000 in Fig. 1, the present invention
Partial devices therein can be only related to, for example, electronic equipment 1000 pertains only to processor 1100 and storage device 1200.Technology
Personnel can instruct according to presently disclosed conceptual design.How control processor is operated for instruction, this is this field public affairs
Know, therefore is not described in detail herein.
<Embodiment>
<Method>
In the present embodiment, a kind of picture loading method is provided.The picture can pass through the electricity arbitrarily with display device
It is applied to corresponding application interface after sub- equipment load, for example, it may be the icon of application interface, button graphic etc..
The picture loading method, as shown in Fig. 2, including step S2100-S2300.
Step S2100 obtains the bitmap file of Target Photo to be loaded, determines whether bitmap file meets preset add
Carrier strip part.
In the present embodiment, the picture that can be used when Target Photo is corresponding application rollouts application interface, such as
Can be program icon, notification bar icon etc..
Bitmap file (also known as raster pattern, digital image or bitmap), is indicated using pel array
The color information of image, each pixel is indicated by RGB combination or gray value.
The bitmap file for obtaining Target Photo can middle reading be locally stored, or the electronics of implementation the present embodiment is set
Standby other application module, obtains after being encoded according to the data of the Target Photo received;It usually can be by reading mesh
It marks on a map the data file of piece, file type is obtained by preceding 2 bytes in the byte stream of the data file, judges the Target Photo
Data file whether be corresponding bitmap file.
In this application, it is not in abnormal or failure condition that loading environment, which is picture load, can be according to specific
Picture loading scenario or picture load demand setting.By the way that loading environment is arranged, for judging that the bitmap file of Target Photo is
The no normal load for supporting Target Photo, to trigger corresponding position when the bitmap file of Target Photo does not meet loading environment
Reason avoids the occurrence of picture load failure.
In an application scenarios, inventor has found, if the bitmap file of file destination, which does not have to meet, answers scene
Target code format, it may appear that Target Photo load failure.For example, for some application program, the mobile phone of certain types is installed
After can will appear the notification bar icon in application interface after the mobile phone installation of certain types without Faxian with normal presentation application interface
Show or blackening as picture load failure the phenomenon that, applicant by largely testing and interpretation of result, be the discovery that because
There is the mobile phone of picture load when Loading Image display application interface, has used and do not met the bitmap that the application program is supported
The coded format of file, for example, it is Bitmap.Config.ARGB_8888 formats that application program, which requires the bitmap file used,
And the bitmap file for the Bitmap.Config.ARGB_565 formats that the mobile phone acquiescence for picture load failure occur uses, cause to answer
It is mounted on such mobile phone and is failed with program, and the bitmap file of Bitmap.Config.ARGB_565 formats can due to it
To use capacity more smaller than Bitmap.Config.ARGB_8888 format that 8 bits is used to express each pixel, using more
Generally.
For above-mentioned application scenarios, loading environment, which can be set to bitmap file, has preset target code lattice
Formula.For example, target code format is Bitmap.Config.ARGB_8888.
Accordingly, the step of whether bitmap file meets preset loading environment determined, as shown in figure 3, including:Step
S2110-S2130。
Step S2110, parsing bitmap file obtain corresponding byte stream, determine and whether there is key parameter in byte stream.
In the present embodiment, key parameter includes at least one of transparency parameter or color mode parameter.It is transparent
Spending parameter is and the relevant parameter of Target Photo.Color mode parameter is and the color mode of Target Photo (such as RGB patterns)
Relevant parameter.
Include one of transparency parameter or color parameter in the byte stream of bitmap file, corresponds to after Loading Image
The visual effect of displaying is generally more abundant, and user experience is more preferable, and accordingly, the coded format of the bitmap file is to meet application
The target code format of scene demand.
For example, bitmap file generally includes bitmap file head, message bit pattern head and bitmap data.When parsing bitmap file
Byte stream obtains message bit pattern head, when the digit for reading message bit pattern head is 8 (256 color), passes through before interception bitmap data 8
(since the digit for being bitmap is 8, preceding 8 units can indicate a pixel, and this 8 are come according to bluish-green red Alpha for position
Sequence), two judgements last in this 8 are read, then prove to be not provided with transparency parameter if it is 0 value, i.e., in byte stream
There is no this key parameter of transparency parameter, then corresponding coded format be Bitmap.Config.ARGB_565 and if it is
Non-zero value, then there are this key parameters of transparency parameter, corresponding coded format i.e. in byte stream is
Bitmap.Config.ARGB_8888。
Step S2120, when in byte stream there are when key parameter, determine bitmap file have target code format, meet
Loading environment.
Step S2130 determines that bitmap file does not have target code format when key parameter is not present in byte stream,
Loading environment is not met.
And for certain electronic equipments for implementing the present embodiment, it is limited to equipment performance, can not support side as described in Figure 3
By parsing the byte stream of bitmap file determines the step of whether corresponding Target Photo meets loading environment in method.
Therefore, in one example, loading environment can be set to bitmap file and have with corresponding sample bitmap file
There is consistency.
Accordingly, the step of whether bitmap file meets preset loading environment determined, as shown in figure 4, including:Step
S2101-S2104。
Step S2101 is based on preset target code format, generates the sample bitmap file of Target Photo.
In this example, target code format is arranged according to corresponding application scenarios demand, is arranged to corresponding
The coded format that the bitmap file of more abundant visual effect is presented after picture load, for example, target code format is set as
Bitmap.Config.ARGB_8888。
Based on target code format, the sample bitmap file with Target Photo is generated, to compare mesh in conjunction with subsequent step
Mark on a map piece (actual) sample file and sample bitmap file consistency, determine whether the bitmap file of Target Photo meets
Loading environment so that without implementing as parsing bitmap file obtains byte stream to applying the higher step of performance requirement, drop
Low application performance consumption.
Step S2102 compares all bytes of bitmap file and sample bitmap file.
Step S2103 determines bitmap file and sample when bitmap file is identical as all bytes of sample bitmap file
File is with uniformity, meets loading environment.
Step S2104 is determined when bitmap file and sample bitmap file are there are when byte is different or file size difference
Bitmap file does not have consistency with sample file, does not meet loading environment.
After step S2100 determines whether bitmap file meets preset loading environment, S2200 is entered step:
When bitmap file does not meet loading environment, coded treatment is re-started to bitmap file, obtains meeting loading environment
New bitmap file.
Loading environment is arranged according to specific application scenarios or application demand.
For example, loading environment, which is bitmap file, has preset target code format.Accordingly, when bitmap file is not met
Loading environment re-starts coded treatment to bitmap file so that bitmap file has target code format, meets load item
Part.
In another example loading environment is that bitmap file and corresponding sample bitmap file are with uniformity.Accordingly, work as bitmap
File does not meet loading environment, and coded treatment is re-started to bitmap file so that bitmap file has with sample bitmap file
Consistency meets loading environment.
Bitmap file is stored in the application memory for the destination application for needing to load Target Photo by step S2300,
It is used when loading Target Photo for destination application.
Destination application is the application program needed by loading the corresponding application interface of intended display.Application program is logical
Often with there is corresponding application memory, for storing the related data provided needed for application service.Application memory is installation or load
A part for the memory of the electronic equipment of the application program, can be distributed automatically by the operating system of electronic equipment, or
It is that application program is distributed to the operating system application of electronic equipment.
In practical applications, inventor has found, when Target Photo meets loading environment, still has certain probability to scheme
The problem of piece load failure.Inventor is had found by largely testing and analyzing work when Target Photo meets loading environment
Still there is picture load failure, is because RAM leakage (OOM, out of occurs in the electronic equipment for implementing picture load
Memory), that is, the memory of application program that Loads Image is larger, leads to picture load failure.
For such case, the picture loading method provided in the present embodiment further includes:
Obtain the memory usage of application memory;
When memory usage is more than preset occupancy threshold value, preserved after bitmap file is carried out compression processing.
The memory usage of application memory is the ratio that corresponding application memory occupies all free memories.
Occupancy threshold value, which is corresponding application memory, allows the maximum rate for occupying all free memories.
When memory usage is more than preset occupancy threshold value, it is meant that the memory usage of application memory is larger,
It is likely to occur the risk of memory wrong path, is preserved after the bitmap file of file destination is carried out compression processing, can be reduced and answer
With the memory usage of memory, avoiding the occurrence of RAM leakage (OOM) leads to picture load failure.
In one example, include by the step of bitmap file progress compression processing:
Bitmap file is recompiled as the new bitmap file with prescribed coding format.
The prescribed coding format is the volume so that bitmap file capacity smaller, the corresponding less bitmap file of memory of occupancy
Code format.In one example, prescribed coding format is Bitmap.Config.ARGB_565 formats.
In practical applications, inventor has found that in certain scenes, the memory usage of application memory is excessive, even if will
It is preserved after bitmap file compression processing, can not effectively reduce the memory usage of application memory.
For such case, the picture loading method provided in this implementation can also include:
When memory usage is more than preset occupancy threshold value, bitmap file is stored in anonymous shared drive;
And/or
When memory usage is more than preset occupancy threshold value, release meets preset releasing memory item in application memory
After the process or task of part, implement the preservation bitmap file the step of.
Anonymous shared drive is usually to be provided by operating system, realized in kernel spacing in the form of driver
Shared drive, can auxiliary memory management system effectively manage the memory block not used, and pass through interprocess communication
Mechanism realizes the memory sharing between process.Bitmap file is stored in anonymous shared drive, and no longer preserves application memory
In, the memory usage of application memory further can be effectively reduced, avoiding the occurrence of RAM leakage leads to picture load failure.
Releasing memory condition is the condition that the process being currently running or task meet the corresponding committed memory of release.Releasing memory
Condition can be arranged according to specific application scenarios or application demand, for example, could be provided as the process being currently running or appoint
Business is redundancy, or is set as the running priority grade of the process being currently running or task and is less than preset running priority grade, etc.
Deng.The meeting releasing memory condition of the task or process are discharged, the memory usage of application memory can be reduced, avoided out
Existing RAM leakage leads to picture load failure.
<Example>
The picture loading method provided in the present embodiment is be provided below with reference to example shown in fig. 5.
In this example, loading environment, which is the bitmap file of Target Photo, has target code format.Target code format is
Bitmap.Config.ARGB_8888。
As shown in figure 5, picture loading method includes:Step S501-S507.
Step S501 obtains the bitmap file of Target Photo to be loaded;
Step S502, determines whether the coded format of bitmap file meets Bitmap.Config.ARGB_8888, if not
Meet ARGB888, enter step S503, otherwise, enters step S504;
It determines whether the coded format of bitmap file meets Bitmap.Config.ARGB_8888, may be used such as Fig. 3 institutes
The method shown, details are not described herein.
Step S503, recompiles bitmap file, obtains meeting the new of Bitmap.Config.ARGB_8888 formats
Bitmap file;
Step S504 obtains the EMS memory occupation of the application memory for the destination application for currently needing to load Target Photo
Rate, judge the application memory of destination application memory usage whether be more than occupy threshold value, if it is greater than occupy threshold value, into
Enter step S505, otherwise enters step S507;
Step S505, discharging in application memory has the lower process of priority or task;
Step S506, by bitmap file recompile for Bitmap.Config.ARGB_565 formats obtain newly bitmap text
Part is stored in anonymous shared drive, is used when loading Target Photo for destination application;
Step S507, bitmap file is stored in the application memory of destination application, for destination application plus
It is used when carrying Target Photo.
By this example, implement picture load after the bitmap file of Target Photo can be made to meet loading environment again, reduces
The mortality of picture load, also, effectively avoid picture load caused by RAM leakage occur unsuccessfully now in picture loading procedure
As so that application program, which can effectively Load Image, shows corresponding application interface, promotes user experience.
<Picture loading device>
In the present embodiment, a kind of picture loading device 3000 is also provided, as shown in fig. 6, including:Load determination unit
3100, coding processing unit 3200 and file storing unit 3300, for implementing any one term diagram provided in the present embodiment
Piece loading method.
Picture loading device 3000, including:
Determination unit 3100 is loaded, the bitmap file for obtaining Target Photo to be loaded determines institute's bitmap file
Whether preset loading environment is met;
Coding processing unit 3200, for working as, bitmap file does not meet the loading environment, to institute's bitmap file
Coded treatment is re-started, the new bitmap file for meeting the loading environment is obtained;
File storing unit 3300 needs to load the target of the Target Photo and answers for institute's bitmap file to be stored in
With in the application memory of program, used when loading the Target Photo for the destination application.
Optionally, the loading environment, which is institute's bitmap file, has preset target code format;
Load determination unit 3100 is additionally operable to:
Parsing institute bitmap file obtains corresponding byte stream, determines and whether there is key parameter, institute in the byte stream
It states key parameter and includes at least one of transparency parameter or color mode parameter;
When there are when the key parameter, determine institute's bitmap file with the target code lattice in the byte stream
Formula meets the loading environment;
When the key parameter is not present in the byte stream, determine that institute's bitmap file does not have the target code
Format does not meet the loading environment.
Optionally, the loading environment is that institute's bitmap file and corresponding sample bitmap file are with uniformity;
Load determination unit 3100 is additionally operable to:
Based on preset target code format, the sample bitmap file of the Target Photo is generated;
Compare all bytes of institute's bitmap file and the sample bitmap file;
When institute's bitmap file is identical as all bytes of sample bitmap file, institute's bitmap file and institute are determined
It is with uniformity to state sample file, meets the loading environment;
When institute's bitmap file and the sample bitmap file are there are when byte is different or file size difference, institute is determined
Bitmap file does not have consistency with the sample file, does not meet the loading environment.
Optionally, the target code format is Bitmap.Config.ARGB_8888 formats.
Optionally, picture loading device 3000 is additionally operable to:
Obtain the memory usage of the application memory;
When the memory usage is more than preset occupancy threshold value, carried out after institute's bitmap file is carried out compression processing
It preserves.
Optionally, picture loading device 3000 is additionally operable to:
Institute's bitmap file is recompiled as the new bitmap file with prescribed coding format.
Optionally, the prescribed coding format is Bitmap.Config.ARGB_565 formats.
Optionally, picture loading device 3000 is additionally operable to:
When the memory usage is more than preset occupancy threshold value, institute's bitmap file is stored in anonymous shared drive
In;
And/or
When the memory usage is more than preset occupancy threshold value, release meets preset release in the application memory
After putting the process or task of memory conditions, implement the preservation bitmap file the step of.
It will be appreciated by those skilled in the art that picture loading device 3000 can be realized by various modes.For example, can
To realize picture loading device 3000 by instructing configuration processor.For example, instruction can be stored in the ROM, and work as
When starting device, instruction is read from ROM and realizes picture loading device 3000 in programming device.For example, can will scheme
Piece loading device 3000 is cured in dedicated devices (such as ASIC).Picture loading device 3000 can be divided into mutually independent
Unit, or they can be merged to realization.Picture loading device 3000 can be by above-mentioned various realization methods
One kind realize, or can be realized by the combination of two or more modes in above-mentioned various realization methods.
In the present embodiment, picture loading device 3000 can be to provide the application program of arbitrary application service function, or
Person can be the function module being built in inside application program, can also be extraneous plug-in unit, insert etc. with application program.
<Electronic equipment>
In the present embodiment, a kind of electronic equipment 4000 is also provided, as shown in fig. 7, comprises:
Memory 4100, for storing executable instruction;
Processor 4200, for the control according to executable instruction, operation electronic equipment 4000 executes in the present embodiment
Picture loading method described in any one of offer.
Attached drawing is had been combined above and describes the embodiment of the present invention, according to the present embodiment, provides a kind of picture load side
Method, device and electronic equipment, by obtaining the bitmap file of picture to be loaded, when determining that bitmap file does not meet loading environment,
Coded treatment is re-started to bitmap file and obtains the new bitmap file for meeting loading environment, and is stored in corresponding using journey
It in the application memory of sequence, is used when Loading Image for application program, avoids the occurrence of picture load failure so that application program can have
Effect, which Loads Image, shows corresponding application interface, promotes user experience.
The present invention can be system, method and/or computer program product.Computer program product may include computer
Readable storage medium storing program for executing, containing for making processor realize the computer-readable program instructions of various aspects of the invention.
Computer readable storage medium can be can keep and store the instruction used by instruction execution equipment tangible
Equipment.Computer readable storage medium for example can be-- but be not limited to-- storage device electric, magnetic storage apparatus, optical storage
Equipment, electromagnetism storage device, semiconductor memory apparatus or above-mentioned any appropriate combination.Computer readable storage medium
More specific example (non exhaustive list) includes:Portable computer diskette, random access memory (RAM), read-only is deposited hard disk
It is reservoir (ROM), erasable programmable read only memory (EPROM or flash memory), static RAM (SRAM), portable
Compact disk read-only memory (CD-ROM), digital versatile disc (DVD), memory stick, floppy disk, mechanical coding equipment, for example thereon
It is stored with punch card or groove internal projection structure and the above-mentioned any appropriate combination of instruction.Calculating used herein above
Machine readable storage medium storing program for executing is not interpreted that instantaneous signal itself, the electromagnetic wave of such as radio wave or other Free propagations lead to
It crosses the electromagnetic wave (for example, the light pulse for passing through fiber optic cables) of waveguide or the propagation of other transmission mediums or is transmitted by electric wire
Electric signal.
Computer-readable program instructions as described herein can be downloaded to from computer readable storage medium it is each calculate/
Processing equipment, or outer computer or outer is downloaded to by network, such as internet, LAN, wide area network and/or wireless network
Portion's storage device.Network may include copper transmission cable, optical fiber transmission, wireless transmission, router, fire wall, interchanger, gateway
Computer and/or Edge Server.Adapter or network interface in each calculating/processing equipment are received from network to be counted
Calculation machine readable program instructions, and the computer-readable program instructions are forwarded, for the meter being stored in each calculating/processing equipment
In calculation machine readable storage medium storing program for executing.
For execute the computer program instructions that operate of the present invention can be assembly instruction, instruction set architecture (ISA) instruction,
Machine instruction, machine-dependent instructions, microcode, firmware instructions, condition setup data or with one or more programming languages
Arbitrarily combine the source code or object code write, the programming language include the programming language-of object-oriented such as
Smalltalk, C++ etc., and conventional procedural programming languages-such as " C " language or similar programming language.Computer
Readable program instructions can be executed fully, partly execute on the user computer, is only as one on the user computer
Vertical software package executes, part executes or on the remote computer completely in remote computer on the user computer for part
Or it is executed on server.In situations involving remote computers, remote computer can pass through network-packet of any kind
It includes LAN (LAN) or wide area network (WAN)-is connected to subscriber computer, or, it may be connected to outer computer (such as profit
It is connected by internet with ISP).In some embodiments, by using computer-readable program instructions
Status information carry out personalized customization electronic circuit, such as programmable logic circuit, field programmable gate array (FPGA) or can
Programmed logic array (PLA) (PLA), the electronic circuit can execute computer-readable program instructions, to realize each side of the present invention
Face.
Referring herein to according to the method for the embodiment of the present invention, the flow chart of device (system) and computer program product and/
Or block diagram describes various aspects of the invention.It should be appreciated that flowchart and or block diagram each box and flow chart and/
Or in block diagram each box combination, can be realized by computer-readable program instructions.
These computer-readable program instructions can be supplied to all-purpose computer, special purpose computer or other programmable datas
The processor of processing unit, to produce a kind of machine so that these instructions are passing through computer or other programmable datas
When the processor of processing unit executes, work(specified in one or more of implementation flow chart and/or block diagram box is produced
The device of energy/action.These computer-readable program instructions can also be stored in a computer-readable storage medium, these refer to
It enables so that computer, programmable data processing unit and/or other equipment work in a specific way, to be stored with instruction
Computer-readable medium includes then a manufacture comprising in one or more of implementation flow chart and/or block diagram box
The instruction of the various aspects of defined function action.
Computer-readable program instructions can also be loaded into computer, other programmable data processing units or other
In equipment so that series of operation steps are executed on computer, other programmable data processing units or miscellaneous equipment, with production
Raw computer implemented process, so that executed on computer, other programmable data processing units or miscellaneous equipment
Instruct function action specified in one or more of implementation flow chart and/or block diagram box.
Flow chart and block diagram in attached drawing show the system, method and computer journey of multiple embodiments according to the present invention
The architecture, function and operation in the cards of sequence product.In this regard, each box in flowchart or block diagram can generation
One module of table, program segment or a part for instruction, the module, program segment or a part for instruction include one or more use
The executable instruction of the logic function as defined in realization.In some implementations as replacements, the function of being marked in box
It can occur in a different order than that indicated in the drawings.For example, two continuous boxes can essentially be held substantially in parallel
Row, they can also be executed in the opposite order sometimes, this is depended on the functions involved.It is also noted that block diagram and/or
The combination of each box in flow chart and the box in block diagram and or flow chart can use function or dynamic as defined in executing
The dedicated hardware based system made is realized, or can be realized using a combination of dedicated hardware and computer instructions.It is right
It is well known that, realized by hardware mode for those skilled in the art, realized by software mode and by software and
It is all of equal value that the mode of combination of hardware, which is realized,.
Various embodiments of the present invention are described above, above description is exemplary, and non-exclusive, and
It is not limited to disclosed each embodiment.Without departing from the scope and spirit of illustrated each embodiment, for this skill
Many modifications and changes will be apparent from for the those of ordinary skill in art field.The selection of term used herein, purport
In principle, the practical application or to the technological improvement in market for best explaining each embodiment, or make the art its
Its those of ordinary skill can understand each embodiment disclosed herein.The scope of the present invention is defined by the appended claims.
Claims (10)
1. a kind of picture loading method, wherein including:
The bitmap file for obtaining Target Photo to be loaded, determines whether institute's bitmap file meets preset loading environment;
When institute's bitmap file does not meet the loading environment, coded treatment is re-started to institute's bitmap file, is met
The new bitmap file of the loading environment;
Institute's bitmap file is stored in the application memory for the destination application for needing to load the Target Photo, for institute
It states when destination application loads the Target Photo and uses.
2. according to the method described in claim 1, wherein,
The loading environment, which is institute's bitmap file, has preset target code format;
The step of whether determining institute's bitmap file meets preset loading environment include:
Parsing institute bitmap file obtains corresponding byte stream, determines and whether there is key parameter, the pass in the byte stream
Bond parameter includes at least one of transparency parameter or color mode parameter;
When there are when the key parameter, determine institute's bitmap file with the target code format, symbol in the byte stream
Close the loading environment;
When the key parameter is not present in the byte stream, determine that institute's bitmap file does not have the target code lattice
Formula does not meet the loading environment.
3. according to the method described in claim 1, wherein,
The loading environment is that institute's bitmap file and corresponding sample bitmap file are with uniformity;
The step of whether determining institute's bitmap file meets preset loading environment include:
Based on preset target code format, the sample bitmap file of the Target Photo is generated;
Compare all bytes of institute's bitmap file and the sample bitmap file;
When institute's bitmap file is identical as all bytes of sample bitmap file, institute's bitmap file and the sample are determined
This document is with uniformity, meets the loading environment;
When institute's bitmap file and the sample bitmap file are there are when byte is different or file size difference, institute's rheme is determined
Map file does not have consistency with the sample file, does not meet the loading environment.
4. according to the method in claim 2 or 3, wherein
The target code format is Bitmap.Config.ARGB_8888 formats.
5. according to the method described in claim 1, wherein, further including:
Obtain the memory usage of the application memory;
When the memory usage is more than preset occupancy threshold value, protected after institute's bitmap file is carried out compression processing
It deposits.
6. according to the method described in claim 5, wherein, described the step of bitmap file is carried out compression processing, includes:
Institute's bitmap file is recompiled as the new bitmap file with prescribed coding format.
7. according to the method described in claim 6, wherein,
The prescribed coding format is Bitmap.Config.ARGB_565 formats.
8. according to the method described in claim 5, wherein, further including:
When the memory usage is more than preset occupancy threshold value, institute's bitmap file is stored in anonymous shared drive;
And/or
When the memory usage is more than preset occupancy threshold value, release meets in the application memory in preset release
After the process or task of depositing condition, implement the preservation bitmap file the step of.
9. a kind of picture loading device, wherein including:
Pretreatment unit is loaded, the bitmap file for obtaining Target Photo to be loaded determines whether institute's bitmap file accords with
Close preset loading environment;
Coding processing unit, for working as, bitmap file does not meet the loading environment, is encoded to institute's bitmap file
Processing, obtains the new bitmap file for meeting the loading environment;
File storing unit need to load the destination application of the Target Photo and answer for institute's bitmap file to be stored in
With in memory, so that the destination application loads the Target Photo.
10. a kind of electronic equipment, wherein including:
Memory, for storing executable instruction;
Processor runs the electronic equipment and executes such as claim 1-8 for the control according to the executable instruction
Picture loading method described in meaning one.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810476212.5A CN108681472A (en) | 2018-05-17 | 2018-05-17 | Picture loading method, device and electronic equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810476212.5A CN108681472A (en) | 2018-05-17 | 2018-05-17 | Picture loading method, device and electronic equipment |
Publications (1)
Publication Number | Publication Date |
---|---|
CN108681472A true CN108681472A (en) | 2018-10-19 |
Family
ID=63805070
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201810476212.5A Pending CN108681472A (en) | 2018-05-17 | 2018-05-17 | Picture loading method, device and electronic equipment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN108681472A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111414308A (en) * | 2020-03-26 | 2020-07-14 | 北京字节跳动网络技术有限公司 | Application package processing method and application program running method and device |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102210149A (en) * | 2008-12-31 | 2011-10-05 | 三星电子株式会社 | Method and apparatus for encoding/decoding image in bitmap format |
CN103309958A (en) * | 2013-05-28 | 2013-09-18 | 中国人民大学 | OLAP star connection query optimizing method under CPU and GPU mixing framework |
US20160098347A1 (en) * | 2013-09-21 | 2016-04-07 | Oracle International Corporation | Temporal clones to identify valid items from a set of items |
CN105549817A (en) * | 2015-12-09 | 2016-05-04 | 广州阿里巴巴文学信息技术有限公司 | Font package generation method and device and graphic display method and device |
CN106056530A (en) * | 2016-06-01 | 2016-10-26 | 腾讯科技(深圳)有限公司 | Method and device for displaying picture content in application |
CN106980579A (en) * | 2016-09-30 | 2017-07-25 | 阿里巴巴集团控股有限公司 | A kind of picture loading method and device |
-
2018
- 2018-05-17 CN CN201810476212.5A patent/CN108681472A/en active Pending
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102210149A (en) * | 2008-12-31 | 2011-10-05 | 三星电子株式会社 | Method and apparatus for encoding/decoding image in bitmap format |
CN103309958A (en) * | 2013-05-28 | 2013-09-18 | 中国人民大学 | OLAP star connection query optimizing method under CPU and GPU mixing framework |
US20160098347A1 (en) * | 2013-09-21 | 2016-04-07 | Oracle International Corporation | Temporal clones to identify valid items from a set of items |
CN105549817A (en) * | 2015-12-09 | 2016-05-04 | 广州阿里巴巴文学信息技术有限公司 | Font package generation method and device and graphic display method and device |
CN106056530A (en) * | 2016-06-01 | 2016-10-26 | 腾讯科技(深圳)有限公司 | Method and device for displaying picture content in application |
CN106980579A (en) * | 2016-09-30 | 2017-07-25 | 阿里巴巴集团控股有限公司 | A kind of picture loading method and device |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111414308A (en) * | 2020-03-26 | 2020-07-14 | 北京字节跳动网络技术有限公司 | Application package processing method and application program running method and device |
CN111414308B (en) * | 2020-03-26 | 2023-08-22 | 抖音视界有限公司 | Application package processing method and application running method and device |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN104244024A (en) | Video cover generation method and device and terminal | |
CN107526495A (en) | Display methods and electronic equipment | |
CN107526751A (en) | Loading method, client, web page server and the programmable device of webpage | |
US20190073801A1 (en) | Dynamic color customization of standardized (emoji) image characters | |
US20220058772A1 (en) | Image Processing Method and Device | |
CN109410893A (en) | Show the method, apparatus and electronic equipment of picture | |
CN107168780A (en) | Loading method, equipment and the virtual reality device of virtual reality scenario | |
US11822698B2 (en) | Privacy transformations in data analytics | |
CN107203425A (en) | Switching method, equipment and the electronic equipment gently applied | |
CN109271085A (en) | Image display method, device and electronic equipment | |
CN108681472A (en) | Picture loading method, device and electronic equipment | |
CN113657518A (en) | Training method, target image detection method, device, electronic device, and medium | |
CN105556570A (en) | Generating screen data | |
CN115937380A (en) | Method and device for rendering graph and storage medium | |
CN112316437A (en) | Resource switching method and device, electronic equipment and storage medium | |
CN108924557A (en) | Image processing method, device, electronic equipment and storage medium | |
CN104714799B (en) | For creating the method and system of Dynamic Announce lamination | |
CN108259315A (en) | Online picture sharing method, equipment, client and electronic equipment | |
CN113608809B (en) | Layout method, device, equipment, storage medium and program product of components | |
CN115115062A (en) | Machine learning model establishing method, related device and computer program product | |
CN111010606B (en) | Video processing method and device | |
CN112035210A (en) | Method, apparatus, device and medium for outputting color information | |
CN105740222A (en) | Method and device used for reader typesetting, reader and electronic device | |
CN113836455A (en) | Special effect rendering method, device, equipment, storage medium and computer program product | |
CN112364282A (en) | Webpage darkness mode realization method, device, medium and electronic equipment |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
TA01 | Transfer of patent application right | ||
TA01 | Transfer of patent application right |
Effective date of registration: 20200526 Address after: 310051 room 508, floor 5, building 4, No. 699, Wangshang Road, Changhe street, Binjiang District, Hangzhou City, Zhejiang Province Applicant after: Alibaba (China) Co.,Ltd. Address before: 510627, room 146-150, first floor, No. 07, Whampoa Avenue, Tianhe District, Guangdong, Guangzhou Applicant before: GUANGZHOU UC NETWORK TECHNOLOGY Co.,Ltd. |
|
RJ01 | Rejection of invention patent application after publication | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20181019 |