CN111061414A - Skin replacement method and device, electronic equipment and readable storage medium - Google Patents

Skin replacement method and device, electronic equipment and readable storage medium Download PDF

Info

Publication number
CN111061414A
CN111061414A CN201911195317.4A CN201911195317A CN111061414A CN 111061414 A CN111061414 A CN 111061414A CN 201911195317 A CN201911195317 A CN 201911195317A CN 111061414 A CN111061414 A CN 111061414A
Authority
CN
China
Prior art keywords
picture
replaced
rendering
skin
information
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
Application number
CN201911195317.4A
Other languages
Chinese (zh)
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.)
Beijing QIYI Century Science and Technology Co Ltd
Original Assignee
Beijing QIYI Century Science and 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 Beijing QIYI Century Science and Technology Co Ltd filed Critical Beijing QIYI Century Science and Technology Co Ltd
Priority to CN201911195317.4A priority Critical patent/CN111061414A/en
Publication of CN111061414A publication Critical patent/CN111061414A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0484Interaction techniques based on graphical user interfaces [GUI] for the control of specific functions or operations, e.g. selecting or manipulating an object, an image or a displayed text element, setting a parameter value or selecting a range
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0484Interaction techniques based on graphical user interfaces [GUI] for the control of specific functions or operations, e.g. selecting or manipulating an object, an image or a displayed text element, setting a parameter value or selecting a range
    • G06F3/04845Interaction techniques based on graphical user interfaces [GUI] for the control of specific functions or operations, e.g. selecting or manipulating an object, an image or a displayed text element, setting a parameter value or selecting a range for image manipulation, e.g. dragging, rotation, expansion or change of colour

Landscapes

  • Engineering & Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Processing Or Creating Images (AREA)

Abstract

The invention provides a skin replacement method and device, electronic equipment and a readable storage medium, and belongs to the technical field of computers. If a skin replacement instruction for a target application program is detected, determining the skin indicated by the skin replacement instruction as the skin to be replaced, then, for each page in the target application program, determining rendering information defined for a picture to be replaced in each page in the target application program in advance based on the skin identifier of the skin to be replaced, rendering each picture to be replaced based on the rendering information, and finally, displaying each rendered picture to be replaced, thereby completing skin replacement. In the embodiment of the invention, the skin replacement can be realized only by re-rendering on the basis of the original picture in the page, so that the corresponding pictures do not need to be stored in advance for different skins, the occupation of memory space can be further reduced, and the performance of equipment is improved.

Description

