CN110187924A - Picture loading method and device - Google Patents
Picture loading method and device Download PDFInfo
- Publication number
- CN110187924A CN110187924A CN201910456374.7A CN201910456374A CN110187924A CN 110187924 A CN110187924 A CN 110187924A CN 201910456374 A CN201910456374 A CN 201910456374A CN 110187924 A CN110187924 A CN 110187924A
- Authority
- CN
- China
- Prior art keywords
- tile
- target photo
- picture
- piecemeal
- load
- 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
- 238000011068 loading method Methods 0.000 title claims abstract description 92
- 238000000034 method Methods 0.000 claims abstract description 93
- 230000003321 amplification Effects 0.000 claims abstract description 84
- 238000003199 nucleic acid amplification method Methods 0.000 claims abstract description 84
- 230000006870 function Effects 0.000 claims description 25
- 230000000903 blocking effect Effects 0.000 claims description 7
- 108010001267 Protein Subunits Proteins 0.000 claims description 3
- 238000005516 engineering process Methods 0.000 abstract description 5
- 238000012545 processing Methods 0.000 abstract description 2
- 238000010586 diagram Methods 0.000 description 7
- 230000005540 biological transmission Effects 0.000 description 1
- 238000004364 calculation method Methods 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000002360 preparation method Methods 0.000 description 1
- 230000000750 progressive effect Effects 0.000 description 1
- 230000001902 propagating effect Effects 0.000 description 1
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/4401—Bootstrapping
-
- 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/46—Multiprogramming arrangements
- G06F9/50—Allocation of resources, e.g. of the central processing unit [CPU]
- G06F9/5005—Allocation of resources, e.g. of the central processing unit [CPU] to service a request
- G06F9/5011—Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals
- G06F9/5016—Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals the resource being the memory
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F2209/00—Indexing scheme relating to G06F9/00
- G06F2209/50—Indexing scheme relating to G06F9/50
- G06F2209/5017—Task decomposition
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Computer Security & Cryptography (AREA)
- Controls And Circuits For Display Device (AREA)
Abstract
The present invention relates to image processing technologies, more particularly to a kind of picture loading method and device, this method comprises: when receiving the load instruction to Target Photo judging whether that piecemeal is needed to load;When needing piecemeal to load, tile figure layer is obtained;It is determining corresponding with Target Photo maximum to amplify level and setting tile dimensions corresponding with tile figure layer;Tile quantity is determined according to maximum amplification level and tile dimensions;Each tile and each picture block are obtained to tile figure layer and Target Photo piecemeal;Piecemeal drawing practice is called, each picture block is drawn correspondingly to each tile, and by loading each tile for having drawn picture block, completes the load to Target Photo.It using method provided by the invention, is plotted on tile after Target Photo is carried out piecemeal, each tile piecemeal is loaded, complete the load to Target Photo, alleviated memory pressure, not will lead to memory and rise suddenly and sharply, the main thread to Load Image is avoided to collapse.
Description
Technical field
The present invention relates to image processing technologies, more particularly to a kind of picture loading method and device.
Background technique
With the fast development of science and technology, the function of more and more application programs is developed, and is commonly utilized in people
Daily life in.Wherein, the function of most of application programs is all related to picture, therefore also becomes to picture load
One of critical function of application program.For example, receiving end subscriber when user carries out transmission picture by application program and receiving
After picture, picture is thumbnail, receives end subscriber and is Loaded Image by clicking, and obtains and sends the original image that end subscriber is sent;Or it uses
It family, can be with the content of more intuitive understanding data by picture subsidiary in load data in the data of inquiry.
Picture of the inventor in the process study discovery loaded to picture, many application programs is all the big of high definition
Picture, such as propagating poster picture, advertising pictures, map picture etc..Since the committed memory of the big picture of high definition is bigger, existing
Have in technology, when the big picture of high definition is loaded, load is slower, and waits the time to be loaded longer.Using directly plus
When the mode of load loads high definition big picture, it is likely to result in memory and rises suddenly and sharply, the main thread of the program to Load Image is possible to make
At obstruction, collapsed so as to cause the main thread of system.
Summary of the invention
The present invention provides a kind of picture loading methods, in this way, the big picture of high pixel can be loaded,
Memory when Loading Image is reduced, to guarantee not will lead to the main thread collapse of system in the process to Load Image.
The present invention also provides a kind of picture loading devices, to guarantee the realization and application of the above method in practice.
A kind of picture loading method, comprising:
When receiving the load instruction to Target Photo, judge whether the Target Photo needs to carry out piecemeal load;
When the Target Photo needs to carry out piecemeal load, the tile figure loaded to the Target Photo is obtained
Layer;
Determine maximum amplification level corresponding with the Target Photo, and according to the maximum amplification level be arranged with it is described
The corresponding tile dimensions of tile figure layer;
According to the maximum amplification level and the tile dimensions, tile quantity corresponding with the tile figure layer is determined,
And according to the tile dimensions and the tile quantity, piecemeal is carried out to the tile figure layer and the Target Photo, obtain with
The corresponding each tile of tile figure layer and each picture block corresponding with the Target Photo;
Pre-set piecemeal drawing practice is called, each picture block is drawn correspondingly to each described watt
On piece, and by loading each tile for having drawn picture block, complete the load to the Target Photo.
Above-mentioned method, it is optionally, described to judge whether the Target Photo needs to carry out piecemeal load, comprising:
Determine the size of the occupied memory space of the Target Photo;
Judge whether the size of the occupied memory space of the Target Photo is no more than preset storage threshold value;
If the size of the occupied memory space of Target Photo is no more than the preset storage threshold value, institute is determined
Target Photo is stated not need to carry out piecemeal load;
If the size of the occupied memory space of Target Photo be more than the preset storage threshold value, determine described in
Target Photo needs to carry out piecemeal load.
Above-mentioned method, it is optionally, described to obtain the tile figure layer loaded to the Target Photo;It is determining with it is described
The corresponding maximum amplification level of Target Photo, and tile corresponding with the tile figure layer is set according to the maximum amplification level
Size, comprising:
Calling presets piecemeal loading procedure, executes the succession instruction in the piecemeal loading procedure, and creation is inherited from
The view subclass of pre-set view control class;The view control class is used in pre-set display area to picture
It is loaded and is shown;
View figure layer corresponding with the view subclass is obtained, and executes the reload instruction in the piecemeal loading procedure,
It is the figure layer with asynchronous piecemeal display function by the view figure layer heavy duty, the Target Photo is loaded with acquisition
Tile figure layer;
Determine the dimension of picture of the Target Photo and the display size of the display area, and according to the dimension of picture
And the display size, calculate scaling corresponding with the Target Photo;
According to the scaling, maximum amplification level corresponding with the Target Photo is determined, and according to the maximum
Amplify level and tile dimensions corresponding with the tile figure layer are set.
Above-mentioned method, optionally, after the completion is to the load of the Target Photo, further includes:
When receiving the amplification instruction to the Target Photo, picture region to be amplified in the Target Photo is determined
Domain;
The piecemeal loading procedure is reruned, determines the area size of the picture region, according to the area size
And the display size, determine new scaling corresponding with the picture region;
According to the new scaling, new maximum amplification level corresponding with the picture region, and foundation are determined
The tile dimensions and the new maximum amplification level when Target Photo are loaded, determine that the load picture region is corresponding
New tile quantity obtains and loads the corresponding each new tile of the picture region;
According to the tile dimensions and the new tile quantity, the picture region is subjected to piecemeal, obtain it is each with
The picture region it is corresponding and with the consistent region picture block of new tile quantity;
The piecemeal drawing practice is called, each region picture block is drawn correspondingly to each described new
On tile, and the tile by loading each picture block of drawing area, obtain the picture region amplified.
Above-mentioned method, it is optionally, described to call pre-set piecemeal drawing practice, one by one by each picture block
It accordingly draws to each tile, and by loading each tile for having drawn picture block, completes to the target figure
The load of piece, comprising:
At least one tile is randomly assigned in pre-set each asynchronous thread, and according to each asynchronous thread
Implementation progress, call the piecemeal drawing practice, each picture block drawn correspondingly to each tile
On;
According to each asynchronous thread implementation progress and draw the sequence of each picture block, successively by it is each
The picture block drawn on tile is loaded.
A kind of picture loading device, comprising:
Judging unit, for judging whether the Target Photo needs when receiving the load instruction to Target Photo
Carry out piecemeal load;
Acquiring unit, for obtaining and being carried out to the Target Photo when the Target Photo needs to carry out piecemeal load
The tile figure layer of load;
Setting unit, for determining maximum amplification level corresponding with the Target Photo, and according to the maximum amplification
Tile dimensions corresponding with the tile figure layer are arranged in level;
First blocking unit, for according to the maximum amplification level and the tile dimensions, determination and the tile figure
The corresponding tile quantity of layer, and according to the tile dimensions and the tile quantity, to the tile figure layer and the target figure
Piece carries out piecemeal, obtains and the corresponding each tile of the tile figure layer and each picture block corresponding with the Target Photo;
Loading unit draws each picture block for calling pre-set piecemeal drawing practice correspondingly
On system to each tile, and by loading each tile for having drawn picture block, the load to the Target Photo is completed.
Above-mentioned device, optionally, the judging unit, comprising:
First determines subelement, for determining the target figure when receiving the instruction of the load to the Target Photo
The size of the occupied memory space of piece;
Judgment sub-unit, for judging it is preset whether the size of the occupied memory space of the Target Photo is no more than
Store threshold value;
First determines subelement, if the size for the occupied memory space of the Target Photo is no more than described preset
Storage threshold value, then determine the Target Photo do not need carry out piecemeal load;
Second determines subelement, if the size for the occupied memory space of the Target Photo is more than described preset
Threshold value is stored, then determines that the Target Photo needs to carry out piecemeal load.
Above-mentioned device, optionally, the setting unit, comprising:
First executes subelement, presets piecemeal loading procedure for calling, executes in the piecemeal loading procedure
Instruction is inherited, creation is inherited from the view subclass of pre-set view control class;The view control class in advance for setting
Picture is loaded and shown in the display area set;
Second executes subelement, for obtaining view figure layer corresponding with the view subclass, and executes the piecemeal and adds
The reload instruction in program is carried, is the figure layer with asynchronous piecemeal display function by the view figure layer heavy duty, to obtain to institute
State the tile figure layer that Target Photo is loaded;
And operator unit, for determining the dimension of picture of the Target Photo and the display size of the display area, and
According to the dimension of picture and the display size, scaling corresponding with the Target Photo is calculated;
Subelement is set, for determining maximum amplification level corresponding with the Target Photo according to the scaling,
And tile dimensions corresponding with the tile figure layer are set according to the maximum amplification level.
Above-mentioned device, optionally, further includes:
Second determination unit, for determining the Target Photo when receiving the amplification instruction to the Target Photo
In picture region to be amplified;
Running unit determines the area size of the picture region, foundation for reruning the piecemeal loading procedure
The area size and the display size determine new scaling corresponding with the picture region;
Third determination unit, for according to the new scaling, determine it is corresponding with the picture region newly most
Big amplification level, and according to the tile dimensions and the new maximum amplification level when loading the Target Photo, determine load
The corresponding new tile quantity of the picture region obtains and loads the corresponding each new tile of the picture region;
Second blocking unit, for according to the tile dimensions and the new tile quantity, by the picture region into
Row piecemeal, obtain it is each corresponding with the picture region and with the consistent region picture block of new tile quantity;
Drawing unit draws each region picture block for calling the piecemeal drawing practice correspondingly
On to each new tile, and the tile by loading each picture block of drawing area, obtain the picture region amplified
Domain.
Above-mentioned device, optionally, the loading unit, comprising:
Subelement is distributed, for being randomly assigned at least one tile, and foundation in pre-set each asynchronous thread
The implementation progress of each asynchronous thread calls the piecemeal drawing practice, and each picture block is drawn correspondingly
On system to each tile;
Subelement is loaded, for the implementation progress according to each asynchronous thread and draws the suitable of each picture block
Sequence successively loads each picture block drawn on tile.
A kind of storage medium, the storage medium include the instruction of storage, wherein in described instruction operation described in control
Equipment where storage medium executes above-mentioned picture loading method.
A kind of electronic equipment, including memory and one perhaps one of them or one of more than one instruction with
Upper instruction is stored in memory, and is configured to execute above-mentioned picture load side by one or more than one processor
Method.
Compared with prior art, the present invention includes the following advantages:
The embodiment of the invention provides a kind of picture loading methods, comprising: instructs when receiving the load to Target Photo
When, judge whether Target Photo needs to carry out piecemeal load;When Target Photo needs to carry out piecemeal load, obtain to target figure
The tile figure layer that piece is loaded;Determine maximum amplification level corresponding with Target Photo, and according to maximum amplification level setting
Tile dimensions corresponding with tile figure layer;According to maximum amplification level and tile dimensions, tile corresponding with tile figure layer is determined
Quantity, and according to tile dimensions and the tile quantity, piecemeal, acquisition and tile are carried out to tile figure layer and the Target Photo
The corresponding each tile of figure layer and each picture block corresponding with the Target Photo;Call pre-set piecemeal drawing side
Method draws each picture block to each tile correspondingly, and by loading each watt for having drawn picture block
Piece completes the load to Target Photo.Using method provided by the invention, by obtaining each tile, and by Target Photo into
It is plotted on tile after row piecemeal, is loaded according to the piecemeal to each tile, obtain the Target Photo for completing load, alleviate load
Memory pressure when Target Photo not will lead to memory and rise suddenly and sharply, and ensure that the main thread to Load Image will not collapse.
Detailed description of the invention
In order to more clearly explain the embodiment of the invention or the technical proposal in the existing technology, to embodiment or will show below
There is attached drawing needed in technical description to be briefly described, it should be apparent that, the accompanying drawings in the following description is only this
The embodiment of invention for those of ordinary skill in the art without creative efforts, can also basis
The attached drawing of offer obtains other attached drawings.
Fig. 1 is a kind of method flow diagram of picture loading method provided in an embodiment of the present invention;
Fig. 2 is a kind of another method flow diagram of picture loading method provided in an embodiment of the present invention;
Fig. 3 is a kind of another method flow diagram of picture loading method provided in an embodiment of the present invention;
Fig. 4 is a kind of structure drawing of device of picture loading device provided in an embodiment of the present invention;
Fig. 5 is the structural schematic diagram of a kind of electronic equipment provided in an embodiment of the present invention.
Specific embodiment
Following will be combined with the drawings in the embodiments of the present invention, and technical solution in the embodiment of the present invention carries out clear, complete
Site preparation description, it is clear that described embodiments are only a part of the embodiments of the present invention, instead of all the embodiments.It is based on
Embodiment in the present invention, it is obtained by those of ordinary skill in the art without making creative efforts every other
Embodiment shall fall within the protection scope of the present invention.
In this application, relational terms such as first and second and the like be used merely to by an entity or operation with
Another entity or operation distinguish, and without necessarily requiring or implying between these entities or operation, there are any this realities
The relationship on border perhaps sequence the terms "include", "comprise" or any other variant thereof is intended to cover non-exclusive inclusion, from
And to include the process, method, article or equipments of a series of elements not only to include those elements, but also including not bright
The other element really listed, or further include for elements inherent to such a process, method, article, or device.Do not having
In the case where more limitations, the element that is limited by sentence "including a ...", it is not excluded that include the element process,
There is also other identical elements in method, article or equipment.
The present invention can be used in numerous general or special purpose computing device environment or configurations.Such as: personal computer, service
Device computer, handheld device or portable device, laptop device, multi-processor device including any of the above devices or devices
Distributed computing environment etc..
The embodiment of the invention provides a kind of picture loading method, this method can be applied in multiple systems platform, be held
Row main body can be terminal or the processor of various mobile devices, and the method flow diagram of the method is as shown in Figure 1, tool
Body includes:
S101: when receiving the load instruction to Target Photo, judge whether the Target Photo needs to carry out piecemeal
Load;
In method provided in an embodiment of the present invention, when receive need the load that a certain picture is loaded instruct when,
The picture loaded is determined as Target Photo, and by judging to determine whether the Target Photo needs to carry out piecemeal and add
It carries.
S102: when the Target Photo needs to carry out piecemeal load, watt loaded to the Target Photo is obtained
Piece figure layer;
In method provided in an embodiment of the present invention, after determining that the Target Photo needs to carry out piecemeal load, obtains and need
The tile figure layer that Target Photo is loaded.Wherein, which can be the carrier loaded to Target Photo.
S103: maximum amplification level corresponding with the Target Photo is determined, and according to the maximum amplification level setting
Tile dimensions corresponding with the tile figure layer;
In method provided in an embodiment of the present invention, when determining that Target Photo to be loaded needs to carry out piecemeal load and acquisition
To after the tile figure layer for needing to load Target Photo, maximum amplification level corresponding with Target Photo, and root are first determined
According to maximum amplification level, tile dimensions corresponding with tile figure layer are set.
S104: according to the maximum amplification level and the tile dimensions, tile corresponding with the tile figure layer is determined
Quantity, and according to the tile dimensions and the tile quantity, piecemeal is carried out to the tile figure layer and the Target Photo, is obtained
Obtain and the corresponding each tile of the tile figure layer and each picture block corresponding with the Target Photo;
In method provided in an embodiment of the present invention, according to maximum amplification layer and and tile dimensions, determination and the tile figure layer
Corresponding tile quantity, and tile figure layer is subjected to piecemeal according to tile dimensions and tile quantity, each tile is obtained, while can
According to the size of tile and tile quantity, piecemeal is carried out to the Target Photo loaded, obtains each piecemeal
Picture block.Wherein, the quantity of each picture block is consistent with tile quantity, and the segment size of each picture block is not more than each watt
The tile dimensions of piece.For example, tile size is 256 × 256, then the maximum segment size of each picture block is 256 × 256.
S105: calling pre-set piecemeal drawing practice, and each picture block is drawn correspondingly to each
On the tile, and by loading each tile for having drawn picture block, the load to the Target Photo is completed.
In method provided in an embodiment of the present invention, after Target Photo is carried out piecemeal, piecemeal drawing practice is called, it will be each
A picture block is plotted to correspondingly on each tile, and each tile for having drawn picture block is successively loaded, and is obtained
It must complete the Target Photo of load.Wherein, can be by pre-set display area when loading each picture block, it will be each
Picture block is shown, is finally obtained complete Target Photo and is shown.
It should be noted that the piecemeal drawing practice, which can be, presets drawReact piecemeal drawing practice.
It optionally, can be according to the sequence for drawing picture block, successively to every when each tile of picture block has been drawn in load
A tile is loaded.
In picture loading method provided in an embodiment of the present invention, when receiving the load instruction to Target Photo, in advance
Judge whether the Target Photo needs to carry out piecemeal load.When determining that the Target Photo needs to carry out piecemeal load, acquisition watt
Piece figure layer, and determine maximum amplification level corresponding with Target Photo, while tile dimensions are arranged according to maximum amplification level.Root
According to the tile size being arranged and maximum amplification level, tile quantity can be determined, and tile figure layer piecemeal is obtained each watt
Piece, while Target Photo piecemeal is obtained into each picture block according to tile dimensions and tile quantity.Wherein, maximum amplification level
Bigger, tile quantity is more.Finally, calling pre-set piecemeal drawing practice, each picture block is drawn correspondingly
It makes on each tile block, each picture block is loaded by loading each tile, obtains the Target Photo for completing load.
Wherein, each tile block loaded depicts corresponding picture block.
It should be noted that tile is the carrier as the corresponding each picture block of load Target Photo, it is big according to tile
It is small, by Target Photo be blocked into the consistent picture block of tile quantity, then each picture block corresponded and is drawn on tile,
Each picture block is loaded by each tile, obtains the Target Photo that load is completed.
It should also be noted that, an interval value, such as [0,10] can be arranged for maximum amplification level, in [0,10]
In interval value, in the case that tile dimensions are constant, the value of maximum amplification level is bigger, and the quantity of tile is more, is being loaded
When picture block, the segment size for the picture block drawn on each tile block may be just smaller, therefore when loading thumbnail, shared
The amount of increase of memory is lower.
Optionally, during each picture block to Target Photo loads, each picture block is added
After the completion of load, the picture block loaded is shown to pre-set display area.Each has been loaded in display area
Picture block pieced together, finally all picture blocks that load is completed are scrabbled up Target Photo on the display region and shown
Show, completes the load to the Target Photo.
Using method provided in an embodiment of the present invention, loaded again after Target Photo is carried out piecemeal, to reach slow
The purpose for solving memory pressure, not will lead to memory and rises suddenly and sharply, and the main thread of load Target Photo is avoided to collapse.
In method provided in an embodiment of the present invention, it is based on above-mentioned steps S101, is referred to receiving the load to Target Photo
After order, which is judged, determines whether the Target Photo needs piecemeal to load, is specifically included:
When receiving the instruction of the load to the Target Photo, the occupied memory space of the Target Photo is determined
Size;
Judge whether the size of the occupied memory space of the Target Photo is no more than preset storage threshold value;
If the size of the occupied memory space of Target Photo is no more than the preset storage threshold value, institute is determined
Target Photo is stated not need to carry out piecemeal load;
If the size of the occupied memory space of Target Photo be more than the preset storage threshold value, determine described in
Target Photo needs to carry out piecemeal load.
In picture loading method provided in an embodiment of the present invention, when processor receive load instruction after, as needed into
The Target Photo of row load, first determines the size for the memory space that the Target Photo occupies.Such as the storage that Target Photo occupies
Space is 15M.According to the memory space, judge whether the size of the memory space is no more than pre-set storage threshold value.If
It stores threshold value and is not more than 15M, that is, show that the size of the memory space of Target Photo is no more than pre-set storage threshold value, then sentence
The fixed Target Photo does not need to carry out piecemeal load.If storing threshold value is greater than 15M, that is, show the big of the memory space of Target Photo
Small is more than pre-set storage threshold value, then determines that the Target Photo needs to carry out piecemeal load.
It should be noted that when the Target Photo does not need to carry out piecemeal load, since the Target Photo is occupied
Memory space is smaller, and the pixel for characterizing the Target Photo is not high, and photo size is also smaller, therefore low in load pixel, and size is small
Picture when, can be Loaded Image by way of being loaded directly into.
Using method provided in an embodiment of the present invention, the memory space occupied by determining Target Photo determines the target
Whether picture is the big picture of high pixel.When the memory space of occupancy is greater than preset storage threshold value, then the Target Photo is characterized
For the big picture of high pixel, it is thus determined that need to be loaded in such a way that piecemeal loads when loading the Target Photo,
To achieve the purpose that alleviate memory pressure, it not will lead to memory and rise suddenly and sharply, the main thread of load Target Photo is avoided to collapse.
The present invention is in the method that embodiment provides, in the step S102 and step S103 that provide based on the above embodiment,
In the tile figure layer that acquisition needs to load Target Photo, and determine maximum amplification layer corresponding with the Target Photo
Grade, while when according to the maximum amplification level, tile dimensions corresponding with the tile figure layer are set, as shown in Fig. 2, specifically
Include:
S201: calling preset piecemeal loading procedure, execute in the piecemeal loading procedure succession instruction, creation after
Hold the view subclass from pre-set view control class;The view control class is for right in pre-set display area
Picture is loaded and is shown;
It, will when determining that Target Photo to be loaded needs to carry out piecemeal load in method provided in an embodiment of the present invention
Pre-set piecemeal loading procedure is called to carry out piecemeal load to Target Photo.The succession executed in the piecemeal loading procedure refers to
It enables, creation one is inherited from the view subclass of pre-set view control class.
It should be noted that view control class can be UIView view control, which is in iOS SDK system
A kind of view class can be used for that picture is loaded and shown in pre-set display area.
It should also be noted that, view subclass is inherited from view control class, therefore the view subclass has and view control
All features of class, and it is inherited from the view subclass of view control class, all there are corresponding view figure layers.View
Class can be the big picture view class of LargeImageView.
S202: view figure layer corresponding with the view subclass is obtained, and executes the heavy duty in the piecemeal loading procedure
The view figure layer heavy duty is the figure layer with asynchronous piecemeal display function, is carried out with obtaining to the Target Photo by instruction
The tile figure layer of load;
In method provided in an embodiment of the present invention, after creating the view subclass of view control class, obtain and the view
The corresponding view figure layer of subclass.And according to the reload instruction in the piecemeal loading procedure, the reload instruction is executed, by view figure layer
Heavy duty is the figure layer with asynchronous piecemeal display function, to obtain the tile figure layer loaded to Target Photo.
It should be noted that view figure layer heavy duty can be to show with asynchronous piecemeal with layer figure layer by the view figure layer
When the figure layer of function, then layer figure layer is directed toward CATiledLayer, to obtain tilelayer tile figure layer.Wherein, should
When CATiledLayer is that the figure layer with asynchronous piecemeal display function is used to carry out piecemeal load to picture, according to tile quantity
Piecemeal is carried out to display area.Tilelayer tile figure layer is that have the layer figure layer of asynchronous piecemeal function.
S203: the dimension of picture of the Target Photo and the display size of the display area are determined, and according to the figure
Chip size and the display size calculate scaling corresponding with the Target Photo;
In method provided in an embodiment of the present invention, by calling pre-set piecemeal loading procedure, by view figure layer weight
It carries after obtaining tile figure layer for the figure layer with asynchronous piecemeal display function, determine the dimension of picture of the Target Photo and needs aobvious
Show the display size of the display area of the Target Photo.If the dimension of picture of the Target Photo is excessive, need according to viewing area
The display size in domain carries out piecemeal load to the Target Photo.According to dimension of picture and display size, calculate and the Target Photo
Corresponding scaling zooms in and out the Target Photo according to the scaling.
S204: according to the scaling, maximum amplification level corresponding with the Target Photo is determined, and according to described
Tile dimensions corresponding with the tile figure layer are arranged in maximum amplification level.
In method provided in an embodiment of the present invention, according to scaling, maximum amplification layer corresponding with Target Photo is determined
Simultaneously tile tile dimensions are arranged according to maximum amplification level in grade.
It should be noted that tile dimensions are the maximum block size for carrying out piecemeal to the target.It is true according to scaling
Fixed maximum amplification level, so that the picture after piecemeal meets scaling, complete display is on the display region.
In picture loading method provided in an embodiment of the present invention, after determining that the Target Photo needs to carry out piecemeal load,
Piecemeal loading procedure to be called, and executes the instruction of the succession in the program, creation one is inherited from the view subclass of view control class,
Wherein, the view control class is for being loaded and being shown to picture in pre-set display area.According to the view of creation
Figure subclass obtains corresponding view figure layer, which is the carrier loaded to picture.It will be in view figure layer heavy duty
To obtain tile figure layer after the figure layer with asynchronous piecemeal function.Wherein, the figure layer with asynchronous piecemeal function can be
CATiledLayer, the CATiledLayer be used for picture carry out piecemeal load when, according to tile quantity to display area into
Row piecemeal.It determines the dimension of picture of Target Photo and shows the display size of the display area of the Target Photo, and according to picture
Size and display size determine the corresponding scaling of the Target Photo, wherein the calculation formula of the scaling are as follows:
Wherein, imagescale is scaling, and SelfFrameSize is the dimension of picture of Target Photo,
ImageRectSize is the display size of display area.
According to scaling, maximum amplification level corresponding with Target Photo is determined, while being set according to maximum amplification level
Set tile dimensions.Tile quantity is determined according to tile dimensions and maximum amplification level, according to tile size and tile quantity, general watt
Piece figure layer carries out piecemeal and obtains each tile.Wherein, each tile is the carrier of each picture block, can be by each of Target Photo
Picture block is drawn to being loaded on tile.
It should be noted that original view figure layer does not have the function of piecemeal, it, can only be entire when Loading Image
Drawing in view figure layer needs picture to be loaded.After view figure layer heavy duty is the figure layer with asynchronous piecemeal function, acquisition
Tile figure layer will be provided with the function of piecemeal, therefore the tile figure layer can be carried out piecemeal, and picture to be loaded will be needed to be divided
Block load.
Using method provided in an embodiment of the present invention, which is characterized in that by calling piecemeal loading procedure, first create one
The view figure layer heavy duty of the view subclass is the figure layer with asynchronous piecemeal function by view subclass, so that figure layer has piecemeal
Function, then by determining maximum amplification level and setting tile dimensions, to determine that tile quantity obtains each tile, therefore can be right
Target Photo carries out piecemeal load, to achieve the purpose that alleviate memory pressure, not will lead to memory and rises suddenly and sharply, and avoids load target
The main thread of picture collapses.
In method provided in an embodiment of the present invention, it is based in above-mentioned steps S105, after completing to the load of Target Photo,
As shown in figure 3, specific further include:
S301: when receiving the amplification instruction to the Target Photo, figure to be amplified in the Target Photo is determined
Panel region;
In method provided in an embodiment of the present invention, after completing load to target, if desired Target Photo is amplified
When, it may be determined that the region for needing to amplify.When receiving the amplification instruction to Target Photo, determine in Target Photo wait put
Big picture region.
S302: the piecemeal loading procedure is reruned, determines the area size of the picture region, according to the region
Size and the display size determine new scaling corresponding with the picture region;
In method provided in an embodiment of the present invention, according to the process for carrying out piecemeal load to Target Photo, to the picture region
Domain amplifies load, the piecemeal loading procedure is reruned, and determine the area size of the picture region, according to the region ruler
Very little and originally determining display size, redefines new scaling corresponding with the picture region.
S303: according to the new scaling, determining new maximum amplification level corresponding with the picture region, and
Tile dimensions and the new maximum amplification level when according to the load Target Photo, determine the load picture region pair
The new tile quantity answered obtains and loads the corresponding each new tile of the picture region;
In method provided in an embodiment of the present invention, after getting new scaling, according to new scaling, again
It determines maximum amplification level, obtains new maximum amplification level.And level is amplified according to original tile size and new maximum,
It determines new tile quantity, obtains each new tile.
S304: according to the tile size and the new tile quantity, the picture region is subjected to piecemeal, is obtained each
It is a corresponding with the picture region and with the consistent region picture block of new tile quantity;
In method provided in an embodiment of the present invention, according to the tile size of original load Target Photo and new tile number
The picture region for needing to amplify is carried out piecemeal, obtains each region picture block by amount.Wherein, the quantity of region picture block and new
Tile quantity it is consistent, and the segment size of each region picture block be not more than tile size.
It should be noted that step S304 is similar to the embodiment of step S104 in above-described embodiment, it is big according to tile
Small and tile quantity carries out piecemeal to picture.Wherein, step S104 is to carry out piecemeal to Target Photo, and step S304 is to target
The picture region for needing to amplify in picture carries out piecemeal.
S305: calling the piecemeal drawing practice, and each region picture block is drawn correspondingly to each institute
It states on new tile, and the tile by loading each picture block of drawing area, obtains the picture region amplified.
In method provided in an embodiment of the present invention, after picture region is carried out piecemeal, the method for calling piecemeal to draw will
The corresponding each region picture block one-to-one correspondence of picture region is plotted on each new tile, by loading each new tile
Each region picture block of picture region is loaded, the picture region amplified is obtained.
It should be noted that step S305 is consistent with the embodiment of step S105 in above-described embodiment, picture block is drawn
It is loaded on system to tile.Wherein, step S105 is drawn to the corresponding picture block of Target Photo, and step S305 is pair
The corresponding picture block of the picture region for needing to amplify in Target Photo is drawn.
In picture loading method provided in an embodiment of the present invention, Target Photo is completed to load when passing through piecemeal loading procedure
Afterwards, if receive the amplification instruction to a certain picture region of the Target Photo, the piecemeal load instruction can be called again.
The area size of picture region and the picture region that determination to be amplified.According to the area size and original displaying target figure
The display size of piece determines new scaling.According to new scaling, new maximum amplification level is set.According to new
Maximum amplification level and original tile size determine and load the corresponding tile quantity of the picture region, and obtain and load the figure
The corresponding each new tile of panel region.According to tile size and tile quantity, after picture region is carried out piecemeal, by piecemeal
The corresponding each region picture block of picture region drawn to each new tile one by one.By loading new tile, by this
Picture region is loaded, and the picture region for completing load is obtained.
It should be noted that when picture region according to amplification instruction amplification target picture, operation piecemeal load instruction
Succession instruction and reload instruction are executed, is the figure layer with asynchronous piecemeal function by new view figure layer heavy duty, obtains new
Tile figure layer.The specific implementation process in amplification picture region and load Target Photo process are almost the same, do not repeat again herein.
Using method provided in an embodiment of the present invention, after completing to the load of Target Photo, in Target Photo
When a certain picture region amplifies, the picture region can be loaded in the method loaded with same piecemeal, be guaranteed
When being amplified to the Target Photo, it not will lead to memory and rise suddenly and sharply.
In method provided in an embodiment of the present invention, it is based on above-mentioned steps S104 or step S305, by calling piecemeal to draw
Method draws each picture block to each tile correspondingly, and has drawn picture by the way that load is each
The tile of block is completed the load to the Target Photo, is specifically included:
At least one tile is randomly assigned in pre-set each asynchronous thread, and according to each asynchronous thread
Implementation progress, call the piecemeal drawing practice, each picture block drawn correspondingly to each tile
On;
According to each asynchronous thread implementation progress and draw the sequence of each picture block, successively by it is each
The picture block drawn on tile is loaded.
In picture loading method provided in an embodiment of the present invention, after obtaining each tile and picture block, by each tile
It is randomly assigned to each asynchronous thread, calling piecemeal drawing practice different according to the implementation progress of per thread, and according to
The implementation progress of each asynchronous thread draws picture block to the tile for including in per thread.Wherein, a picture block can only be drawn
On system a to tile.Simultaneously according to the sequence for drawing picture block in each thread, successively will be drawn on each tile
The picture block made is loaded, and each picture block after loading is complete, scrabbles up the Target Photo loaded automatically
Or picture region, complete the load to Target Photo or picture region.
It should be noted that one or more tiles can be distributed in an asynchronous thread, when in an asynchronous thread points
, can be according to the sequence for drawing picture block when with multiple tiles and executing the asynchronous thread, the figure drawn on tile to each
Tile is loaded.
Using method provided in an embodiment of the present invention, picture block is drawn in multiple asynchronous threads and is successively loaded,
Main thread will not be occupied, and is Loaded Image according to the implementation progress of each asynchronous thread, the pressure of memory is alleviated.
Corresponding with method described in Fig. 1, the embodiment of the invention also provides a kind of picture loading devices, for Fig. 1
The specific implementation of middle method, picture loading device provided in an embodiment of the present invention can be set with application computer terminal or various movements
In standby, structural schematic diagram is as shown in figure 4, specifically include:
Judging unit 401, for judging whether the Target Photo needs when receiving the load instruction to Target Photo
Carry out piecemeal load;
Acquiring unit 402, for when the Target Photo needs to carry out piecemeal load, obtain to the Target Photo into
The tile figure layer of row load;
Setting unit 403 for determining maximum amplification level corresponding with the Target Photo, and is put according to the maximum
Tile dimensions corresponding with the tile figure layer are arranged in big level;
First blocking unit 404, for according to the maximum amplification level and the tile dimensions, determination and the tile
The corresponding tile quantity of figure layer, and according to the tile dimensions and the tile quantity, to the tile figure layer and the target
Picture carries out piecemeal, obtains and the corresponding each tile of the tile figure layer and each picture corresponding with the Target Photo
Block;
Loading unit 405, for calling pre-set piecemeal drawing practice, correspondingly by each picture block
It draws to each tile, and by loading each tile for having drawn picture block, completion adds the Target Photo
It carries.
In device provided in an embodiment of the present invention, the judging unit 401 may include:
First determines subelement, for determining the target figure when receiving the instruction of the load to the Target Photo
The size of the occupied memory space of piece;
Judgment sub-unit, for judging it is preset whether the size of the occupied memory space of the Target Photo is no more than
Store threshold value;
First determines subelement, if the size for the occupied memory space of the Target Photo is no more than described preset
Storage threshold value, then determine the Target Photo do not need carry out piecemeal load;
Second determines subelement, if the size for the occupied memory space of the Target Photo is more than described preset
Threshold value is stored, then determines that the Target Photo needs to carry out piecemeal load.
In device provided in an embodiment of the present invention, the setting unit 403 may include:
First executes subelement, presets piecemeal loading procedure for calling, executes in the piecemeal loading procedure
Instruction is inherited, creation is inherited from the view subclass of pre-set view control class;The view control class in advance for setting
Picture is loaded and shown in the display area set;
Second executes subelement, for obtaining view figure layer corresponding with the view subclass, and executes the piecemeal and adds
The reload instruction in program is carried, is the figure layer with asynchronous piecemeal display function by the view figure layer heavy duty, to obtain to institute
State the tile figure layer that Target Photo is loaded;
And operator unit, for determining the dimension of picture of the Target Photo and the display size of the display area, and
According to the dimension of picture and the display size, scaling corresponding with the Target Photo is calculated;
Subelement is set, for determining maximum amplification level corresponding with the Target Photo according to the scaling,
And tile dimensions corresponding with the tile figure layer are set according to the maximum amplification level.
The present invention is implemented in the device provided, further includes:
Second determination unit, for determining the Target Photo when receiving the amplification instruction to the Target Photo
In picture region to be amplified;
Running unit determines the area size of the picture region, foundation for reruning the piecemeal loading procedure
The area size and the display size determine new scaling corresponding with the picture region;
Third determination unit, for according to the new scaling, determine it is corresponding with the picture region newly most
Big amplification level, and according to the tile dimensions and the new maximum amplification level when loading the Target Photo, determine load
The corresponding new tile quantity of the picture region obtains and loads the corresponding each new tile of the picture region;
Second blocking unit, for according to the tile dimensions and the new tile quantity, by the picture region into
Row piecemeal, obtain it is each corresponding with the picture region and with the consistent region picture block of new tile quantity;
Drawing unit draws each region picture block for calling the piecemeal drawing practice correspondingly
On to each new tile, and the tile by loading each picture block of drawing area, obtain the picture region amplified
Domain.
In device provided in an embodiment of the present invention, the loading unit 405 may include:
Subelement is distributed, for being randomly assigned at least one tile, and foundation in pre-set each asynchronous thread
The implementation progress of each asynchronous thread calls the piecemeal drawing practice, and each picture block is drawn correspondingly
On system to each tile;
Subelement is loaded, for the implementation progress according to each asynchronous thread and draws the suitable of each picture block
Sequence successively loads each picture block drawn on tile.
Judging unit 401, acquiring unit 402 in the above picture loading device disclosed by the embodiments of the present invention, setting are single
The specific work process of first 403, first blocking unit unit 404 and loading unit 405, reference can be made to the above embodiment of the present invention is public
The corresponding content in picture loading method opened, is not discussed here.
The embodiment of the invention also provides a kind of storage medium, the storage medium includes the instruction of storage, wherein in institute
It states the equipment where controlling the storage medium when instruction operation and executes above-mentioned picture loading method.
The embodiment of the invention also provides a kind of electronic equipment, structural schematic diagram is as shown in figure 5, specifically include memory
501 and one perhaps more than one 502 one of them or more than one instruction of instruction 502 be stored in memory 501
In, and be configured to by one or more than one processor 503 execute the one or more instruction 502 carry out with
Lower operation:
When receiving the load instruction to Target Photo, judge whether the Target Photo needs to carry out piecemeal load;
When the Target Photo needs to carry out piecemeal load, the tile figure loaded to the Target Photo is obtained
Layer;
Determine maximum amplification level corresponding with the Target Photo, and according to the maximum amplification level be arranged with it is described
The corresponding tile dimensions of tile figure layer;
According to the maximum amplification level and the tile dimensions, tile quantity corresponding with the tile figure layer is determined,
And according to the tile dimensions and the tile quantity, piecemeal is carried out to the tile figure layer and the Target Photo, obtain with
The corresponding each tile of tile figure layer and each picture block corresponding with the Target Photo;
Pre-set piecemeal drawing practice is called, each picture block is drawn correspondingly to each described watt
On piece, and by loading each tile for having drawn picture block, complete the load to the Target Photo.
All the embodiments in this specification are described in a progressive manner, same and similar portion between each embodiment
Dividing may refer to each other, and each embodiment focuses on the differences from other embodiments.Especially for system or
For system embodiment, since it is substantially similar to the method embodiment, so describing fairly simple, related place is referring to method
The part of embodiment illustrates.System and system embodiment described above is only schematical, wherein the conduct
The unit of separate part description may or may not be physically separated, component shown as a unit can be or
Person may not be physical unit, it can and it is in one place, or may be distributed over multiple network units.It can root
According to actual need that some or all of the modules therein is selected to achieve the purpose of the solution of this embodiment.Ordinary skill
Personnel can understand and implement without creative efforts.
Professional further appreciates that, unit described in conjunction with the examples disclosed in the embodiments of the present disclosure
And algorithm steps, can be realized with electronic hardware, computer software, or a combination of the two, in order to clearly demonstrate hardware and
The interchangeability of software generally describes each exemplary composition and step according to function in the above description.These
Function is implemented in hardware or software actually, the specific application and design constraint depending on technical solution.Profession
Technical staff can use different methods to achieve the described function each specific application, but this realization is not answered
Think beyond the scope of this invention.
The foregoing description of the disclosed embodiments enables those skilled in the art to implement or use the present invention.
Various modifications to these embodiments will be readily apparent to those skilled in the art, as defined herein
General Principle can be realized in other embodiments without departing from the spirit or scope of the present invention.Therefore, of the invention
It is not intended to be limited to the embodiments shown herein, and is to fit to and the principles and novel features disclosed herein phase one
The widest scope of cause.
Claims (10)
1. a kind of picture loading method characterized by comprising
When receiving the load instruction to Target Photo, judge whether the Target Photo needs to carry out piecemeal load;
When the Target Photo needs to carry out piecemeal load, the tile figure layer loaded to the Target Photo is obtained;
Determine maximum amplification level corresponding with the Target Photo, and according to the maximum amplification level setting and the tile
The corresponding tile dimensions of figure layer;
According to the maximum amplification level and the tile dimensions, determining tile quantity corresponding with the tile figure layer, and according to
According to the tile dimensions and the tile quantity, piecemeal is carried out to the tile figure layer and the Target Photo, obtain with it is described
The corresponding each tile of tile figure layer and each picture block corresponding with the Target Photo;
Pre-set piecemeal drawing practice is called, each picture block is drawn correspondingly to each tile
On, and by loading each tile for having drawn picture block, complete the load to the Target Photo.
2. judging whether the Target Photo needs to carry out piecemeal the method according to claim 1, wherein described
Load, comprising:
Determine the size of the occupied memory space of the Target Photo;
Judge whether the size of the occupied memory space of the Target Photo is no more than preset storage threshold value;
If the size of the occupied memory space of Target Photo is no more than the preset storage threshold value, the mesh is determined
Piece of marking on a map does not need to carry out piecemeal load;
If the size of the occupied memory space of Target Photo is more than the preset storage threshold value, the target is determined
Picture needs to carry out piecemeal load.
3. the method according to claim 1, wherein described obtain the tile loaded to the Target Photo
Figure layer;Determine maximum amplification level corresponding with the Target Photo, and according to the maximum amplification level setting and described watt
The corresponding tile dimensions of piece figure layer, comprising:
Calling presets piecemeal loading procedure, executes the succession instruction in the piecemeal loading procedure, and creation is inherited from advance
The view subclass of the view control class of setting;The view control class is used to carry out picture in pre-set display area
Load and display;
View figure layer corresponding with the view subclass is obtained, and executes the reload instruction in the piecemeal loading procedure, by institute
Stating view figure layer heavy duty is the figure layer with asynchronous piecemeal display function, to obtain the tile loaded to the Target Photo
Figure layer;
Determine the dimension of picture of the Target Photo and the display size of the display area, and according to the dimension of picture and institute
Display size is stated, scaling corresponding with the Target Photo is calculated;
According to the scaling, maximum amplification level corresponding with the Target Photo is determined, and according to the maximum amplification
Tile dimensions corresponding with the tile figure layer are arranged in level.
4. according to the method described in claim 3, it is characterized in that, it is described completion to the load of the Target Photo after, also wrap
It includes:
When receiving the amplification instruction to the Target Photo, picture region to be amplified in the Target Photo is determined;
The piecemeal loading procedure is reruned, determines the area size of the picture region, according to the area size and institute
Display size is stated, determines new scaling corresponding with the picture region;
According to the new scaling, new maximum amplification level corresponding with the picture region is determined, and according to load
The tile dimensions when Target Photo and the new maximum amplification level determine that load the picture region corresponding new
Tile quantity obtains and loads the corresponding each new tile of the picture region;
According to the tile dimensions and the new tile quantity, the picture region is subjected to piecemeal, obtain it is each with it is described
Picture region it is corresponding and with the consistent region picture block of new tile quantity;
The piecemeal drawing practice is called, each region picture block is drawn correspondingly to each new tile
On, and the tile by loading each picture block of drawing area, obtain the picture region amplified.
5. method according to claim 1 or 4, which is characterized in that it is described to call pre-set piecemeal drawing practice, it will
Each picture block is drawn correspondingly to each tile, and by loading each watt for having drawn picture block
Piece completes the load to the Target Photo, comprising:
At least one tile, and holding according to each asynchronous thread are randomly assigned in pre-set each asynchronous thread
Traveling degree calls the piecemeal drawing practice, and each picture block is drawn correspondingly to each tile;
According to each asynchronous thread implementation progress and draw the sequence of each picture block, successively by it is each watt
The picture block that on piece is drawn is loaded.
6. a kind of picture loading device characterized by comprising
Judging unit, for judging whether the Target Photo needs to carry out when receiving the load instruction to Target Photo
Piecemeal load;
Acquiring unit, for when the Target Photo needs to carry out piecemeal load, acquisition to load the Target Photo
Tile figure layer;
Setting unit, for determining maximum amplification level corresponding with the Target Photo, and according to the maximum amplification level
Tile dimensions corresponding with the tile figure layer are set;
First blocking unit, for according to the maximum amplification level and the tile dimensions, determination and the tile figure layer pair
The tile quantity answered, and according to the tile dimensions and the tile quantity, to the tile figure layer and the Target Photo into
Row piecemeal obtains and the corresponding each tile of the tile figure layer and each picture block corresponding with the Target Photo;
Loading unit, for calling pre-set piecemeal drawing practice, by each picture block draw correspondingly to
On each tile, and by loading each tile for having drawn picture block, the load to the Target Photo is completed.
7. device according to claim 6, which is characterized in that the judging unit, comprising:
First determines subelement, for determining the Target Photo institute when receiving the instruction of the load to the Target Photo
The size of the memory space of occupancy;
Judgment sub-unit, for judging whether the size of the occupied memory space of the Target Photo is no more than preset storage
Threshold value;
First determines subelement, if the size for the occupied memory space of the Target Photo is no more than described preset deposit
Threshold value is stored up, then determines that the Target Photo does not need to carry out piecemeal load;
Second determines subelement, if the size for the occupied memory space of the Target Photo is more than the preset storage
Threshold value then determines that the Target Photo needs to carry out piecemeal load.
8. device according to claim 6, which is characterized in that the setting unit, comprising:
First executes subelement, presets piecemeal loading procedure for calling, executes the succession in the piecemeal loading procedure
Instruction, creation are inherited from the view subclass of pre-set view control class;The view control class is used for pre-set
Picture is loaded and shown in display area;
Second executes subelement, for obtaining view figure layer corresponding with the view subclass, and executes the piecemeal load journey
The view figure layer heavy duty is the figure layer with asynchronous piecemeal display function by the reload instruction in sequence, to obtain to the mesh
The tile figure layer that piece of marking on a map is loaded;
And operator unit, for determining the dimension of picture of the Target Photo and the display size of the display area, and foundation
The dimension of picture and the display size calculate scaling corresponding with the Target Photo;
Subelement is set, is used for according to the scaling, determining maximum amplification level corresponding with the Target Photo, and according to
According to the maximum amplification level, tile dimensions corresponding with the tile figure layer are set.
9. device according to claim 8, which is characterized in that further include:
Second determination unit, for when receiving the amplification instruction to the Target Photo, determine in the Target Photo to
The picture region of amplification;
Running unit determines the area size of the picture region, according to described in for reruning the piecemeal loading procedure
Area size and the display size determine new scaling corresponding with the picture region;
Third determination unit, for determining that new maximum corresponding with the picture region is put according to the new scaling
Big level, and according to the tile dimensions and the new maximum amplification level when loading the Target Photo, it determines described in load
The corresponding new tile quantity of picture region obtains and loads the corresponding each new tile of the picture region;
Second blocking unit, for according to the tile dimensions and the new tile quantity, the picture region to be divided
Block, obtain it is each corresponding with the picture region and with the consistent region picture block of new tile quantity;
Drawing unit is drawn each region picture block correspondingly to each for calling the piecemeal drawing practice
On a new tile, and the tile by loading each picture block of drawing area, obtain the picture region amplified.
10. device according to claim 6, which is characterized in that the loading unit, comprising:
Subelement is distributed, for being randomly assigned at least one tile in pre-set each asynchronous thread, and according to each
The implementation progress of the asynchronous thread calls the piecemeal drawing practice, by each picture block draw correspondingly to
On each tile;
Subelement is loaded, for the implementation progress according to each asynchronous thread and draws the sequence of each picture block,
Successively each picture block drawn on tile is loaded.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910456374.7A CN110187924A (en) | 2019-05-29 | 2019-05-29 | Picture loading method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910456374.7A CN110187924A (en) | 2019-05-29 | 2019-05-29 | Picture loading method and device |
Publications (1)
Publication Number | Publication Date |
---|---|
CN110187924A true CN110187924A (en) | 2019-08-30 |
Family
ID=67718505
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910456374.7A Pending CN110187924A (en) | 2019-05-29 | 2019-05-29 | Picture loading method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110187924A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2022161199A1 (en) * | 2021-01-29 | 2022-08-04 | 北京字跳网络技术有限公司 | Image editing method and device |
Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7570271B1 (en) * | 2006-02-10 | 2009-08-04 | Adobe Systems Incorporated | High speed display of high resolution image |
CN103514241A (en) * | 2012-12-07 | 2014-01-15 | Tcl集团股份有限公司 | Image loading method and system |
US20140118365A1 (en) * | 2012-10-26 | 2014-05-01 | Nvidia Corporation | Data structures for efficient tiled rendering |
CN104850457A (en) * | 2015-05-27 | 2015-08-19 | 北京航天理想科技股份有限公司 | Rapid load display method and system for magnanimity images in association graphs |
CN105022818A (en) * | 2015-07-08 | 2015-11-04 | 纪兴瑞 | Tile map storing and loading method |
US20170123617A1 (en) * | 2014-03-26 | 2017-05-04 | Beijing Qihoo Technology Company Limited | Picture loading apparatus and method |
CN107403014A (en) * | 2017-08-04 | 2017-11-28 | 光典信息发展有限公司 | The display methods of image file, apparatus and system |
CN109657172A (en) * | 2018-11-30 | 2019-04-19 | 广州欧科信息技术股份有限公司 | Preview picture method, apparatus, equipment and storage medium |
-
2019
- 2019-05-29 CN CN201910456374.7A patent/CN110187924A/en active Pending
Patent Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7570271B1 (en) * | 2006-02-10 | 2009-08-04 | Adobe Systems Incorporated | High speed display of high resolution image |
US20140118365A1 (en) * | 2012-10-26 | 2014-05-01 | Nvidia Corporation | Data structures for efficient tiled rendering |
CN103514241A (en) * | 2012-12-07 | 2014-01-15 | Tcl集团股份有限公司 | Image loading method and system |
US20170123617A1 (en) * | 2014-03-26 | 2017-05-04 | Beijing Qihoo Technology Company Limited | Picture loading apparatus and method |
CN104850457A (en) * | 2015-05-27 | 2015-08-19 | 北京航天理想科技股份有限公司 | Rapid load display method and system for magnanimity images in association graphs |
CN105022818A (en) * | 2015-07-08 | 2015-11-04 | 纪兴瑞 | Tile map storing and loading method |
CN107403014A (en) * | 2017-08-04 | 2017-11-28 | 光典信息发展有限公司 | The display methods of image file, apparatus and system |
CN109657172A (en) * | 2018-11-30 | 2019-04-19 | 广州欧科信息技术股份有限公司 | Preview picture method, apparatus, equipment and storage medium |
Non-Patent Citations (3)
Title |
---|
冯贺等: "《Android程序设计实用教程:Android Studio版》", 31 August 2017, 中国铁道出版社 * |
张广春等: "基于ArcGIS Engine组件实现瓦片地图的应用", 《测绘通报》 * |
蔡坪等: "基于瓦片金字塔模型的高分辨率岩心图像预览", 《大赫兹科学与电子信息学报》 * |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2022161199A1 (en) * | 2021-01-29 | 2022-08-04 | 北京字跳网络技术有限公司 | Image editing method and device |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US11561680B2 (en) | Method and apparatus for adding icon to interface of android system, and mobile terminal | |
US11169659B2 (en) | Method and device for folder management by controlling arrangements of icons | |
CN113918260B (en) | Application display method, device and electronic device | |
US20100255882A1 (en) | Apparatus and a method for arranging elements on a display | |
CN103970411B (en) | For preparing the method and electronic installation of screen | |
US10627980B2 (en) | Organization mode support mechanisms | |
CN103488379A (en) | Desktop element adjusting method and desktop element adjusting device for intelligent terminal | |
EP1907953A2 (en) | Tiled map display on a wireless device | |
CN102722321A (en) | Method and device for switching between double cameras | |
CN107357501B (en) | Desktop wallpaper updating method and device and terminal | |
CN107329653A (en) | Adjust the method and device of icon sizes | |
WO2014190779A1 (en) | Application icon arrangement method and terminal | |
CN110347317A (en) | Window switching method and device, storage medium and interactive intelligent panel | |
CN104461312A (en) | Display control method and electronic equipment | |
EP2871826B1 (en) | Method, device and terminal for adjusting widget | |
CN104793945A (en) | Large-batch picture displaying method for preventing memory overflow and device thereof | |
CN105204842B (en) | A kind of display control method and electronic equipment | |
CN110187924A (en) | Picture loading method and device | |
CN112269501A (en) | Icon moving method and device and electronic equipment | |
CN108564539A (en) | A kind of method and apparatus of display image | |
CN103365545A (en) | Method and device for loading data onto pages | |
CN112269513A (en) | Interface display method and device and electronic equipment | |
CN105653309B (en) | A kind of display control method and device, electronic equipment | |
CN112492108B (en) | Call processing method and device and electronic equipment | |
WO2017078132A1 (en) | Mobile terminal and application program |
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 | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20190830 |
|
RJ01 | Rejection of invention patent application after publication |