CN111475665A - Picture playing method, device, terminal and storage medium - Google Patents

Picture playing method, device, terminal and storage medium Download PDF

Info

Publication number
CN111475665A
CN111475665A CN202010305087.9A CN202010305087A CN111475665A CN 111475665 A CN111475665 A CN 111475665A CN 202010305087 A CN202010305087 A CN 202010305087A CN 111475665 A CN111475665 A CN 111475665A
Authority
CN
China
Prior art keywords
picture
target
merging
width
height
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.)
Granted
Application number
CN202010305087.9A
Other languages
Chinese (zh)
Other versions
CN111475665B (en
Inventor
刘春宇
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangzhou Kugou Computer Technology Co Ltd
Original Assignee
Guangzhou Kugou Computer Technology Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Guangzhou Kugou Computer Technology Co Ltd filed Critical Guangzhou Kugou Computer Technology Co Ltd
Priority to CN202010305087.9A priority Critical patent/CN111475665B/en
Publication of CN111475665A publication Critical patent/CN111475665A/en
Application granted granted Critical
Publication of CN111475665B publication Critical patent/CN111475665B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/50Information retrieval; Database structures therefor; File system structures therefor of still image data
    • G06F16/54Browsing; Visualisation therefor

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Controls And Circuits For Display Device (AREA)
  • Studio Circuits (AREA)

Abstract

The embodiment of the application discloses a picture playing method, a picture playing device, a terminal and a storage medium, and belongs to the technical field of computers. The method comprises the following steps: receiving a picture playing instruction, wherein the picture playing instruction is used for instructing to play n target pictures; requesting a picture playing memory according to the merging size of the n target pictures, wherein the merging size is the size of a target synthetic picture obtained by merging the n target pictures, and the picture playing memory is used for caching the target synthetic picture; writing a target synthetic picture obtained by compressing and combining n target pictures into a picture playing memory; and loading the target synthetic picture through a player, and playing n target pictures. In the embodiment of the application, a plurality of target pictures are combined into one target composite picture, all the target pictures can be cached at one time, and the memory does not need to be applied for many times and the current resources do not need to be cleared, so that the picture playing efficiency is improved, and the resource waste caused by memory fragments is avoided.

Description

Picture playing method, device, terminal and storage medium
Technical Field
The embodiment of the application relates to the technical field of computers, in particular to a picture playing method, a picture playing device, a terminal and a storage medium.
Background
With the continuous updating and development of the terminal photo album function, a user can store and check the pictures more conveniently, meanwhile, the requirement on the picture checking mode is gradually improved, and the photo album pictures can be automatically played, so that the user can conveniently and quickly browse the photo album.
In the related technology, a terminal acquires a designated picture set, caches the picture set in batches according to the preset single caching quantity and applies for a picture playing memory, and when playing of one batch of pictures is completed, reappears for the playing memory of the next batch of pictures until all pictures in the picture set are played completely.
However, with the picture playing method in the related art, the picture playing memory needs to be applied for many times, the picture playing efficiency is low, the terminal power consumption is large, and memory fragments are easy to generate, which causes resource waste.
Disclosure of Invention
The embodiment of the application provides a picture playing method, a picture playing device, a terminal and a storage medium. The technical scheme is as follows:
in one aspect, an embodiment of the present application provides a method for playing a picture, where the method includes:
receiving a picture playing instruction, wherein the picture playing instruction is used for instructing to play n target pictures, and n is an integer greater than or equal to 1;
requesting a picture playing memory according to the merging size of the n target pictures, wherein the merging size is the size of a target synthesized picture obtained by merging the n target pictures, and the picture playing memory is used for caching the target synthesized picture;
writing the target synthetic picture obtained by compressing and combining n target pictures into the picture playing memory;
and loading the target synthetic picture through a player, and playing n target pictures.
In a possible implementation manner, before requesting a picture play memory according to the merge size of n target pictures, the method further includes:
acquiring the current display state of the player, wherein the current display state comprises a horizontal screen display state and a vertical screen display state;
determining a picture synthesis mode according to the current display state, wherein the picture synthesis mode comprises horizontal synthesis and vertical synthesis;
and determining the merging size according to the picture synthesis mode and the size of the n target pictures.
In a possible embodiment, the picture synthesizing manner is the horizontal synthesis, and the determining the merging size according to the picture synthesizing manner and the size of the n target pictures includes:
determining a combined height according to the display height of the player in the horizontal screen display state, wherein the combined height is smaller than the display height;
in response to the fact that the height of the target picture is larger than the merging height, compressing the height of the target picture to the merging height, and compressing the width of the target picture in an equal proportion;
determining the merging size according to the merging height and the merging width, wherein the merging width is the sum of the widths of the n target pictures after compression processing;
the writing the target synthesized picture obtained by compressing and combining n target pictures into the picture play memory includes:
splicing the left edge of the (i + 1) th compressed target picture with the right edge of the (i + 1) th compressed target picture to obtain a target synthetic picture, wherein i is an integer larger than 0 and smaller than n;
and writing the target synthetic picture into the picture playing memory.
In a possible implementation manner, the picture synthesis manner is the vertical synthesis, and the determining the merging size according to the picture synthesis manner and the size of the n target pictures includes:
determining a merging width according to the display width of the player in the vertical screen display state, wherein the merging width is smaller than the display width;
in response to the width of the target picture being larger than the merging width, compressing the width of the target picture to the merging width, and compressing the height of the target picture in equal proportion;
determining the merging size according to the merging width and the merging height, wherein the merging height is the sum of the heights of the n target pictures after compression processing;
the writing the target synthesized picture obtained by compressing and combining n target pictures into the picture play memory includes:
splicing the upper edge of the (i + 1) th compressed target picture with the lower edge of the (i) th compressed target picture to obtain a target synthetic picture, wherein i is an integer larger than 0 and smaller than n;
and writing the target synthetic picture into the picture playing memory.
In a possible implementation manner, the player adopts a first playing manner, where the first playing manner refers to playing n target pictures at a constant speed in a sliding manner;
the playing n target pictures includes:
determining a window size of a sliding window according to the combined size, wherein the window size comprises a window width and a window height, and the combined size comprises a combined width and a combined height, wherein when the current display state is the landscape screen display state, the window height is equal to the combined height, and the window width is a preset window width; when the current display state is the vertical screen display state, the window width is equal to the combined width, and the window height is a preset window height;
sliding the sliding window on the target composite picture according to a sliding speed, wherein when the current display state is the landscape screen display state, the sliding speed is determined according to the merging width and the picture playing time length; when the current display state is the vertical screen display state, the sliding speed is determined according to the merging height and the picture playing time length;
and displaying the image in the sliding window in the display area according to the combined size and the size of the display area of the player.
In a possible implementation manner, the player adopts a second playing manner, and the second playing manner is to update the target picture every predetermined time length;
the playing n target pictures includes:
determining a window size of a sliding window according to the merging size, wherein the window size comprises a window width and a window height, the merging size comprises a merging width and a merging height, when the current display state is the landscape screen display state, the window width is equal to the width of a next target picture after compression and merging, and the window height is equal to the merging height, and when the current display state is the portrait screen display state, the window width is equal to the merging width and the window height is equal to the height of the next target picture after compression and merging;
sliding the sliding window on the target synthesized picture at intervals of the preset time according to a target sliding distance, wherein when the current display state is the horizontal screen display state, the target sliding distance is equal to the width of the compressed and combined current target picture; when the current display state is the vertical screen display state, the target sliding distance is equal to the height of the compressed and combined current target picture;
and displaying the image in the sliding window in a display area according to the size of the compressed and combined target picture and the size of the display area of the player.
In a possible implementation manner, after the playing n target pictures, the method further includes:
receiving a seek instruction, wherein the seek instruction is used for indicating that the target picture is played from a target moment;
determining an initial coordinate according to the picture playing time and the target time, wherein the initial coordinate is used for indicating an initial sliding position of a sliding window on the target synthetic picture;
and starting from the starting coordinate, playing the target picture.
On the other hand, an embodiment of the present application provides a picture playing apparatus, where the apparatus includes:
the device comprises a first receiving module, a second receiving module and a display module, wherein the first receiving module is used for receiving a picture playing instruction, the picture playing instruction is used for indicating that n target pictures are played, and n is an integer which is greater than or equal to 1;
the request module is used for requesting a picture playing memory according to the merging size of the n target pictures, wherein the merging size is the size of a target synthetic picture obtained by merging the n target pictures, and the picture playing memory is used for caching the target synthetic picture;
a write-in module, configured to write the target composite picture obtained by compressing and merging n target pictures into the picture play memory;
and the first playing module is used for loading the target synthetic picture through a player and playing n target pictures.
In another aspect, an embodiment of the present application provides a terminal, where the terminal includes a processor and a memory; the memory stores at least one instruction for execution by the processor to implement the picture playing method of the above aspect.
In another aspect, an embodiment of the present application provides a computer-readable storage medium, where the storage medium stores at least one instruction, and the at least one instruction is used for being executed by a processor to implement the picture playing method according to the above aspect.
The technical scheme provided by the embodiment of the application has the beneficial effects that at least:
in the embodiment of the application, when the terminal receives a picture playing instruction, a picture playing memory is applied according to the merging size of a target picture, then a target synthetic picture obtained by compressing and merging the target picture is written into the picture playing memory, and the target synthetic picture is loaded through a player, so that the target picture is automatically played; the multiple target pictures are combined into one target composite picture, all the target pictures can be cached at one time, and the memory does not need to be applied for many times and the current resources do not need to be cleared, so that the picture playing efficiency is improved, and the resource waste caused by memory fragments is avoided.
Drawings
Fig. 1 is a flowchart illustrating a picture playing method according to an exemplary embodiment of the present application;
fig. 2 is a flowchart illustrating a picture playing method according to another exemplary embodiment of the present application;
FIG. 3 is a schematic diagram of a picture composition approach shown in accordance with an exemplary embodiment of the present application;
FIG. 4 is a schematic diagram of a picture composition approach shown according to another exemplary embodiment of the present application;
FIG. 5 is a schematic view of a sliding window shown in accordance with an exemplary embodiment of the present application;
FIG. 6 is a schematic view of a sliding window shown in accordance with another exemplary embodiment of the present application;
fig. 7 is a flowchart illustrating a picture playing method according to another exemplary embodiment of the present application;
fig. 8 is a block diagram illustrating a structure of a picture playing apparatus according to an exemplary embodiment of the present application;
fig. 9 is a block diagram illustrating a structure of a picture playing apparatus according to another exemplary embodiment of the present application;
fig. 10 is a block diagram illustrating a structure of a terminal according to an exemplary embodiment of the present application.
Detailed Description
To make the objects, technical solutions and advantages of the present application more clear, embodiments of the present application will be described in further detail below with reference to the accompanying drawings.
Reference herein to "a plurality" means two or more. "and/or" describes the association relationship of the associated objects, meaning that there may be three relationships, e.g., a and/or B, which may mean: a exists alone, A and B exist simultaneously, and B exists alone. The character "/" generally indicates that the former and latter associated objects are in an "or" relationship.
In the related technology, after receiving a picture playing instruction, a terminal loads target pictures in batches according to the preset picture loading quantity, and after the target pictures in the current batch are played, the terminal applies for a picture playing memory according to the size of the target pictures in the next batch and empties the memory occupied by the target pictures in the current batch until all the target pictures are played.
However, in the method for caching and playing the target pictures in batches in the related art, operations of requesting a memory and writing and loading pictures need to be performed for multiple times, the picture playing efficiency is low, memory fragments are easily generated, and thus resource waste is caused.
In order to solve the problems in the related art, an embodiment of the present application provides a picture playing method. The picture playing method provided by each embodiment of the application is used for a terminal with picture storage and picture processing functions, and the terminal can be a smart phone, a tablet computer, an electronic book reader, a personal portable computer and the like. By the picture playing method provided by the embodiment of the application, the terminal can compress and combine all target pictures into one target synthetic picture and play the target synthetic picture, so that the times of picture caching and loading are reduced, the picture playing efficiency is improved, and memory fragments caused by memory application for many times are avoided.
Referring to fig. 1, a flowchart of a picture playing method according to an embodiment of the present application is shown. In this embodiment, a picture playing method is described as an example when the method is used in a terminal with picture storage and picture processing functions, and the method includes:
step 101, receiving a picture playing instruction, where the picture playing instruction is used to instruct to play n target pictures, where n is an integer greater than or equal to 1.
In a possible implementation manner, when the picture playing method is applied to an album-type application program or a picture processing-type application program, the application program has a picture playing function, and a user can enable the terminal to automatically play a plurality of target pictures by starting the picture playing function. For example, the user triggers the picture playing control and selects n target pictures, so that the terminal receives a picture playing instruction.
Illustratively, after the user opens the relevant application program, the user may select to play all pictures in a certain album, or select to play designated pictures in a plurality of albums.
And step 102, requesting a picture playing memory according to the merging size of the n target pictures, wherein the merging size is the size of a target synthetic picture obtained by merging the n target pictures, and the picture playing memory is used for caching the target synthetic picture.
If the terminal directly applies for the picture playing memory according to the size of the target picture, the terminal may need to apply for the memory for multiple times due to the limitation of the number of picture caches, the current picture resource needs to be cleared before applying for a new picture playing memory for each time, and memory fragments may be generated when applying for the picture playing memory for multiple times, which results in resource waste. Therefore, in order to reduce the time length of the picture caching and improve the picture playing efficiency, in a possible implementation manner, the terminal first determines the merging size of n target pictures and requests the picture playing memory according to the merging size, and the subsequent terminal only needs to use the picture playing memory to play the pictures without performing operations of requesting the memory and clearing the picture resources.
And 103, writing the target synthetic picture obtained by compressing and combining the n target pictures into a picture playing memory.
In a possible implementation manner, in order to reduce a picture play memory required for playing a picture, before merging target pictures, the terminal compresses the target pictures, merges the compressed target pictures to obtain a target composite picture, and writes the target composite picture into the picture play memory.
And 104, loading the target synthetic picture through a player, and playing n target pictures.
In a possible implementation manner, after the terminal successfully writes the target merged picture into the picture playing memory, the player loads the target synthesized picture, and the display area of the player is used for playing the target picture.
Illustratively, a user can set a picture playing mode, a picture playing time and the like according to needs, and the terminal plays the target picture according to the setting of the user.
To sum up, in the embodiment of the present application, when the terminal receives a picture playing instruction, it first applies for a picture playing memory according to the merging size of a target picture, then writes a target synthesized picture obtained by compressing and merging the target pictures into the picture playing memory, and loads the target synthesized picture through the player, thereby implementing automatic playing of the target picture; the multiple target pictures are combined into one target composite picture, all the target pictures can be cached at one time, and the memory does not need to be applied for many times and the current resources do not need to be cleared, so that the picture playing efficiency is improved, and the resource waste caused by memory fragments is avoided.
Referring to fig. 2, a flowchart of a picture playing method according to another embodiment of the present application is shown. In this embodiment, a picture playing method is described as an example when the method is used in a terminal with picture storage and picture processing functions, and the method includes:
step 201, receiving a picture playing instruction, where the picture playing instruction is used to instruct to play n target pictures, where n is an integer greater than or equal to 1.
The step 101 may be referred to in the implementation manner of the step 201, and details of the embodiment of the present application are not described herein again.
Step 202, acquiring a current display state of the player, wherein the current display state comprises a horizontal screen display state and a vertical screen display state.
Since the number of target pictures is usually large and the sizes of the pictures are different, there are multiple picture synthesis modes, and in order to determine the picture synthesis mode and the picture playing mode suitable for the current display state of the player, in one possible embodiment, the terminal first acquires the current display state of the player before synthesizing and playing the target pictures.
Illustratively, at least one of a gravity sensor and an angular velocity sensor is installed in the terminal, and the current display state of the player is obtained according to the sensor data and is a horizontal screen display state or a vertical screen display state.
And step 203, determining a picture synthesis mode according to the current display state, wherein the picture synthesis mode comprises horizontal synthesis and vertical synthesis.
In a possible embodiment, since the display area of the player in the landscape display state is generally larger in display width than display height, the landscape synthesis mode is adopted, and the display area of the player in the portrait display state is generally larger in display height than display width, and the portrait synthesis mode is adopted. The horizontal synthesis refers to horizontally splicing the target pictures left and right, and the vertical synthesis refers to vertically splicing the target pictures up and down.
Optionally, the terminal may further determine the picture synthesis mode according to the display aspect ratio of the player in the current display state, determine that the picture synthesis mode is horizontal synthesis if the display aspect ratio of the player in the current display state is greater than 1, and determine that the picture synthesis mode is vertical synthesis if the display aspect ratio of the player in the current display state is less than 1.
And step 204, determining the merging size according to the picture synthesis mode and the size of the n target pictures.
Since the terminal needs to apply for the picture play memory according to the size of the target synthesized picture, the merging size is determined at first, and the merging size includes the merging width and the merging height, which are related to the picture synthesis mode and the size of the target picture.
In a possible embodiment, the picture synthesis method is horizontal synthesis, and step 204 includes the following steps one to three:
step one, determining a merging height according to the display height of the player in the horizontal screen display state, wherein the merging height is smaller than the display height.
Since the picture synthesis mode is horizontal synthesis when the player is in the landscape display state, the merging width is determined by the number and size of the target pictures, and the merging height is determined by the display height of the player in the landscape display state.
In a possible implementation manner, the terminal determines the merging height according to the display height of the player in the landscape display state, in order to reduce the required picture playing memory and improve the picture caching speed, the merging height is smaller than the display height.
Illustratively, the terminal presets the merged height in the landscape display state as 1/2, for example, the width and height of the player display area in the landscape display state is 1280 × 960, and then determines the merged height as 480.
Alternatively, the combined height in the landscape display state may be other heights such as 1/3, 3/4 of the player display height, which is not limited in the embodiment of the present application.
And step two, responding to the fact that the height of the target picture is larger than the merging height, compressing the height of the target picture to the merging height, and compressing the width of the target picture in an equal proportion.
In one possible implementation, when the height of the target picture is greater than the merging height, the height and the width of the target picture are compressed in equal proportion, so that the height of the compressed target picture is equal to the merging height.
Illustratively, if the width and height of a target picture are 1280 × 960 and the combined height is 480, the height and width of the target picture are respectively reduced to 480 and 640.
Optionally, if the height of the target picture is less than or equal to the merging height, the target picture is not compressed, for example, if the width and the height of one target picture are 1280 × 480 and the merging height is 480, the target picture is not compressed.
And step three, determining a merging size according to the merging height and the merging width, wherein the merging width is the sum of the widths of the n target pictures subjected to compression treatment.
In a possible implementation manner, the terminal determines the size of the n target pictures after the compression processing, and obtains the merging width of the n target pictures, and since the picture synthesis manner is transverse synthesis, the merging width is the sum of the widths of the n target pictures after the compression processing.
Illustratively, there are 3 target pictures, the width and height of each target picture are 1280 × 960, 300 × 300 and 200 × 800, and the terminal determines that the merge height is 480 according to the display height of the player in the current display state, and after the terminal compresses the 3 target pictures, the width and height of each target picture are 640 × 480, 300 × 300 and 120 × 480, that is, the merge height is 480 and the merge width is 1060, so that the merge size is determined to be 1060 480.
Optionally, if the heights of the n target pictures are all smaller than the preset merging height, directly merging the target pictures without compression, and the actual height of the target synthesized picture is the height of the target picture with the largest height.
In a possible embodiment, if the picture synthesis mode is vertical synthesis, the steps one to three are replaced by the following steps four to six:
and step four, determining a merging width according to the display width of the player in the vertical screen display state, wherein the merging width is smaller than the display width.
When the player is in the vertical screen display state, the picture synthesis mode is vertical synthesis, so the merging height is determined by the number and the size of the target pictures, and the merging width is determined by the display width of the player in the vertical screen display state.
In a possible implementation manner, the terminal determines the merging width according to the display width of the player in the vertical screen display state, in order to reduce the required picture playing memory and improve the picture caching speed, the merging width is smaller than the display width.
Illustratively, the terminal presets the merge width in the vertical screen display state as 1/2 of the display width, for example, if the width of the player display area in the vertical screen display state is 960 × 1280, then the merge width is determined as 480.
Optionally, the combined width in the portrait display state may also be other widths such as 1/3, 3/4 of the player display width, which is not limited in this embodiment of the application.
And step five, responding to the situation that the width of the target picture is larger than the merging width, compressing the width of the target picture to the merging width, and compressing the height of the target picture in an equal proportion.
In one possible implementation, when the width of the target picture is greater than the merging width, the height and the width of the target picture are compressed proportionally, so that the width of the compressed target picture is equal to the merging width.
Illustratively, if the width and height of a target picture are 1280 × 960 and the combined width is 480, the width and height of the target picture are respectively reduced to 480 and 360.
Optionally, if the width of the target picture is less than or equal to the merging width, the target picture is not compressed, for example, if the width of one target picture is 480 × 1280, and the merging width is 480, the target picture is not compressed.
And step six, determining a merging size according to the merging width and the merging height, wherein the merging height is the sum of the heights of the n target pictures after compression treatment.
In a possible implementation manner, the terminal determines the size of the n target pictures after compression processing, and obtains the combined height of the n target pictures, and since the picture synthesis manner is vertical synthesis, the combined height is the sum of the heights of the n target pictures after compression processing.
Illustratively, there are 3 target pictures, each of which has a width and a height of 1280 × 960, 300 × 300, and 200 × 800, and the terminal determines that the merge width is 480 according to the display width of the player in the current display state, and then after the terminal compresses the 3 target pictures, the widths and the heights are 480 × 360, 300 × 300, and 200 × 800, that is, the merge width is 480 and the merge height is 1460, thereby determining that the merge size is 480 × 1460.
Optionally, if the widths of the n target pictures are all smaller than the preset merging width, directly merging the target pictures without performing compression processing, and the actual width of the target synthesized picture is the width of the target picture with the largest width.
In step 205, a picture playing memory is requested according to the merging size of the n target pictures, where the merging size is the size of the target synthesized picture obtained by merging the n target pictures, and the picture playing memory is used for caching the target synthesized picture.
In a possible implementation manner, the application program determines the size of the picture play memory to be occupied according to the information such as the merging size and the pixel value of the target picture, and requests the picture play memory.
Step 206, writing the target synthetic picture obtained by compressing and combining the n target pictures into the picture playing memory.
And after the application program is successfully distributed to the picture playing memory, the terminal compresses and merges the n target pictures according to the merging size and the picture composition mode to obtain a target composite picture, and writes the target composite picture into the picture playing memory.
In one possible embodiment, the picture synthesis method is horizontal synthesis, and step 206 includes the following steps:
step one, splicing the left edge of the (i + 1) th compressed target picture and the right edge of the (i + 1) th compressed target picture to obtain a target composite picture, wherein i is an integer larger than 0 and smaller than n.
In one possible embodiment, the target pictures are aligned in the middle of height, that is, the horizontal symmetry axes of the n target pictures are located on the same horizontal line, and except for the first target picture, the left edge of each target picture is spliced with the right edge of the previous target picture.
Referring to fig. 3, a schematic diagram of a target composite picture 301 obtained by laterally synthesizing 3 target pictures is shown. The target synthesized picture 301 is composed of a picture a, a picture b, and a picture c, the original widths and heights of the 3 target pictures are 1280 × 960, 300 × 300, and 200 × 800, respectively, and the corresponding merging height of the player in the state of horizontal screen display is 480, then the widths and heights after compression processing are 640 × 480, 300 × 300, and 120 × 480, respectively, and the merging size of the target synthesized picture 301 is 1060 × 480.
Optionally, the target picture may also be horizontally aligned at the lower edge or horizontally aligned at the upper edge, which is not limited in this application.
And step two, writing the target synthetic picture into a picture playing memory.
Illustratively, the terminal writes the target composite picture 301 with the merging size of 1060 × 480 into a picture play memory applied in advance, and renders the target composite picture 301.
In a possible embodiment, if the picture synthesis mode is vertical synthesis, the above steps one and two are replaced by the following steps three and four:
and step three, splicing the upper edge of the (i + 1) th compressed target picture with the lower edge of the (i) th compressed target picture to obtain a target synthetic picture, wherein i is an integer larger than 0 and smaller than n.
In one possible embodiment, the target pictures are aligned centrally in width, i.e. the vertical symmetry axes of the n target pictures are located on the same line, and except for the first target picture, the upper edge of each target picture is spliced with the lower edge of the previous target picture.
Referring to fig. 4, a schematic diagram of a target composite picture 401 obtained by vertically synthesizing 3 target pictures is shown. The target synthesized picture 401 is composed of a picture a, a picture b, and a picture c, the original widths and heights of the 3 target pictures are 1280 × 960, 300 × 300, and 200 × 800, respectively, and the corresponding merging width of the player in the vertical screen display state is 480, then the widths and heights of the 3 target pictures after the compression processing are 480 × 360, 300 × 300, and 200 × 800, respectively, and the merging size of the target synthesized picture 401 is 480 × 1460.
Optionally, the target picture may also be horizontally aligned at the lower edge or horizontally aligned at the upper edge, which is not limited in this application.
And step four, writing the target synthetic picture into a picture playing memory.
Illustratively, the terminal writes the target composite picture 401 with the merging size of 480 × 1460 into the picture play memory applied in advance, and renders the target composite picture 401.
Step 207, the target composite picture is loaded by the player, and n target pictures are played.
Since the size of the target composite picture is usually large, the combined width thereof is much larger than the display width of the player, or the combined height thereof is much larger than the display height of the player, the terminal cannot directly and completely display the target composite picture. In a possible implementation mode, before the terminal plays the target picture by using the player, a sliding window is set, the terminal slides on the target additional composite picture through the sliding window, and images in the sliding window are displayed in real time, so that the target picture is played.
Optionally, the user may select a picture playing mode, and the terminal sets a sliding window according to the merging size of the target synthesized picture and the picture synthesizing mode.
In a possible implementation manner, the player adopts a first playing manner, where the first playing manner indicates that n target pictures are played at a constant speed in a sliding manner, step 207 includes the following steps one to three:
determining the window size of a sliding window according to a combined size, wherein the window size comprises a window width and a window height, and the combined size comprises a combined width and a combined height, wherein when the current display state is a horizontal screen display state, the window height is equal to the combined height, and the window width is a preset window width; and when the current display state is the vertical screen display state, the window width is equal to the combined width, and the window height is the preset window height.
Referring to fig. 5, a schematic diagram of a sliding window in a landscape display state is shown, where when a player plays a target picture in the landscape display state, a window height of the sliding window 501 is equal to a combined height 480 of the target composite picture 301, and a window width of the sliding window 501 is a preset width.
Optionally, the terminal determines the window width according to the size of the display area of the player in the current display state and the window height, so that the aspect ratio of the sliding window is the same as the aspect ratio of the display area of the player. For example, if the aspect ratio of the display area of the player in the landscape display state is 1280 × 960 and the window height of the sliding window 501 is 480, the window width of the sliding window 501 may be determined to be 640.
Referring to fig. 6, a schematic diagram of a sliding window in a vertical screen display state is shown, where when a player plays a target picture in the vertical screen display state, a window width of the sliding window 601 is equal to a merging width 480 of the target composite picture 401, and the window width of the sliding window 601 is a preset width.
Optionally, the terminal determines the window height according to the size of the display area of the player in the current display state and the window width, so that the aspect ratio of the sliding window is the same as the aspect ratio of the display area of the player. For example, if the aspect ratio of the display area of the player in the vertical screen display state is 960 × 1280, and the window width of the sliding window 601 is 480, the window height of the sliding window 601 may be determined to be 640.
Sliding a sliding window on the target composite picture according to the sliding speed, wherein when the current display state is a horizontal screen display state, the sliding speed is determined according to the merging width and the picture playing time length; and when the current display state is the vertical screen display state, the sliding speed is determined according to the merging height and the picture playing time length.
In a possible implementation manner, the user may set the picture playing time length, and when the current display state is the landscape display state, the sliding speed is equal to the merging width divided by the picture playing time length, and when the current display state is the portrait display state, the sliding speed is equal to the merging height divided by the picture playing time length.
Illustratively, as shown in fig. 5, the player plays the target picture horizontally, the merging width of the target composite picture 301 is 1060, the user sets the picture playing time to be 5 seconds, and the sliding speed of the sliding window 501 is 212 seconds per second.
Illustratively, as shown in fig. 6, the player vertically plays the target picture, the merging height of the target composite picture 401 is 1460, the user sets the picture playing time to be 5 seconds, and the sliding speed of the sliding window 601 is 292 seconds.
Alternatively, the terminal may preset a default sliding speed and slide the sliding window according to the default sliding speed.
And step three, displaying the image in the sliding window in the display area according to the combined size and the size of the display area of the player.
In a possible implementation manner, since the target composite picture is a picture formed by compressing and merging the target pictures, and therefore the merging width of the target composite picture is smaller than the display width of the player, or the merging height of the target composite picture is smaller than the display height of the player, the terminal appropriately stretches the image in the sliding window and displays the image in the display area according to the merging size and the size of the display area of the player.
Illustratively, if the player displays a region having a width and a height of 1280 × 960 in a landscape display state and the target composite picture has a combined size of 1060 × 480, the terminal stretches the image within the sliding window to have a height of 960 and stretches the width of the image to 1280 in an equal proportion.
In a possible implementation manner, the player adopts a second playing manner, where the second playing manner is to update the target picture every predetermined time, and the steps one to three are replaced with the following steps four to six:
and step four, determining the window size of the sliding window according to the merging size, wherein the window size comprises a window width and a window height, the merging size comprises a merging width and a merging height, when the current display state is the horizontal screen display state, the window width is equal to the width of the next target picture after compression and merging, and the window height is equal to the merging height, and when the current display state is the vertical screen display state, the window width is equal to the merging width and the window height is equal to the height of the next target picture after compression and merging.
For example, referring to fig. 3, when the player is in the landscape display state, the window height of the sliding window is equal to the combined height 480 of the target composite picture 301, and the window width of the sliding window is determined by the width of the compressed target picture, i.e. when the sliding window moves to picture a, the window width is 640, and when the sliding window moves to picture b, the window width is 300. And before sliding the sliding window, adjusting the window width to the width of the next target picture after compression and combination.
For example, referring to fig. 4, when the player is in the portrait display state, the window width of the sliding window is equal to the combined width 480 of the target composite picture 401, and the window height of the sliding window is determined by the height of the compressed target picture, that is, when the sliding window moves to the picture a, the window height is 360, and when the sliding window moves to the picture b, the window height is 300.
Sliding a sliding window on the target synthesized picture at intervals of preset time, wherein when the current display state is a horizontal screen display state, the target sliding distance is equal to the width of the compressed and combined current target picture; and when the current display state is the vertical screen display state, the target sliding distance is equal to the height of the compressed and combined current target picture.
In a possible implementation manner, the user may set a display duration of each target picture, and the terminal sets the display duration as a preset duration for the sliding window to perform the sliding operation. For example, if the user sets that one target picture is displayed every second, the terminal slides a sliding window once every 1 second on the target composite picture according to the target sliding distance.
Schematically, referring to fig. 3, the player is in a landscape display state, when the sliding window slides from picture a to picture b, the target sliding distance is the width of compressed and combined picture a, i.e. 640, and when the sliding window slides from picture b to picture c, the target sliding distance is the width of compressed and combined picture b, i.e. 300.
Schematically, referring to fig. 4, when the player is in the vertical screen display state, when the sliding window slides from picture a to picture b, the target sliding distance is the height of compressed and combined picture a, i.e. 360, and when the sliding window slides from picture b to picture c, the target sliding distance is the height of compressed and combined picture b, i.e. 300.
Optionally, the user may further set a picture playing time, and the terminal determines the preset time according to the picture playing time and the number of the target pictures.
And step six, displaying the image in the sliding window in the display area according to the size of the compressed and combined target picture and the size of the display area of the player.
In a possible implementation manner, since the target synthesized picture is a picture formed by compressing and combining the target pictures, there may be a case where the width of the target picture is smaller than the display width of the player and the height of the target picture is smaller than the display height of the player, and the terminal appropriately stretches and displays the image in the sliding window in the display area according to the size of the compressed and combined target picture and the size of the display area of the player.
Illustratively, when the width and the height of the display area of the player in the landscape display state are 1280 × 960, and the compressed and combined size of the target picture is 1060 × 480, the terminal stretches the image in the sliding window to make the height of the image 960, and stretches the width of the image to 1280 in equal proportion.
In the embodiment of the application, the terminal can determine the picture synthesis mode according to the current display state of the player, so that the size of the target synthesized picture is adapted to the display area of the player, and the window size and the sliding mode of the sliding window are set according to the picture playing mode and the picture synthesis mode selected by the user, so that the image displayed in the display area of the player can achieve the playing effect required by the user and can also be adapted to the current display state of the player.
Optionally, the user may select any time through the seek instruction during the picture playing process, so that the player starts playing the target picture from the time. In a possible implementation manner, referring to fig. 7 on the basis of fig. 2, the picture playing method further includes the following steps 208 to 210:
and step 208, receiving a seek instruction, where the seek instruction is used to instruct to play the target picture from the target time.
In a possible implementation, the user may cause the player to play the target picture from the target time point through the seek instruction. For example, when the player plays a target picture, a play progress bar exists in the display interface, the user can slide or click the play progress bar to any time, and when the terminal detects the sliding operation of the play progress bar, the target time is acquired and the seek instruction is received.
Alternatively, the user may also drag the target composite picture to cause the player to play the target picture from the target position according to the drag operation.
And step 209, determining an initial coordinate according to the picture playing time and the target time, wherein the initial coordinate is used for indicating an initial sliding position of the sliding window on the target synthetic picture.
In a possible implementation manner, the player adopts a first playing manner, plays n target pictures at a constant speed in a sliding manner, and is in a landscape display state, and the combination width of the initial coordinate/the target synthesized picture is equal to the target time/the picture playing duration; the player adopts a first playing mode to play n target pictures in a sliding mode at a constant speed, and is in a vertical screen display state, and the combination height of the initial coordinate/the target synthesized picture is equal to the target time/the picture playing time length.
Illustratively, the player is in a landscape display state, the merging width of the target composite picture is 1060, the picture playing time is 10 seconds, the target time of the seek instruction is 3 seconds, and the starting coordinate is located at the left edge 318 of the target merged picture in the width direction of the target composite picture.
In a possible implementation manner, the player adopts a second playing manner, the target pictures are updated every other preset time, and the player is in a landscape display state, so that the terminal firstly determines an initial picture according to the picture playing time, the target time and the number n of the target pictures, and then determines an initial coordinate according to the compressed widths of all the target pictures before the initial picture; and the player adopts a second playing mode, the target pictures are updated at intervals of preset time, and the player is in a vertical screen display state, so that the terminal firstly determines an initial picture according to the picture playing time, the target time and the number n of the target pictures, and then determines an initial coordinate according to the compressed heights of all the target pictures before the initial picture.
Illustratively, the player is in a landscape display state, the compressed widths and heights of 3 target pictures forming the target merged picture are 640 × 480, 300 × 300, and 120 × 480 respectively, the picture playing time is 10 seconds, the target time of the seek instruction is 9 seconds, the starting picture is the 3 rd target picture, and the starting coordinate is 940 away from the left edge of the target merged picture in the width direction of the target synthesized picture.
Step 210, starting from the start coordinate, the target picture is played.
And after the terminal determines the initial coordinate, sliding the left edge of the sliding window to the initial coordinate, and starting to play the target picture according to the picture playing mode, wherein if the player adopts a second playing mode, the terminal needs to adjust the window size of the sliding window according to the size of the compressed initial picture.
In the embodiment of the application, a user can select any target time from the picture playing duration through a seek instruction, so that the player starts to play the target picture from the target time, the terminal converts the target time into the initial coordinate of the sliding window according to the seek instruction and the picture playing mode, and directly slides the sliding window to the initial coordinate to start playing the target picture.
Referring to fig. 8, a block diagram of a picture playing apparatus according to an exemplary embodiment of the present application is shown. The apparatus may be implemented as all or a portion of the terminal in software, hardware, or a combination of both. The device includes:
a first receiving module 801, configured to receive a picture playing instruction, where the picture playing instruction is used to instruct to play n target pictures, where n is an integer greater than or equal to 1;
a request module 802, configured to request, according to a merge size of n target pictures, a picture playing memory, where the merge size is a size of a target composite picture obtained by merging the n target pictures, and the picture playing memory is used to cache the target composite picture;
a writing module 803, configured to write the target composite picture obtained by compressing and merging n target pictures into the picture play memory;
a first playing module 804, configured to load the target composite picture through a player, and play n target pictures.
Optionally, as shown in fig. 9, the apparatus further includes:
an obtaining module 805, configured to obtain a current display state of the player, where the current display state includes a horizontal screen display state and a vertical screen display state;
a first determining module 806, configured to determine, according to the current display state, a picture synthesis manner, where the picture synthesis manner includes horizontal synthesis and vertical synthesis;
a second determining module 807, configured to determine the merging size according to the picture synthesis manner and the size of the n target pictures.
Optionally, the picture synthesis manner is the horizontal synthesis, and the second determining module 807 includes:
a first determining unit, configured to determine a merging height according to a display height of the player in the landscape display state, where the merging height is smaller than the display height;
the first compression unit is used for responding to the situation that the height of the target picture is larger than the merging height, compressing the height of the target picture to the merging height, and compressing the width of the target picture in an equal proportion;
a second determining unit, configured to determine the merging size according to the merging height and a merging width, where the merging width is a sum of widths of the n target pictures after compression processing;
the writing module 803 includes:
the first splicing unit is used for splicing the left edge of the (i + 1) th compressed target picture and the right edge of the (i + 1) th compressed target picture to obtain the target synthetic picture, wherein i is an integer larger than 0 and smaller than n;
and the first writing unit is used for writing the target synthetic picture into the picture playing memory.
Optionally, the picture synthesizing manner is the vertical synthesizing, and the second determining module 807 includes:
a third determining unit, configured to determine a merging width according to a display width of the player in the vertical screen display state, where the merging width is smaller than the display width;
a second compression unit, configured to compress the width of the target picture to the merging width and compress the height of the target picture in equal proportion, in response to that the width of the target picture is greater than the merging width;
a fourth determining unit, configured to determine the merging size according to the merging width and a merging height, where the merging height is a sum of heights of the n target pictures after compression processing;
the writing module 803 includes:
the second splicing unit is used for splicing the upper edge of the (i + 1) th compressed target picture with the lower edge of the (i + 1) th compressed target picture to obtain the target synthetic picture, wherein i is an integer larger than 0 and smaller than n;
and the second writing unit is used for writing the target synthetic picture into the picture playing memory.
Optionally, the player adopts a first playing mode, where the first playing mode refers to playing n target pictures at a constant speed in a sliding manner;
the first playing module 804 includes:
a fifth determining unit, configured to determine a window size of the sliding window according to the merge size, where the window size includes a window width and a window height, and the merge size includes a merge width and a merge height, where, when the current display state is the landscape display state, the window height is equal to the merge height, and the window width is a preset window width; when the current display state is the vertical screen display state, the window width is equal to the combined width, and the window height is a preset window height;
a first sliding unit, configured to slide the sliding window on the target synthesized picture according to a sliding speed, where when the current display state is the landscape screen display state, the sliding speed is determined according to the merging width and a picture playing duration; when the current display state is the vertical screen display state, the sliding speed is determined according to the merging height and the picture playing time length;
and the first display unit is used for displaying the image in the sliding window in the display area according to the combined size and the size of the display area of the player.
Optionally, the player adopts a second playing mode, where the second playing mode is to update the target picture every predetermined time;
the first playing module 804 includes:
a sixth determining unit, configured to determine a window size of a sliding window according to the merge size, where the window size includes a window width and a window height, and the merge size includes a merge width and a merge height, where, when the current display state is the landscape screen display state, the window width is equal to a width of a next target picture after compression and merging and the window height is equal to the merge height, and when the current display state is the portrait screen display state, the window width is equal to the merge width and the window height is equal to a height of the next target picture after compression and merging;
a second sliding unit, configured to slide the sliding window on the target synthesized picture according to a target sliding distance every other predetermined time period, where when the current display state is the landscape screen display state, the target sliding distance is equal to a width of the compressed and merged current target picture; when the current display state is the vertical screen display state, the target sliding distance is equal to the height of the compressed and combined current target picture;
and the second display unit is used for displaying the image in the sliding window in the display area according to the size of the compressed and combined target picture and the size of the display area of the player.
Optionally, the apparatus further comprises:
a second receiving module 808, configured to receive a seek instruction, where the seek instruction is used to instruct to start playing the target picture from a target time;
a third determining module 809, configured to determine, according to the picture playing time and the target time, an initial coordinate, where the initial coordinate is used to indicate an initial sliding position of a sliding window on the target synthesized picture;
a second playing module 810, configured to play the target picture from the start coordinate.
Referring to fig. 9, a block diagram of a terminal 900 according to an exemplary embodiment of the present application is shown. The terminal 900 may be an electronic device in which an application is installed and run, such as a smart phone, a tablet computer, an electronic book, a portable personal computer, and the like. Terminal 900 in the present application may include one or more of the following components: a processor 920, a memory 910, and a screen 930.
Processor 920 may include one or more Processing cores, processor 920 may connect various portions throughout terminal 900 using various interfaces and lines, perform various functions of terminal 900 and process data by running or executing instructions, programs, code sets, or instruction sets stored in memory 910, and calling data stored in memory 910. alternatively, processor 920 may be implemented in at least one hardware form of Digital Signal Processing (DSP), Field-Programmable Gate Array (FPGA), Programmable logic Array (Programmable L organic Array, P L a), processor 920 may be implemented in one or more of a Central Processing Unit (CPU), Graphics Processing Unit (GPU), and modem, etc., where CPU is primarily responsible for operating systems, user interfaces and applications, etc., GPU is responsible for rendering desired content and rendering desired content for display, and modem is implemented for communication, either by a separate communication chip or by a separate communication chip 920.
The Memory 910 may include a Random Access Memory (RAM) or a Read-Only Memory (ROM). Optionally, the memory 910 includes a non-transitory computer-readable medium. The memory 910 may be used to store instructions, programs, code sets, or instruction sets. The memory 910 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for implementing at least one function (such as a touch function, a sound playing function, an image playing function, and the like), instructions for implementing the above method embodiments, and the like, and the operating system may be an Android (Android) system (including a system based on Android system depth development), an IOS system developed by apple inc (including a system based on IOS system depth development), or other systems. The stored data area may also store data created by terminal 900 during use (e.g., phone book, audio-visual data, chat log data), etc.
The screen 930 may be a capacitive touch display screen for receiving a touch operation of a user on or near the screen using a finger, a stylus, or any other suitable object, and displaying a user interface of each application. The touch display screen is generally provided at a front panel of the terminal 900. The touch display screen may be designed as a full-face screen, a curved screen, or a profiled screen. The touch display screen can also be designed to be a combination of a full-face screen and a curved-face screen, and a combination of a special-shaped screen and a curved-face screen, which is not limited in the embodiment of the present application.
In addition, those skilled in the art will appreciate that the configuration of terminal 900 illustrated in the above-identified figures is not meant to be limiting with respect to terminal 900, and that terminal may include more or less components than those illustrated, or some components may be combined, or a different arrangement of components. For example, the terminal 900 further includes a radio frequency circuit, a camera module, a sensor, an audio circuit, a Wi-Fi module, a power supply, a bluetooth module, and other components, which are not described herein again.
The embodiment of the present application further provides a computer-readable storage medium, where at least one instruction is stored, and the at least one instruction is loaded and executed by the processor to implement the picture playing method according to the above embodiments.
The embodiment of the present application further provides a computer program product, where at least one instruction is stored, and the at least one instruction is loaded and executed by the processor to implement the picture playing method according to the above embodiments.
Those skilled in the art will recognize that, in one or more of the examples described above, the functions described in the embodiments of the present application may be implemented in hardware, software, firmware, or any combination thereof. When implemented in software, the functions may be stored on or transmitted over as one or more instructions or code on a computer-readable storage medium. Computer-readable storage media includes both computer storage media and communication media including any medium that facilitates transfer of a computer program from one place to another. A storage media may be any available media that can be accessed by a general purpose or special purpose computer.
The above description is only exemplary of the present application and should not be taken as limiting, as any modification, equivalent replacement, or improvement made within the spirit and principle of the present application should be included in the protection scope of the present application.

Claims (13)

1. A method for playing pictures, the method comprising:
receiving a picture playing instruction, wherein the picture playing instruction is used for instructing to play n target pictures, and n is an integer greater than or equal to 1;
requesting a picture playing memory according to the merging size of the n target pictures, wherein the merging size is the size of a target synthesized picture obtained by merging the n target pictures, and the picture playing memory is used for caching the target synthesized picture;
writing the target synthetic picture obtained by compressing and combining n target pictures into the picture playing memory;
and loading the target synthetic picture through a player, and playing n target pictures.
2. The method of claim 1, wherein before requesting the picture play memory according to the merge size of the n target pictures, the method further comprises:
acquiring the current display state of the player, wherein the current display state comprises a horizontal screen display state and a vertical screen display state;
determining a picture synthesis mode according to the current display state, wherein the picture synthesis mode comprises horizontal synthesis and vertical synthesis;
and determining the merging size according to the picture synthesis mode and the size of the n target pictures.
3. The method according to claim 2, wherein the picture synthesis mode is the horizontal synthesis, and the determining the merging size according to the picture synthesis mode and the size of the n target pictures comprises:
determining a combined height according to the display height of the player in the horizontal screen display state, wherein the combined height is smaller than the display height;
in response to the fact that the height of the target picture is larger than the merging height, compressing the height of the target picture to the merging height, and compressing the width of the target picture in an equal proportion;
determining the merging size according to the merging height and the merging width, wherein the merging width is the sum of the widths of the n target pictures after compression processing;
the writing the target synthesized picture obtained by compressing and combining n target pictures into the picture play memory includes:
splicing the left edge of the (i + 1) th compressed target picture with the right edge of the (i + 1) th compressed target picture to obtain a target synthetic picture, wherein i is an integer larger than 0 and smaller than n;
and writing the target synthetic picture into the picture playing memory.
4. The method according to claim 2, wherein the picture synthesis manner is the vertical synthesis, and the determining the merging size according to the picture synthesis manner and the size of the n target pictures comprises:
determining a merging width according to the display width of the player in the vertical screen display state, wherein the merging width is smaller than the display width;
in response to the width of the target picture being larger than the merging width, compressing the width of the target picture to the merging width, and compressing the height of the target picture in equal proportion;
determining the merging size according to the merging width and the merging height, wherein the merging height is the sum of the heights of the n target pictures after compression processing;
the writing the target synthesized picture obtained by compressing and combining n target pictures into the picture play memory includes:
splicing the upper edge of the (i + 1) th compressed target picture with the lower edge of the (i) th compressed target picture to obtain a target synthetic picture, wherein i is an integer larger than 0 and smaller than n;
and writing the target synthetic picture into the picture playing memory.
5. The method according to any one of claims 2 to 4, wherein the player adopts a first playing mode, and the first playing mode refers to playing n target pictures at a constant speed in a sliding manner;
the playing n target pictures includes:
determining a window size of a sliding window according to the combined size, wherein the window size comprises a window width and a window height, and the combined size comprises a combined width and a combined height, wherein when the current display state is the landscape screen display state, the window height is equal to the combined height, and the window width is a preset window width; when the current display state is the vertical screen display state, the window width is equal to the combined width, and the window height is a preset window height;
sliding the sliding window on the target composite picture according to a sliding speed, wherein when the current display state is the landscape screen display state, the sliding speed is determined according to the merging width and the picture playing time length; when the current display state is the vertical screen display state, the sliding speed is determined according to the merging height and the picture playing time length;
and displaying the image in the sliding window in the display area according to the combined size and the size of the display area of the player.
6. The method according to any one of claims 2 to 4, wherein the player adopts a second playing mode, and the second playing mode is to update the target picture every predetermined time;
the playing n target pictures includes:
determining a window size of a sliding window according to the merging size, wherein the window size comprises a window width and a window height, the merging size comprises a merging width and a merging height, when the current display state is the landscape screen display state, the window width is equal to the width of a next target picture after compression and merging, and the window height is equal to the merging height, and when the current display state is the portrait screen display state, the window width is equal to the merging width and the window height is equal to the height of the next target picture after compression and merging;
sliding the sliding window on the target synthesized picture at intervals of the preset time according to a target sliding distance, wherein when the current display state is the horizontal screen display state, the target sliding distance is equal to the width of the compressed and combined current target picture; when the current display state is the vertical screen display state, the target sliding distance is equal to the height of the compressed and combined current target picture;
and displaying the image in the sliding window in a display area according to the size of the compressed and combined target picture and the size of the display area of the player.
7. The method according to any one of claims 1 to 4, wherein after playing n target pictures, the method further comprises:
receiving a seek instruction, wherein the seek instruction is used for indicating that the target picture is played from a target moment;
determining an initial coordinate according to the picture playing time and the target time, wherein the initial coordinate is used for indicating an initial sliding position of a sliding window on the target synthetic picture;
and starting from the starting coordinate, playing the target picture.
8. A picture playback apparatus, characterized in that the apparatus comprises:
the device comprises a first receiving module, a second receiving module and a display module, wherein the first receiving module is used for receiving a picture playing instruction, the picture playing instruction is used for indicating that n target pictures are played, and n is an integer which is greater than or equal to 1;
the request module is used for requesting a picture playing memory according to the merging size of the n target pictures, wherein the merging size is the size of a target synthetic picture obtained by merging the n target pictures, and the picture playing memory is used for caching the target synthetic picture;
a write-in module, configured to write the target composite picture obtained by compressing and merging n target pictures into the picture play memory;
and the first playing module is used for loading the target synthetic picture through a player and playing n target pictures.
9. The apparatus of claim 8, further comprising:
the acquisition module is used for acquiring the current display state of the player, wherein the current display state comprises a horizontal screen display state and a vertical screen display state;
the first determining module is used for determining a picture synthesizing mode according to the current display state, wherein the picture synthesizing mode comprises horizontal synthesis and vertical synthesis;
and the second determining module is used for determining the merging size according to the picture synthesis mode and the size of the n target pictures.
10. The apparatus of claim 9, wherein the picture composition mode is the horizontal composition, and the second determining module comprises:
a first determining unit, configured to determine a merging height according to a display height of the player in the landscape display state, where the merging height is smaller than the display height;
the first compression unit is used for responding to the situation that the height of the target picture is larger than the merging height, compressing the height of the target picture to the merging height, and compressing the width of the target picture in an equal proportion;
a second determining unit, configured to determine the merging size according to the merging height and a merging width, where the merging width is a sum of widths of the n target pictures after compression processing;
the write module includes:
the first splicing unit is used for splicing the left edge of the (i + 1) th compressed target picture and the right edge of the (i + 1) th compressed target picture to obtain the target synthetic picture, wherein i is an integer larger than 0 and smaller than n;
and the first writing unit is used for writing the target synthetic picture into the picture playing memory.
11. The apparatus of claim 9, wherein the picture composition manner is the vertical composition, and the second determining module comprises:
a third determining unit, configured to determine a merging width according to a display width of the player in the vertical screen display state, where the merging width is smaller than the display width;
a second compression unit, configured to compress the width of the target picture to the merging width and compress the height of the target picture in equal proportion, in response to that the width of the target picture is greater than the merging width;
a fourth determining unit, configured to determine the merging size according to the merging width and a merging height, where the merging height is a sum of heights of the n target pictures after compression processing;
the write module includes:
the second splicing unit is used for splicing the upper edge of the (i + 1) th compressed target picture with the lower edge of the (i + 1) th compressed target picture to obtain the target synthetic picture, wherein i is an integer larger than 0 and smaller than n;
and the second writing unit is used for writing the target synthetic picture into the picture playing memory.
12. A terminal, characterized in that the terminal comprises a processor and a memory; the memory stores at least one instruction for execution by the processor to implement the picture playing method according to any one of claims 1 to 7.
13. A computer-readable storage medium storing at least one instruction for execution by a processor to implement the picture playing method according to any one of claims 1 to 7.
CN202010305087.9A 2020-04-17 2020-04-17 Picture playing method, device, terminal and storage medium Active CN111475665B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010305087.9A CN111475665B (en) 2020-04-17 2020-04-17 Picture playing method, device, terminal and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010305087.9A CN111475665B (en) 2020-04-17 2020-04-17 Picture playing method, device, terminal and storage medium

Publications (2)

Publication Number Publication Date
CN111475665A true CN111475665A (en) 2020-07-31
CN111475665B CN111475665B (en) 2024-05-10

Family

ID=71755389

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010305087.9A Active CN111475665B (en) 2020-04-17 2020-04-17 Picture playing method, device, terminal and storage medium

Country Status (1)

Country Link
CN (1) CN111475665B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113422912A (en) * 2021-05-25 2021-09-21 深圳市大头兄弟科技有限公司 Short video interaction generation method, device, equipment and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20090120723A (en) * 2008-05-20 2009-11-25 엘지전자 주식회사 Mobile terminal and method of generating contents therein
CN102520864A (en) * 2011-12-16 2012-06-27 北京新媒传信科技有限公司 Method for continuously playing images and device
CN102568358A (en) * 2010-12-15 2012-07-11 西安天动数字科技有限公司 Live-action and unreal-image combined imaging multi-media demonstrating system
CN104991733A (en) * 2015-06-30 2015-10-21 广东欧珀移动通信有限公司 Picture processing method and mobile terminal
CN113595885A (en) * 2021-07-28 2021-11-02 高途教育科技集团有限公司 Picture sending method and device, electronic equipment and storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20090120723A (en) * 2008-05-20 2009-11-25 엘지전자 주식회사 Mobile terminal and method of generating contents therein
CN102568358A (en) * 2010-12-15 2012-07-11 西安天动数字科技有限公司 Live-action and unreal-image combined imaging multi-media demonstrating system
CN102520864A (en) * 2011-12-16 2012-06-27 北京新媒传信科技有限公司 Method for continuously playing images and device
CN104991733A (en) * 2015-06-30 2015-10-21 广东欧珀移动通信有限公司 Picture processing method and mobile terminal
CN113595885A (en) * 2021-07-28 2021-11-02 高途教育科技集团有限公司 Picture sending method and device, electronic equipment and storage medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113422912A (en) * 2021-05-25 2021-09-21 深圳市大头兄弟科技有限公司 Short video interaction generation method, device, equipment and storage medium

Also Published As

Publication number Publication date
CN111475665B (en) 2024-05-10

Similar Documents

Publication Publication Date Title
US20200147491A1 (en) Method for rendering game, and method, apparatus and device for generating game resource file
US20220139353A1 (en) Display method, electronic device, and non-transitory computer-readable storage medium
CN109977333B (en) Webpage display method and device, computer equipment and storage medium
WO2020207251A1 (en) Image update method and apparatus, and terminal and storage medium
WO2020207250A1 (en) Vertical synchronization method and apparatus, terminal, and storage medium
JP5628300B2 (en) Method, apparatus and computer program product for generating graphic objects with desirable physical features for use in animation
CN109525885B (en) Information processing method, information processing device, electronic equipment and computer readable storage medium
WO2021008424A1 (en) Method and device for image synthesis, electronic apparatus and storage medium
US20210398249A1 (en) Image distribution device, image distribution system, image distribution method, and image distribution program
WO2019218384A1 (en) Display processing method and device, storage medium and electronic terminal
US20220139017A1 (en) Layer composition method, electronic device, and storage medium
CN103946789A (en) Rendering mode selection in graphics processing units
CN111491208B (en) Video processing method and device, electronic equipment and computer readable medium
US20190012987A1 (en) Method and system for playing multimedia data
JP5616223B2 (en) System and method for capturing digital images
CN114051145B (en) Video compression processing method, device and medium
WO2017202175A1 (en) Method and device for video compression and electronic device
CN110377220B (en) Instruction response method and device, storage medium and electronic equipment
CN114071047A (en) Frame rate control method and related device
US10204598B2 (en) Predictive pre-decoding of encoded media item
KR102619668B1 (en) Apparatus and method of using a slice update map
TW201915710A (en) Display device and image display method thereof based on Android platform
CN111475665B (en) Picture playing method, device, terminal and storage medium
EP4358501A1 (en) Wallpaper display method, electronic device and storage medium
US20060187239A1 (en) System and method for improving visual appearance of efficient rotation algorithm

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
GR01 Patent grant
GR01 Patent grant