Skin replacement method and device, electronic equipment and readable storage medium
Technical Field
The invention belongs to the technical field of computers, and particularly relates to a skin replacement method and device, electronic equipment and a readable storage medium.
Background
In order to meet the preferences of different users, the application program often provides a plurality of skins corresponding to different themes for the user to select, and accordingly, the user can select a favorite skin to replace according to the preferences of the user. The style of the control of each page in the application program can be different when different skins are used, and the style of the control is generally determined by the shape of the control and the picture arranged on the control. Accordingly, when the skin of the application program is replaced, the pictures on the controls in the pages of the application program are often changed. For example, assume that the page of the application includes 3 buttons: button a, button B and button C, each button can be provided with a picture, and the style of these 3 buttons is determined by the picture provided on the button.
In the related art, when a picture on the control is changed, a picture matched with the skin to be changed is often directly obtained from pictures corresponding to preset skins, and the original picture in the page is changed by using the obtained picture. For example, the original picture on the button a in the page is replaced by using the picture corresponding to the button a in the picture matched with the skin to be replaced, the original picture on the button B in the page is replaced by using the picture corresponding to the button B in the picture matched with the skin to be replaced, and the original picture on the button a in the page is replaced by using the picture corresponding to the button C in the picture matched with the skin to be replaced, thereby realizing the skin replacement. Because when changing skin, need use this to wait to change the supporting picture of skin to replace original picture in the page, consequently, along with the increase of new skin, just need all increase supporting picture to every kind of new skin, and then can lead to the quantity of picture to constantly increase, occupy great memory space, and then reduce the performance of equipment.
Disclosure of Invention
The invention provides a skin replacement method, a skin replacement device, an electronic device and a readable storage medium, and aims to solve the problem that the performance of the device is reduced due to the fact that the memory space of the device occupies a large amount.
In a first aspect of the embodiments of the present invention, there is provided a skin replacement method, applied to a terminal, the method including:
if a skin replacement instruction for a target application program is detected, determining the skin indicated by the skin replacement instruction as the skin to be replaced;
for each page in the target application program, based on the skin identifier of the skin to be replaced, determining rendering information which is defined for the picture to be replaced in each page in the target application program in advance;
rendering each picture to be replaced based on the rendering information;
and displaying each rendered picture to be replaced.
In a second aspect of the present invention, there is also provided a skin replacement device applied to a terminal, the device including:
the device comprises a first determination module, a second determination module and a third determination module, wherein the first determination module is used for determining the skin indicated by a skin replacement instruction as the skin to be replaced if the skin replacement instruction for a target application program is detected;
a second determining module, configured to determine, for each page in the target application program, rendering information predefined for a picture to be replaced in each page in the target application program based on the skin identifier of the skin to be replaced;
the rendering module is used for rendering each picture to be replaced based on the rendering information;
and the display module is used for displaying each rendered picture to be replaced.
In yet another aspect of the present invention, there is also provided a computer-readable storage medium having stored therein instructions which, when run on a computer, cause the computer to perform any of the skin-replacement methods described above.
In yet another aspect of the present invention, there is also provided a computer program product containing instructions which, when run on a computer, cause the computer to perform any of the skin replacement methods described above.
According to the skin replacing method provided by the embodiment of the invention, if a skin replacing instruction for a target application program is detected, the skin indicated by the skin replacing instruction is determined as the skin to be replaced, then, for each page in the target application program, rendering information which is defined for the picture to be replaced in each page in the target application program in advance is determined based on the skin identification of the skin to be replaced, each picture to be replaced is rendered based on the rendering information, and finally, each rendered picture to be replaced is displayed, so that the skin replacing is completed. In the embodiment of the invention, the skin replacement can be realized only by re-rendering on the basis of the original picture in the page, so that corresponding pictures do not need to be preset for different skins, the occupation of memory space can be reduced, and the performance of equipment can be improved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below.
Fig. 1 is a flowchart illustrating steps of a skin replacement method according to an embodiment of the present invention;
FIG. 2-1 is a flow chart illustrating steps of another skin replacement method provided by an embodiment of the present invention;
FIG. 2-2 is a system architecture diagram provided by an embodiment of the present invention;
fig. 3 is a block diagram of a skin replacement device according to an embodiment of the present invention;
FIG. 4 is a block diagram of another skin replacement device provided by an embodiment of the present invention;
fig. 5 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
Exemplary embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the invention are shown in the drawings, it should be understood that the invention can be embodied in various forms. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the invention to those skilled in the art.
Fig. 1 is a flowchart of steps of a skin replacement method according to an embodiment of the present invention, which is applied to a terminal, and as shown in fig. 1, the method may include:
step 101, if a skin replacement operation for a target application program is detected, determining a skin indicated by the skin replacement operation as a skin to be replaced.
In the embodiment of the present invention, the target application may be an application used by a user, and the target application may be installed in the terminal. For example, the target application may be a video playing application used by a user, or may also be a shopping application, which is not limited in this embodiment of the present invention. Further, the skin-replacement operation may be a user selection operation of an optional skin provided by the target application. For example, a skin-replacement button may be displayed on a certain page of the target application, and the terminal may display a plurality of selectable skins in the page after detecting that the user clicks the skin-replacement button. Accordingly, the user can select one selectable skin, and accordingly, when the terminal detects the selection operation of the user on the selectable skin, the terminal can consider that the skin replacement operation aiming at the target application program is detected.
Further, the skin indicated by the skin replacement operation may be an optional skin selected by the user, and accordingly, the terminal may determine the optional skin selected by the user as the skin to be replaced. For example, assuming that an optional skin a, an optional skin b and an optional skin c are displayed on the page, and the user selects the optional skin b, the terminal may determine the optional skin b as the skin to be replaced.
And 102, for each page in the target application program, determining rendering information which is defined for the picture to be replaced in each page in the target application program in advance based on the skin identifier of the skin to be replaced.
In the embodiment of the invention, the skin identifier of the skin to be replaced is an identifier for uniquely indicating the skin to be replaced, and each optional skin provided by the target application program corresponds to one skin identifier. For each page included in the target application program, the picture to be replaced refers to a picture that needs to be replaced in the page when the skin of the target application program is to be switched to the skin to be replaced, and the picture to be replaced is often a picture on a control in the page.
Further, the rendering information may indicate which pictures in the page need to be changed to what style if the skin of the target application is switched to the skin to be changed. Due to different selectable skins, the corresponding overall styles are different, and accordingly, the requirements for changing the pictures on each control in each page are different. Therefore, when setting selectable skins for a target application, corresponding rendering information is often set for each selectable skin. Therefore, in this step, the identifier of the optional skin selected by the user may be read from the data corresponding to the target application program, so as to obtain the skin identifier of the skin to be replaced. Then, based on the skin identifier of the skin to be replaced, rendering information defined in advance for the picture to be replaced in each page in the target application program for the skin to be replaced can be determined, so that in the subsequent step, the style of each picture to be replaced can be changed to the style which is adapted to the skin to be replaced based on the rendering information.
And 103, rendering each picture to be replaced based on the rendering information.
In the embodiment of the present invention, since the rendering information may indicate which pictures need to be changed into what pattern when the skin of the target application program is switched to the skin to be changed, the terminal may render each picture to be changed based on the rendering information, so as to change the pattern of the picture to be changed. Therefore, the picture to be replaced does not need to be replaced by other pictures, the pattern of the picture to be replaced is replaced in a rendering mode, the effect of replacing the picture to be replaced can be achieved, the operation of setting the corresponding picture for each skin in advance can be omitted, and the memory of the terminal can be saved.
And 104, displaying each rendered picture to be replaced.
In the embodiment of the invention, because the style of each rendered picture to be replaced is changed into the style which is matched with the skin to be replaced, each rendered picture to be replaced can be displayed, and thus, the skin of the target application program can be replaced by displaying the changed picture to be replaced. For example, assume that the page of the application includes 3 buttons: each button is provided with a picture, and the pictures arranged on the 3 buttons are the pictures to be replaced. Under the condition that a skin replacement instruction is detected, the terminal can determine rendering information defined for the 3 pictures in advance based on the skin identifier of the skin to be replaced, then render the 3 pictures based on the rendering information, and finally display the rendered pictures, so that the skin replacement can be realized. Therefore, the 3 pictures are not required to be replaced by the pictures matched with the skin to be replaced, so that the skin replacement can be completed, and the matched pictures are not required to be added for the skin, so that the number of the pictures can be reduced to a certain extent.
In summary, in the skin replacing method provided in the embodiment of the present invention, if a skin replacing instruction for a target application is detected, a skin indicated by the skin replacing instruction is determined as a skin to be replaced, then, for each page in the target application, rendering information predefined for a picture to be replaced in each page in the target application is determined based on a skin identifier of the skin to be replaced, each picture to be replaced is rendered based on the rendering information, and finally, each rendered picture to be replaced is displayed, thereby completing skin replacement. In the embodiment of the invention, the skin replacement can be realized only by re-rendering on the basis of the original picture in the page, so that corresponding pictures do not need to be preset for different skins, the occupation of memory space can be reduced, and the performance of equipment can be improved.
Fig. 2-1 is a flow chart illustrating steps of another skin replacement method according to an embodiment of the present invention, which, as shown in fig. 2-1, may include:
step 201, if a skin replacement instruction for a target application program is detected, determining the skin indicated by the skin replacement instruction as the skin to be replaced.
Specifically, the step 101 may be referred to in an implementation manner of this step, which is not limited in this embodiment of the present invention.
Step 202, for each page in the target application program, based on the skin identifier of the skin to be replaced, determining rendering information predefined for the picture to be replaced in each page in the target application program.
In this step, rendering information defined by each picture to be replaced is determined based on the skin identifier of the skin to be replaced and the corresponding relationship between the preset skin identifier and the rendering information.
The corresponding relationship may be preset, and the corresponding relationship may include a skin identifier of each selectable skin provided by the target application program and rendering information corresponding to the skin identifier. The rendering information at least comprises picture identification, rendering area information and rendering color information of the pictures to be replaced in each page. The rendering area information is used for indicating an area needing to be rendered in the picture needing to be replaced, and the rendering color information is used for indicating the color of the area needing to be rendered.
Specifically, the skin identifier of the skin to be replaced is compared with each skin identifier in the corresponding relationship one by one, and then rendering information corresponding to the skin identifier matched with the skin identifier of the skin to be replaced is obtained, so that rendering information defined for the picture to be replaced in each page in the target application program in advance is obtained. The rendering information at least comprises a picture identifier, rendering area information and rendering color information of each picture to be replaced. Because the data volume occupied by the picture identification is small, the picture needing to be replaced is represented by the picture identification, and the memory space occupied by the rendering information set for different optional skins can be reduced as much as possible.
And step 203, rendering each picture to be replaced based on the rendering information.
Specifically, the step may include the following steps 2031 to 2032:
step 2031, for each picture to be replaced, acquiring the picture to be replaced based on the picture identifier of the picture to be replaced.
In this step, the picture identifier may be an identifier capable of uniquely indicating a picture to be replaced, and the picture identifier may be a picture number of the picture to be replaced, or a picture name of the picture to be replaced, or of course, may be other information, which is not limited in this embodiment of the present invention. Correspondingly, when the picture to be replaced is rendered, the picture to be replaced can be obtained firstly based on the picture identification of the picture to be replaced, so that the picture to be replaced can be rendered in the subsequent steps.
Specifically, the operation of acquiring the picture to be replaced can be realized through the following substeps (2) to (4):
substep (2): and searching a picture corresponding to the picture identifier in the terminal based on the picture identifier.
In this step, if the terminal displays the picture corresponding to the picture identifier in advance, the picture corresponding to the picture identifier is retained in the cache inside the terminal. Therefore, when the picture to be replaced is obtained, the picture corresponding to the picture identifier can be searched in the terminal. Specifically, the picture identifier may be compared with the picture identifier of each picture in the cache one by one, and then the picture represented by the matched picture identifier is used as the picture corresponding to the picture identifier.
Substep (3): and if the picture corresponding to the picture identifier is found, reading the picture corresponding to the picture identifier to obtain the picture to be replaced.
In this step, if there is a matching picture identifier, the picture represented by the matching picture identifier may be used as the picture corresponding to the picture identifier. Accordingly, it can be considered that the picture corresponding to the picture identifier is found, the picture to be replaced exists in the cache, and at this time, the picture to be replaced can be directly loaded from the cache, so that the picture to be replaced is obtained.
Substep (4): and if the picture corresponding to the picture identifier is not found, downloading the picture to be replaced from the network based on the picture identifier.
In this step, if there is no matched picture identifier, it may be considered that the picture corresponding to the picture identifier is not found, and the picture to be replaced does not exist in the cache. Accordingly, to ensure proper operation of the scheme, the picture to be replaced may be downloaded from the network based on the picture identification. Specifically, if the picture identifier is a Uniform Resource Locator (url) of the picture to be replaced, the picture to be replaced may be obtained from the network through the url directly based on the network connection. If the picture identifier is not the ur of the picture to be replaced), the url corresponding to the picture identifier can be searched from the preset corresponding relation between the picture identifier and the url, so that the url of the picture to be replaced is obtained, and then the picture to be replaced can be obtained from the network through the url based on network connection.
In the embodiment of the invention, the picture to be replaced is searched in the cache of the terminal through the picture identification, and the picture to be replaced is obtained from the network under the condition that the picture to be replaced does not exist in the cache. Therefore, the operation of obtaining the picture from the network based on the network connection can be avoided as much as possible, so that the resources in the terminal can be utilized to the maximum extent, the resource utilization rate is improved, and the problem that the picture to be replaced cannot be obtained due to the fact that the network connection is wrong is solved.
Step 2032, rendering the area indicated by the rendering area information in the picture to be replaced to the color indicated by the rendering color information.
Specifically, the picture type of the picture to be replaced may be determined first.
The picture type may be predefined, and the picture type may be a dynamic picture or a static picture.
Further, if the picture type is a dynamic picture, each frame of sub-picture in the dynamic picture can be acquired; and after each frame of sub-picture is respectively taken as a picture to be replaced, performing the operation of rendering the region indicated by the rendering region information in the picture to be replaced into the color indicated by the rendering color information.
Because the dynamic picture is often composed of multiple sub-pictures, if the dynamic picture is directly rendered, part of the sub-pictures can not be fully rendered, and the rendering effect is poor. Therefore, in this step, when the picture to be replaced is a dynamic picture, each frame of sub-picture in the dynamic picture is acquired first, then each frame of sub-picture is taken as the picture to be replaced, and then the operation of rendering the region indicated by the rendering region information in the picture to be replaced into the color indicated by the rendering color information is performed, so as to ensure that each frame of sub-picture can be fully rendered, thereby ensuring the overall rendering effect of the picture to be replaced.
Further, if the picture type is a static picture, judging whether the picture format of the picture to be replaced is a preset picture format; if the picture format is the preset picture format, converting the picture format of the picture to be replaced into a basic picture format; after the conversion operation is completed, an operation of rendering the region indicated by the rendering region information in the picture to be replaced into the color indicated by the rendering color information is performed.
Specifically, because the performance of each terminal is different, and rendering operations of pictures in some formats often have higher requirements on the performance of the terminal, in this step, it may be further determined whether the picture format of the picture to be replaced is a preset picture format when the picture to be replaced is a static picture, where the preset picture format may be predefined, and the preset picture format may be a picture format having a higher requirement on the performance of the terminal when rendering, for example, the specific preset picture format may be obtained based on a pre-test.
If the picture format of the picture to be replaced is the preset picture format, format conversion may be performed on the picture to be replaced, specifically, the picture format of the picture to be replaced may be converted into a basic picture format, where the basic picture format may be a picture format with a low requirement on the performance of the terminal during rendering, and for example, the basic picture format may be a png format. Accordingly, after the format conversion is completed, the operation of rendering the region indicated by the rendering region information in the picture to be replaced into the color indicated by the rendering color information is performed. And then the terminal can be ensured to normally finish the rendering operation of the picture to be replaced.
Further, if the picture format is not the preset picture format, it may be considered that the terminal can normally complete the rendering operation on the picture to be replaced, and accordingly, the operation of rendering the region indicated by the rendering region information in the picture to be replaced into the color indicated by the rendering color information may be directly performed.
Specifically, when performing an operation of rendering a region indicated by rendering region information in the picture to be replaced to a color indicated by rendering color information, the region indicated by the rendering region information may be determined based on the rendering region information, where the rendering region information may be coordinates of the region, and accordingly, the indicated region may be located by the coordinates. Then, the determined region may be rendered as a color indicated by the rendering color information. For example, assuming that the region indicated by the rendering region information is a rectangular region of 3 × 3 at the upper left corner of the picture to be replaced, and the color indicated by the rendering color information is red, the rectangular region of 3 × 3 may be rendered in red. The rendering area information included in the rendering information defined for the picture to be replaced may be one or multiple. When the rendering region information is multiple, the shape of the rendering region corresponding to each rendering region information may be set based on actual style requirements, and the shapes of the rendering regions corresponding to each rendering region information may be the same or different. Further, the color indicated by the rendering color information corresponding to each rendering region information may be set based on actual style requirements, and the color indicated by the rendering color information corresponding to each rendering region information may be the same or different. Therefore, when the picture to be replaced is rendered based on the rendering information, different rendering areas in the picture to be replaced are rendered by using the rendering colors corresponding to the rendering areas, the picture with patterns can be obtained, and the effect of skin replacement can be improved.
And 204, combining the rendered picture to be replaced with the control corresponding to the picture to be replaced for each picture to be replaced.
In this step, the control corresponding to the picture to be replaced may be a native control for bearing the picture to be replaced. Specifically, the picture to be replaced can be arranged on the native control, and then the picture to be replaced and the native control are combined.
And step 205, displaying the control after the combination in the page indicated by the page ID.
In this step, the page indicated by the page ID refers to the page to which the picture to be replaced belongs, so that the picture to be replaced and the control corresponding to the picture to be replaced are combined, and the combined control is displayed on the page to which the picture to be replaced belongs, so that the target application program can be displayed at a proper position, and the display effect after replacement is ensured.
Further, fig. 2-2 is a system architecture diagram according to an embodiment of the present invention, as shown in fig. 2-2, wherein the "wrap" layer includes 4 controls in a page, the "manager" layer includes 3 download assistants for downloading a picture to be replaced from a network, the "handler" layer includes auxiliary classes for loading the picture to be replaced from inside the terminal, downloading the picture to be replaced, and destroying the picture to be replaced, and the "decoder" layer includes an encoding unit for performing picture format conversion on the picture to be replaced.
In summary, according to the skin replacing method provided in the embodiment of the present invention, if a skin replacing instruction for a target application is detected, a skin indicated by the skin replacing instruction is determined as a skin to be replaced, then, for each page in the target application, rendering information predefined for a picture to be replaced in each page in the target application is determined based on a skin identifier of the skin to be replaced, each picture to be replaced is rendered based on the rendering information, and finally, for each picture to be replaced, the rendered picture to be replaced and a control corresponding to the picture to be replaced are combined, and the combined control is displayed in the page indicated by the page ID, so that the target application is ensured to be displayed at a proper position, and convenience is brought to a user. Meanwhile, in the embodiment of the invention, the skin replacement can be realized only by re-rendering on the basis of the original picture in the page, so that corresponding pictures do not need to be preset for different skins, the occupation of memory space can be further reduced, and the performance of the original equipment for storing the matched pictures of the newly added skins is improved.
Further, compared with a mode of searching for a picture matched with the skin to be replaced from a large number of pictures, then determining the picture corresponding to the skin to be replaced, and finally replacing the picture based on the searched picture, the method and the device for replacing the skin can complete skin replacement directly based on the acquired rendering information, so that the operation process can be simplified to a certain extent, and time consumption is reduced.
Fig. 3 is a block diagram of a skin replacement device according to an embodiment of the present invention, and as shown in fig. 3, the device 30 may include:
the first determining module 301 is configured to determine, if a skin replacement instruction for a target application is detected, a skin indicated by the skin replacement instruction as a skin to be replaced.
A second determining module 302, configured to determine, for each page in the target application program, rendering information predefined for a picture to be replaced in each page in the target application program based on the skin identifier of the skin to be replaced.
And a rendering module 303, configured to render each to-be-replaced picture based on the rendering information.
A display module 304, configured to display each rendered picture to be replaced.
In summary, in the skin replacing apparatus provided in the embodiment of the present invention, if a skin replacing instruction for a target application is detected, the skin indicated by the skin replacing instruction is determined as a skin to be replaced, then, for each page in the target application, rendering information predefined for a picture to be replaced in each page in the target application is determined based on a skin identifier of the skin to be replaced, each picture to be replaced is rendered based on the rendering information, and finally, each rendered picture to be replaced is displayed, so as to complete skin replacement. In the embodiment of the invention, the skin replacement can be realized only by re-rendering on the basis of the original picture in the page, so that the corresponding pictures do not need to be stored in advance for different skins, the occupation of memory space can be further reduced, and the performance of equipment is improved.
Fig. 4 is a block diagram of another skin replacement device according to an embodiment of the present invention, and as shown in fig. 4, the device 40 may include:
the first determining module 401 is configured to determine, if a skin replacement instruction for a target application is detected, a skin indicated by the skin replacement instruction as a skin to be replaced.
A second determining module 402, configured to determine, for each page in the target application program, rendering information predefined for a picture to be replaced in each page in the target application program based on the skin identifier of the skin to be replaced.
A rendering module 403, configured to render each to-be-replaced picture based on the rendering information;
a display module 404, configured to display each rendered picture to be replaced.
Optionally, the rendering information at least includes a picture identifier, rendering area information, and rendering color information of each picture to be replaced.
Accordingly, the rendering module 403 is specifically configured to:
and for each picture to be replaced, acquiring the picture to be replaced based on the picture identification of the picture to be replaced.
Rendering the area indicated by the rendering area information in the picture to be replaced into the color indicated by the rendering color information.
Optionally, the rendering module 403 is further specifically configured to:
and searching a picture corresponding to the picture identifier in the terminal based on the picture identifier.
And if the picture corresponding to the picture identifier is found, reading the picture corresponding to the picture identifier to obtain the picture to be replaced.
And if the picture corresponding to the picture identifier is not found, downloading the picture to be replaced from the network based on the picture identifier.
Optionally, the rendering module 403 is further specifically configured to:
and judging the picture type of the picture to be replaced.
If the picture type is a dynamic picture, acquiring each frame of sub-picture in the dynamic picture;
and after each frame of sub-picture is respectively used as the picture to be replaced, rendering the region indicated by the rendering region information in the picture to be replaced into the color indicated by the rendering color information.
Optionally, the rendering module 403 is further specifically configured to:
and if the picture type is a static picture, judging whether the picture format of the picture to be replaced is a preset picture format.
If the picture format is a preset picture format, converting the picture format of the picture to be replaced into a basic picture format; after the conversion operation is completed, the operation of rendering the region indicated by the rendering region information in the picture to be replaced into the color indicated by the rendering color information is executed.
Or if the picture format is not the preset picture format, directly executing the operation of rendering the region indicated by the rendering region information in the picture to be replaced into the color indicated by the rendering color information.
Optionally, the rendering information further includes a page ID of a page to which the picture to be replaced belongs.
The display module 404 includes:
the combining submodule 4041 is configured to, for each picture to be replaced, combine the rendered picture to be replaced with the control corresponding to the picture to be replaced.
The display sub-module 4042 is configured to display the combined control in the page indicated by the page ID.
In summary, in the skin replacing apparatus provided in the embodiment of the present invention, if a skin replacing instruction for a target application is detected, a skin indicated by the skin replacing instruction is determined as a skin to be replaced, then, for each page in the target application, rendering information predefined for a picture to be replaced in each page in the target application is determined based on a skin identifier of the skin to be replaced, each picture to be replaced is rendered based on the rendering information, and finally, for each picture to be replaced, the rendered picture to be replaced and a control corresponding to the picture to be replaced are combined, and the combined control is displayed in the page indicated by the page ID, so that the target application is ensured to be displayed at a proper position, and convenience is brought to a user. Meanwhile, in the embodiment of the invention, the skin replacement can be realized only by re-rendering on the basis of the original picture in the page, so that the corresponding pictures do not need to be stored in advance for different skins, the occupation of memory space can be reduced, and the performance of the equipment can be improved.
For the above device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and for the relevant points, refer to the partial description of the method embodiment.
An embodiment of the present invention further provides an electronic device, as shown in fig. 5, which includes a processor 501, a communication interface 502, a memory 503 and a communication bus 504, where the processor 501, the communication interface 502 and the memory 503 complete mutual communication through the communication bus 504,
a memory 503 for storing a computer program;
the processor 501, when executing the program stored in the memory 503, implements the following steps:
if a skin replacement instruction for a target application program is detected, determining the skin indicated by the skin replacement instruction as the skin to be replaced;
for each page in the target application program, based on the skin identifier of the skin to be replaced, determining rendering information which is defined for the picture to be replaced in each page in the target application program in advance;
rendering each picture to be replaced based on the rendering information;
and displaying each rendered picture to be replaced.
The communication bus mentioned in the above terminal may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The communication bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown, but this does not mean that there is only one bus or one type of bus.
The communication interface is used for communication between the terminal and other equipment.
The Memory may include a Random Access Memory (RAM) or a non-volatile Memory (non-volatile Memory), such as at least one disk Memory. Optionally, the memory may also be at least one memory device located remotely from the processor.
The Processor may be a general-purpose Processor, and includes a Central Processing Unit (CPU), a Network Processor (NP), and the like; the device can also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other Programmable logic device, a discrete Gate or transistor logic device, or a discrete hardware component.
In yet another embodiment of the present invention, a computer-readable storage medium is further provided, which has instructions stored therein, which when run on a computer, cause the computer to perform the skin-replacement method of any one of the above embodiments.
In a further embodiment provided by the present invention, there is also provided a computer program product containing instructions which, when run on a computer, cause the computer to perform the skin replacement method of any of the above embodiments.
In the above embodiments, the implementation may be wholly or partially realized by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, cause the processes or functions described in accordance with the embodiments of the invention to occur, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another, for example, from one website site, computer, server, or data center to another website site, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, Digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device, such as a server, a data center, etc., that incorporates one or more of the available media. The usable medium may be a magnetic medium (e.g., floppy Disk, hard Disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., Solid State Disk (SSD)), among others.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
All the embodiments in the present specification are described in a related manner, and the same and similar parts among the embodiments may be referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the system embodiment, since it is substantially similar to the method embodiment, the description is simple, and for the relevant points, reference may be made to the partial description of the method embodiment.
The above description is only for the preferred embodiment of the present invention, and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention shall fall within the protection scope of the present invention.

Claims (12)

1. A skin replacement method, applied to a terminal, the method comprising:
if a skin replacement instruction for a target application program is detected, determining the skin indicated by the skin replacement instruction as the skin to be replaced;
for each page in the target application program, based on the skin identifier of the skin to be replaced, determining rendering information which is defined for the picture to be replaced in each page in the target application program in advance;
rendering each picture to be replaced based on the rendering information;
and displaying each rendered picture to be replaced.
2. The method according to claim 1, wherein the rendering information at least comprises a picture identifier, rendering area information and rendering color information of each picture to be replaced;
correspondingly, the rendering each picture to be replaced based on the rendering information includes:
for each picture to be replaced, acquiring the picture to be replaced based on the picture identification of the picture to be replaced;
rendering the area indicated by the rendering area information in the picture to be replaced into the color indicated by the rendering color information.
3. The method according to claim 2, wherein the rendering the region indicated by the rendering region information in the picture to be replaced to the color indicated by the rendering color information comprises:
judging the picture type of the picture to be replaced;
if the picture type is a dynamic picture, acquiring each frame of sub-picture in the dynamic picture;
and after each frame of sub-picture is respectively used as the picture to be replaced, rendering the region indicated by the rendering region information in the picture to be replaced into the color indicated by the rendering color information.
4. The method of claim 3, further comprising:
if the picture type is a static picture, judging whether the picture format of the picture to be replaced is a preset picture format;
if the picture format is a preset picture format, converting the picture format of the picture to be replaced into a basic picture format; after the conversion operation is completed, the operation of rendering the area indicated by the rendering area information in the picture to be replaced into the color indicated by the rendering color information is executed;
or if the picture format is not the preset picture format, directly executing the operation of rendering the region indicated by the rendering region information in the picture to be replaced into the color indicated by the rendering color information.
5. The method according to claim 1, wherein the rendering information further includes a page ID of a page to which the picture to be replaced belongs;
the displaying of each rendered picture to be replaced includes:
for each picture to be replaced, combining the rendered picture to be replaced with a control corresponding to the picture to be replaced;
and displaying the control after the combination in the page indicated by the page ID.
6. A skin replacement device, for application to a terminal, the device comprising:
the device comprises a first determination module, a second determination module and a third determination module, wherein the first determination module is used for determining the skin indicated by a skin replacement instruction as the skin to be replaced if the skin replacement instruction for a target application program is detected;
a second determining module, configured to determine, for each page in the target application program, rendering information predefined for a picture to be replaced in each page in the target application program based on the skin identifier of the skin to be replaced;
the rendering module is used for rendering each picture to be replaced based on the rendering information;
and the display module is used for displaying each rendered picture to be replaced.
7. The apparatus according to claim 6, wherein the rendering information at least comprises a picture identifier, rendering area information and rendering color information of each picture to be replaced;
correspondingly, the rendering module is specifically configured to:
for each picture to be replaced, acquiring the picture to be replaced based on the picture identification of the picture to be replaced;
rendering the area indicated by the rendering area information in the picture to be replaced into the color indicated by the rendering color information.
8. The apparatus of claim 7, wherein the rendering module is further specifically configured to:
judging the picture type of the picture to be replaced;
if the picture type is a dynamic picture, acquiring each frame of sub-picture in the dynamic picture;
and after each frame of sub-picture is respectively used as the picture to be replaced, rendering the region indicated by the rendering region information in the picture to be replaced into the color indicated by the rendering color information.
9. The apparatus of claim 8, wherein the rendering module is further specifically configured to:
if the picture type is a static picture, judging whether the picture format of the picture to be replaced is a preset picture format;
if the picture format is a preset picture format, converting the picture format of the picture to be replaced into a basic picture format; after the conversion operation is completed, the operation of rendering the area indicated by the rendering area information in the picture to be replaced into the color indicated by the rendering color information is executed;
or if the picture format is not the preset picture format, directly executing the operation of rendering the region indicated by the rendering region information in the picture to be replaced into the color indicated by the rendering color information.
10. The apparatus according to claim 6, wherein the rendering information further includes a page ID of a page to which the picture to be replaced belongs;
the display module includes:
the combination sub-module is used for combining the rendered picture to be replaced with the control corresponding to the picture to be replaced for each picture to be replaced;
and the display sub-module is used for displaying the combined control in the page indicated by the page ID.
11. An electronic device is characterized by comprising a processor, a communication interface, a memory and a communication bus, wherein the processor and the communication interface are used for realizing mutual communication by the memory through the communication bus;
a memory for storing a computer program;
a processor for implementing the method steps of any one of claims 1 to 5 when executing a program stored in the memory.
12. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the method according to any one of claims 1-5.
CN201911195317.4A 2019-11-28 2019-11-28 Skin replacement method and device, electronic equipment and readable storage medium Pending CN111061414A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911195317.4A CN111061414A (en) 2019-11-28 2019-11-28 Skin replacement method and device, electronic equipment and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911195317.4A CN111061414A (en) 2019-11-28 2019-11-28 Skin replacement method and device, electronic equipment and readable storage medium

Publications (1)

Publication Number Publication Date
CN111061414A true CN111061414A (en) 2020-04-24

Family

ID=70299207

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911195317.4A Pending CN111061414A (en) 2019-11-28 2019-11-28 Skin replacement method and device, electronic equipment and readable storage medium

Country Status (1)

Country Link
CN (1) CN111061414A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111752454A (en) * 2020-06-23 2020-10-09 厦门美柚股份有限公司 Skin control method, device, terminal and medium for application program interface
CN113448670A (en) * 2021-06-28 2021-09-28 吉林亿联银行股份有限公司 APP client skin changing method and device

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102591655A (en) * 2011-12-28 2012-07-18 北京新媒传信科技有限公司 Method for implementing icon buttons and device
CN104978186A (en) * 2015-05-26 2015-10-14 腾讯科技(深圳)有限公司 Interface skin rendering method and apparatus
CN106775688A (en) * 2016-12-05 2017-05-31 广州视源电子科技股份有限公司 The generation method and device of application icon
CN109426541A (en) * 2017-08-31 2019-03-05 阿里巴巴集团控股有限公司 A kind of method and apparatus that the page changes skin

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102591655A (en) * 2011-12-28 2012-07-18 北京新媒传信科技有限公司 Method for implementing icon buttons and device
CN104978186A (en) * 2015-05-26 2015-10-14 腾讯科技(深圳)有限公司 Interface skin rendering method and apparatus
CN106775688A (en) * 2016-12-05 2017-05-31 广州视源电子科技股份有限公司 The generation method and device of application icon
CN109426541A (en) * 2017-08-31 2019-03-05 阿里巴巴集团控股有限公司 A kind of method and apparatus that the page changes skin

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111752454A (en) * 2020-06-23 2020-10-09 厦门美柚股份有限公司 Skin control method, device, terminal and medium for application program interface
CN113448670A (en) * 2021-06-28 2021-09-28 吉林亿联银行股份有限公司 APP client skin changing method and device

Similar Documents

Publication Publication Date Title
KR101623415B1 (en) Drawing method, apparatus, and terminal
CN108228293B (en) Interface skin switching method and device
CN111988659B (en) Multi-information-source dynamic window previewing method and device, intelligent display equipment and storage medium
CN104834637B (en) Webpage picture display method and device
CN112181554B (en) Interactive interface display method, device, electronic device and storage medium
US20150317059A1 (en) Application management method for a mobile terminal and the mobile terminal
CN112016023B (en) Service processing method, device, terminal and storage medium
CN112364277A (en) Webpage loading method and device
CN111432263B (en) Barrage information display, processing and release method, electronic equipment and medium
CN110990733B (en) Page loading method and device, electronic equipment and medium
CN109446199B (en) Cell data processing method and device
CN111061414A (en) Skin replacement method and device, electronic equipment and readable storage medium
CN111881393A (en) Page rendering method, device, medium and electronic equipment
CN112527434A (en) Page display method, terminal, server, system and electronic equipment
CN110825600B (en) Page information processing method, server and page display device
CN112148395A (en) Page display method, device, equipment and storage medium
CN111435313A (en) Method and device for changing skin of software
CN111538667A (en) Page testing method and device
CN111367606A (en) Application page display method, device, terminal and medium
CN113852763B (en) Audio and video processing method and device, electronic equipment and storage medium
CN112583702B (en) Information mass sending method and device, computer equipment and storage medium
CN112988810B (en) Information searching method, device and equipment
CN111045749B (en) Application program starting method and device
CN112433778A (en) Mobile equipment page display method and device, electronic equipment and storage medium
CN113656718A (en) Theme switching method and device

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
RJ01 Rejection of invention patent application after publication

Application publication date: 20200424