Avatar frame multiplexing method, storage medium, and electronic device
By defining the avatar frame entity and calling the corresponding functions, the avatar frame is reused and compatible, solving the problems of reuse difficulties and complex hierarchical settings in the existing technology, and improving efficiency and compatibility.
Patent Information
- Application Number
- CN202111154553.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-09-29
- Publication Date
- 2024-12-13
- Estimated Expiration
- 2041-09-29
AI Technical Summary
In the prior art, the avatar frame is difficult to reuse among different projects, the hierarchy settings are complex, and the traditional labeling adds logic, resulting in large management workloads and easy integration problems when upgrading the version.
By defining the parameter structure and type of the avatar frame entity, calling the entity generation function to generate the avatar frame entity, and using the avatar frame addition function to add it to the avatar picture, realizing the reuse and compatibility of the avatar frame.
It simplifies the use process of avatar frame, reduces manual planning and filling work, improves efficiency, realizes flexible reuse and extensive compatibility of avatar frame, and reduces the development workload.
Smart Images

Figure CN113885862B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing, and in particular to an avatar frame multiplexing method, a storage medium, and an electronic device. Background Art
[0002] With the development of the information industry, communication through various APPs plays an increasingly important role in people's work and life.
[0003] Correspondingly, in addition to using nicknames to distinguish themselves, people in various APPs have further set up avatars that are easier to distinguish. While managing users' avatars, the platform also provides users with avatar frames. By adding avatar frames to the avatars, different users can be further distinguished.
[0004] Adding an avatar frame is actually similar to adding a decorative pendant to the avatar. Therefore, after the user confirms the avatar frame he or she wants to use, the platform needs to add the corresponding avatar frame in different environments where the user uses the avatar to ensure consistency.
[0005] However, different environments where avatars are used require maintenance personnel to add avatar frames specifically according to corresponding conditions. This one-by-one adding method has the following defects:
[0006] 1. The avatar frames added by different projects are of different types and methods. The avatar frame used by one project requires complex conversion and calling before it can be used by another project.
[0007] 2. The avatar frame may be set up in levels, and different levels correspond to different images, such as VIP logo, level logo, and different levels correspond to the calculation and processing of different modules, which increases the workload of management.
[0008] 3. The traditional avatar frame label needs to be added everywhere, and a lot of logic is scattered and not converged, which leads to a large workload of development.
[0009] 4. During the platform version upgrade process, the avatar frame is prone to integration difficulties due to conflicts between historical versions and existing versions.
[0010] Therefore, a flexible avatar frame usage solution is urgently needed. Summary of the invention
[0011] In view of the defects existing in the prior art, the purpose of the present invention is to provide an avatar frame multiplexing method, storage medium, and electronic device that can achieve encapsulation and abstraction, ensure the compatibility of various avatar frame usage environments, and thus achieve the reuse of avatar frames.
[0012] To achieve the above objectives, in a first aspect, an embodiment of the present invention provides a method for reusing an avatar frame.
[0013] When obtaining the preset trigger instruction of the avatar frame, calling the entity generation function, obtaining the input avatar frame parameters through the parameter acquisition interface of the entity generation function, and generating the corresponding avatar frame entity; wherein the avatar frame entity includes a predefined parameter structure and parameter type;
[0014] Call the avatar frame adding function, obtain the avatar frame entity generated by the entity generating function through the entity acquiring interface of the avatar frame adding function, generate an avatar frame according to the avatar frame entity, and add the avatar frame to the avatar picture.
[0015] As a preferred implementation, before calling the entity generation function, the method further includes: defining the parameter structure and parameter type of the avatar frame entity.
[0016] As a preferred implementation, the parameter structure and parameter type of defining the avatar frame entity include:
[0017] The order of parameters and the relationship between parameters are specified, and parameter types are defined, wherein the parameter types include at least one picture type.
[0018] As a preferred embodiment, the picture type includes at least one optional subclass, and the step of obtaining the input avatar frame parameter includes obtaining the subclass of the input picture type;
[0019] Generates an avatar frame entity based on the order of parameters, the relationship between parameters, and the subclass of the input image type.
[0020] As a preferred implementation, the parameter type includes multiple image types, and different types of variables store corresponding avatar frame widgets.
[0021] As a preferred implementation, the parameter types include variables of avatar frame position and avatar frame size.
[0022] As a preferred implementation, the step of generating an avatar frame according to the avatar frame entity includes:
[0023] Get the original avatar frame according to the URL address corresponding to the subclass of the input image type;
[0024] Storing the original avatar frame corresponding to the picture type;
[0025] Obtaining the position of the original avatar frame according to the data in the variable storing the position of the avatar frame;
[0026] According to the data in the variable of the avatar frame size, the size of the original avatar frame is adjusted to obtain the avatar frame.
[0027] As a preferred implementation scheme, the avatar frame preset triggering instruction includes at least an avatar frame creation instruction and an avatar frame update instruction.
[0028] In a second aspect, an embodiment of the present invention further provides a storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the method of implementing the first aspect of the implementation scheme.
[0029] In a third aspect, an embodiment of the present invention further provides an electronic device, including a memory and a processor, wherein the memory stores a computer program that runs on the processor, and when the processor executes the computer program, the method of implementing the implementation scheme of the first aspect is implemented.
[0030] Compared with the prior art, the advantages of the present invention are:
[0031] The present invention provides an avatar frame reuse method and system, which forms an avatar frame entity by setting an avatar frame entity as an intermediate medium, that is, data parameters, and the avatar frame entity generates an avatar frame. The avatar frame entity completes the abstraction of all the logic of the avatar frame, so that any environment that needs to use the avatar frame only needs to generate the avatar frame entity by calling the entity generation function for each parameter, and then the avatar frame addition function extracts the parameters in the avatar frame entity to generate the corresponding avatar frame, so that reuse can be achieved, which is very simple and flexible.
[0032] At the same time, the present invention also proposes that the picture type in the avatar frame entity is configured with multiple types of formats, which can be compatible with various forms of avatars, ensuring compatibility and wider application.
[0033] Furthermore, the present invention only needs to call two functions to add an avatar frame, which is very flexible and simple. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, a brief introduction is given below to the drawings corresponding to the embodiments. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0035] Figure 1 A flowchart of an embodiment of a head portrait frame multiplexing method, a storage medium, and an electronic device of the present invention;
[0036] Figure 2 It is a structural schematic diagram of an embodiment of an electronic device for multiplexing an avatar frame according to the present invention. DETAILED DESCRIPTION
[0037] The embodiments of the present invention are further described in detail below with reference to the accompanying drawings.
[0038] The embodiments of the present invention provide an avatar frame multiplexing method, a storage medium, and an electronic device. The method first presets the parameter structure and parameter type of the avatar frame entity, and calls the entity generation function to generate the avatar frame entity. The avatar frame adding function then reads the parameters of the avatar frame entity to generate the avatar frame. The method is very simple and flexible, and is compatible with various forms of avatars.
[0039] In order to achieve the above technical effects, the overall idea of this application is as follows:
[0040] When obtaining the preset trigger instruction of the avatar frame, calling the entity generation function, obtaining the input avatar frame parameters through the parameter acquisition interface of the entity generation function, and generating the corresponding avatar frame entity; wherein the avatar frame entity includes a predefined parameter structure and parameter type;
[0041] Call the avatar frame adding function, obtain the avatar frame entity generated by the entity generating function through the entity acquiring interface of the avatar frame adding function, generate an avatar frame according to the avatar frame entity, and add the avatar frame to the avatar picture.
[0042] In summary, the avatar frame entity of the present invention is predefined, so that the parameters required for generating the avatar frame can be stored in a predefined manner and structure in the location specified by the avatar frame entity. When generating, the computer can know where to read the corresponding parameters to complete the generation and addition of the corresponding avatar frame.
[0043] Furthermore, the present invention calls two functions, one is an entity generation function, and the other is an avatar frame adding function. The entity generation function automatically completes the generation of the avatar frame entity, which saves the manpower and material resources of manual planning and filling, saves time and improves efficiency. The avatar frame adding function ensures that the computer can automatically extract the parameters in the avatar frame entity and generate the corresponding avatar frame.
[0044] It should be noted that the parameter structure and parameter type of the avatar frame entity proposed in the present invention are not limited to the style and architecture proposed in the embodiment. As long as the corresponding parameters of the avatar frame are stored in a certain structural order, the entity generation function and the avatar frame adding function can perform corresponding conversion and calculation.
[0045] In order to better understand the above technical solution, a detailed description is given below in conjunction with specific implementation methods.
[0046] See also Figure 1 As shown, an embodiment of the present invention provides a method for reusing an avatar frame, which includes:
[0047] S1. When obtaining a preset trigger instruction of an avatar frame, call an entity generation function, obtain input avatar frame parameters through a parameter acquisition interface of the entity generation function, and generate a corresponding avatar frame entity; wherein the avatar frame entity includes a predefined parameter structure and parameter type.
[0048] It should be noted that the executor of the avatar frame multiplexing method of this embodiment may be an APP application of the client, and the avatar frame preset trigger instruction includes at least an avatar frame creation instruction and an avatar frame update instruction;
[0049] The origin of the avatar frame creation instruction may be: the user operates the content in the client APP of the platform, so that the result of the operation meets the preset conditions for the platform to present the avatar frame to the user, and the client APP will generate an avatar frame creation instruction; taking the live broadcast platform as an example, if the user watches the live broadcast content of a certain anchor's live broadcast room for a certain viewing time, and the number of barrages sent by the user in the live broadcast room of this anchor reaches a specified number of barrages, then these operation behaviors of the user meet the preset conditions for the live broadcast platform to present the avatar frame to the user;
[0050] The origin of the avatar frame update instruction may be: the platform needs to update and upgrade the style of the existing avatar frame. This scenario mostly occurs when the platform releases a new version of the client and the old version of the client APP loaded on the user's mobile terminal needs to be upgraded to the new version.
[0051] It should also be noted that during the platform version upgrade process, the avatar frame is prone to integration difficulties due to conflicts between historical versions and existing versions:
[0052] When displaying avatar frames in various old interfaces, the parameters are called, calculated and avatar frames are generated according to the calling habits of the corresponding interface managers. Different people have different habits, and the calculation, calling and avatar frame generation methods are different. There may be other levels between the avatar frames, such as noble marks and level marks. The product needs require the avatar frames to be deeply bound and integrated together. It is a lot of work to handle this level in various places, and it is decentralized management, and the management workload is large in multiple places.
[0053] The present invention directly organizes the parameters of various interfaces and projects into an avatar frame entity, which is convenient for subsequent avatar frame generation and corresponding adjustments during upgrades and maintenance.
[0054] As a preferred embodiment, the step of obtaining the input avatar frame parameters includes obtaining a subclass of the input picture type;
[0055] Generates an avatar frame entity based on the order of parameters, the relationship between parameters, and the subclass of the input image type.
[0056] When it is necessary to uniformly adjust the generation rules of avatar frames, software maintenance personnel need to confirm, adjust, adapt or even rewrite the generation methods of avatar frames in each interface one by one. However, the transmission and use of some parameters are very complicated, and a complete rewrite may not be realistic. At this time, only internal checking and adjustment can be carried out one by one, which results in a huge waste of manpower, material resources and computing resources.
[0057] Some avatars are avatar frames added through UIImageView, some are avatar frames of UIbutton, and some are dynamic avatar frames. How to unify the management of these original avatars of various styles is a big difficulty. In order to solve this diversity, conventional solutions have to be customized in each place, which leads to a large amount of development and inconvenience.
[0058] The present invention proposes to organize various parameters of the avatar frame into an avatar frame entity before generating the avatar frame, and at the same time, automatically generate the avatar frame entity with an entity generation function. When unified adjustment is required, only the corresponding parameters or corresponding methods of the avatar frame entity need to be adjusted, and there is no need to adjust one by one for each interface or situation, which is very convenient for adjustment.
[0059] S2. Calling the avatar frame adding function, obtaining the avatar frame entity generated by the entity generating function through the entity acquiring interface of the avatar frame adding function, generating an avatar frame according to the avatar frame entity, and adding the avatar frame to the avatar picture.
[0060] The old avatar frame has various hierarchical parameters that need to be retrieved from various places, which is very scattered and labor-intensive.
[0061] In response to this problem, the present invention directly organizes the parameters of each interface and project into an avatar frame entity. Since the avatar frame implements centralized management of parameters and calculations at each level, when the version is upgraded, it can be centrally updated directly by updating the avatar frame. That is, when the version is updated or new version data is called, the present invention organizes the parameters required to create the avatar frame into an avatar frame entity. In this way, when other interfaces require a new version of the avatar frame data, they only need to call the avatar frame add function to read the corresponding parameters from the avatar frame entity. The avatar frame creation process of the present invention has convergent logic and low development workload. When historical problems occur in the software and various parameters and interfaces need to be adjusted, the avatar frame only needs to realign the corresponding parameters to ensure the generation of the avatar frame entity, and the integration is simple.
[0062] This kind of avatar frame entity abstraction, creation and use can handle the hierarchy problem very well, does not affect other VIP labels and noble labels, and can easily achieve high binding with the avatar; it is simple and compatible with different scenes, and can add avatar frames smoothly and quickly.
[0063] As a preferred implementation, the parameter structure and parameter type of the avatar frame entity are defined, including:
[0064] The order of parameters and the relationship between parameters are specified, and parameter types are defined, wherein the parameter types include at least one picture type.
[0065] There are various types of pictures corresponding to the avatar frame, which need to be saved in different types of variables and processed in different ways.
[0066] Specifically, the parameter type includes multiple image types, and different types of variables store corresponding avatar frame widgets.
[0067] For example, create an avatar frame entity, this entity is DYCommonHeaderView, this entity inherits the UIview property, and adds multiple properties to this avatar frame entity, where different types of variables include
[0068] If the original image is image use this variable to hold it:
[0069] @property(nonatomic,strong)UIImageView*headImage;
[0070] If the original image is held by the button use this variable:
[0071] @property(nonatomic,strong)UIButton*headBtn;
[0072] If the original image is held by a FLAnimatedImageView use this variable:
[0073] @property(nonatomic,strong)FLAnimatedImageView*headAniImageView;
[0074] If it is an additional avatar frame added by the user, use this variable to hold:
[0075] @property(nonatomic,strong)FLAnimatedImageView*aniImageView;
[0076] The created avatar frame entity is an abstraction of the entire logic of the avatar frame. After being abstracted into an avatar frame entity, the avatar frame can be easily reused in various places. At the same time, the controls added to the avatar frame entity are saved in external variables, which can realize the flexible addition of various controls. In addition, the avatar frame entity in this step is compatible with UIImageView, UIButton, dynamic images, and multiple styles.
[0077] Furthermore, in addition to the above-mentioned image variables, the parameter types include variables of avatar frame position and avatar frame size.
[0078] For example, after completing the definition of the image type variable, the following definitions are also made:
[0079] / / / Create a url
[0080] / / / @param frame frame
[0081] / / / @param type needs to add button or image
[0082] / / / @param size The outer size of the avatar frame
[0083] -(instancetype)initWithFrame:(CGRect)frame type:(DYCommonHeaderViewType)type size:(CGSize)size;
[0084] The above parameters, the first parameter is the public photo frame avatar address, the second is the size of the avatar frame, the third parameter is the type of avatar frame added, and the fourth parameter is the size of the avatar frame.
[0085] After the above parameters are defined, the present invention also provides an embodiment of creating an avatar frame entity:
[0086] Call self = [super initWithFrame:frame] function to complete the self-creation of the avatar frame entity and obtain the position of the avatar inside the avatar frame. The function method for obtaining the position of the avatar inside the avatar frame is as follows:
[0087] CGFloat topX=(self.width-size.width)*0.5;
[0088] CGFloat topY=(self.height-size.height)*0.5;
[0089] Through the above function, we can get topX and topY, and further judge
[0090] if(type==DYCommonHeaderViewTypeImageView)
[0091] Determine the type of the avatar frame, whether it is DYCommonHeaderViewTypeImageView (static image)
[0092] The type of the current avatar frame. If it is of the imageView type, you need to create a headImage view and add it to the current avatar frame. If it is of the DYCommonHeaderViewTypeButton type, you need to create a headBtn type avatar and add it to this entity. At the same time, set the position of this headBtn. The position of this headBtn is as follows:
[0093] self.headBtn.frame=CGRectMake(topX,topY,size.width,size.height);
[0094] If the type is DYCommonHeaderViewTypeNotAdd, no avatar frame will be added. (DYCommonHeaderViewTypeNotAdd is a mark for not adding avatar frame)
[0095] After completing the processing, conversion and storage of the above-mentioned parameters such as size calculation and image storage, the avatar frame entity is finally returned.
[0096] After the avatar frame entity is created, you need to call the function to add the avatar frame. The internal implementation process of the function to add the avatar frame is as follows:
[0097] First, determine whether the current avatar frame exists, if (self.aniImageView.superview) {
[0098] That is, determine whether the entity of the avatar frame exists. If this entity exists, then you need to remove the avatar frame through [self.aniImageView removeFromSuperview]; after removal, set the avatar frame to nil.
[0099] Furthermore, if the url is nil, it will be returned directly. You can then add the current avatar frame you created by using the self function, and the adding operation is to add the image through [self addSubview:self.aniImageView].
[0100] Furthermore, after completing the operation of adding the avatar frame, you also need to set the position of the avatar frame: self.aniImageView.frame = CGRectMake(0,0,self.width,self.height); that is, use the CGRectMake function to set the position of the avatar frame to (0,0,self.width,self.height).
[0101] It should also be noted that the present invention adds and sets the avatar frame through the url, and the operation of adding the avatar frame is [self.aniImageView sd_setImageWithURL:[NSURL URLWithString:url]]; that is, obtaining the image pointed to by the url.
[0102] That is, the addition of UIimageView, UIButton and various controls is realized inside the avatar frame entity, and the added controls are saved through external variables. This method of adding controls through the entity and adding the added avatar frame to the entity can ensure that the avatar and the avatar frame are completely tightly coupled together, and do not interfere with other components such as VIP labels and noble labels. That is, the present invention solves the conflict problem with VIP labels and noble labels through the entity, simplifies the operation, and realizes a large number of logical view addition and removal, and prevents repeated addition operations, laying a foundation for the subsequent rapid addition of size.
[0103] Preferably, generating the avatar frame according to the avatar frame entity includes:
[0104] Get the original avatar frame according to the URL address corresponding to the subclass of the input image type;
[0105] Storing the original avatar frame corresponding to the picture type;
[0106] Obtaining the position of the original avatar frame according to the data in the variable storing the position of the avatar frame;
[0107] According to the data in the variable of the avatar frame size, the size of the original avatar frame is adjusted to obtain the avatar frame.
[0108] For example, the function that creates an avatar frame is called as follows:
[0109] DYCommonHeaderView*headImage=[[DYCommonHeaderViewalloc]initWithFrame:CGRectMake((self.bgView.width-66)*0.5,self.bgView.top+17+imageNobleDescend,66,66)type:DYCommonHeaderViewTypeImageViewsize:CGSizeMake(58,58)];
[0110] Among them, DYCommonHeaderView*headImage is the called function for creating the avatar frame. The function confirms the placement position of the avatar frame entity as (self.bgView.width-66)*0.5,self.bgView.top+17+imageNobleDescend,66,66) through the code initWithFrame:CGRectMake((self.bgView.width-66)*0.5,self.bgView.top+17+imageNobleDescend,66,66), and sets the type of the avatar frame DYCommonHeaderViewTypeImageView through the parameter code type:DYCommonHeaderViewTypeImageView; and stipulates that the size of the avatar frame is: size:CGSizeMake(58,58).
[0111] That is, this function has three parameters. One parameter is to create an entity of the avatar frame and set the position for the entity of the avatar frame. The second parameter is the type of the underlying avatar created by the avatar frame. Here, you need to create an ImageView type avatar. The third is the size of the created avatar. The size of the avatar, here is 58 in width and 66 in height, so an avatar frame position is automatically created in the underlying bureau. At this time, to add an avatar, you need to call the [self.headImageaddHeadImage:url] function to add an avatar picture. In this way, the integration of the peripheral avatar and the avatar frame is completed. The created avatar and avatar frame entities can be saved separately by external variables, and can be adjusted according to specific circumstances later, which is flexible and convenient.
[0112] Based on the same inventive concept, the present application provides a third embodiment. The third embodiment of the present invention provides a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the steps of the above method embodiment are implemented.
[0113] The computer storage medium of the embodiment of the present invention can adopt any combination of one or more computer-readable media. The computer-readable medium can be a computer-readable signal medium or a computer-readable storage medium. The computer-readable storage medium can be, for example, but not limited to: an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples (non-exhaustive list) of computer-readable storage media include: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this document, a computer-readable storage medium can be any tangible medium containing or storing a program, which can be used by an instruction execution system, device or device or used in combination with it.
[0114] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, which carry computer-readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0115] The program code embodied on the computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
[0116] Computer program code for performing the operations of the present invention may be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0117] Note that the above are only preferred embodiments of the present invention and the technical principles used. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein, and that various obvious changes, readjustments and substitutions can be made by those skilled in the art without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in more detail through the above embodiments, the present invention is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of the present invention, and the scope of the present invention is determined by the scope of the appended claims.
[0118] Based on the same inventive concept, this application provides a fourth embodiment, such as Figure 2 As shown, the fourth embodiment of the present invention further provides an electronic device, including a memory and a processor, wherein the memory stores a computer program running on the processor, and when the processor executes the computer program, all or part of the method steps in the first embodiment are implemented.
[0119] The processor may be a central processing unit (CPU), other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc. The processor is the control center of the computer device, and uses various interfaces and lines to connect various parts of the entire computer device.
[0120] The memory can be used to store the computer program and / or module, and the processor realizes various functions of the computer device by running or executing the computer program and / or module stored in the memory, and calling the data stored in the memory. The memory can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area can store data created according to the use of the mobile phone (such as audio data, video data, etc.), etc. In addition, the memory can include a high-speed random access memory, and can also include a non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.
[0121] In general, the embodiments of the present invention provide an avatar frame multiplexing method, storage medium, and electronic device. Only two lines of code are needed to construct an avatar frame view, and the avatar frame parameters can be flexibly added. The type of avatar frame added, the parameters of the avatar frame outer frame and inner frame, and the type of avatar frame only need to be passed in through parameters, thereby realizing the quick addition of avatar frames and being very simple to use.
[0122] Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include these modifications and variations.
Claims
1. A method for reusing an avatar frame, characterized in that: It includes: When obtaining the preset trigger instruction of the avatar frame, calling the entity generation function, obtaining the input avatar frame parameters through the parameter acquisition interface of the entity generation function, and generating the corresponding avatar frame entity; wherein the avatar frame entity includes a predefined parameter structure and parameter type; Calling the avatar frame adding function, obtaining the avatar frame entity generated by the entity generating function through the entity acquiring interface of the avatar frame adding function, generating an avatar frame according to the avatar frame entity, and adding the avatar frame to the avatar picture; Before calling the entity generation function, the method further includes: defining the parameter structure and parameter type of the avatar frame entity; The parameter structure and parameter type defining the avatar frame entity include: Specifying the order of parameters and the relationship between parameters, defining parameter types, wherein the parameter types include at least one image type; The picture type includes at least one optional subclass, and the step of obtaining the input avatar frame parameter includes obtaining the subclass of the input picture type; Generate an avatar frame entity based on the order of parameters, the relationship between parameters, and the subclass of the input image type; The parameter types include variables of the avatar frame position and the avatar frame size; The step of generating an avatar frame according to the avatar frame entity includes: Get the original avatar frame according to the URL address corresponding to the subclass of the input image type; Storing the original avatar frame corresponding to the picture type; Obtaining the position of the original avatar frame according to the data in the variable of the avatar frame position; According to the data in the variable of the avatar frame size, the size of the original avatar frame is adjusted to obtain the avatar frame.
2. A method for reusing an avatar frame according to claim 1, characterized in that: The parameter types include multiple image types, and different types of variables store corresponding avatar frame widgets.
3. A method for reusing an avatar frame as claimed in claim 1 or 2, characterized in that: The avatar frame preset triggering instruction at least includes an avatar frame creation instruction and an avatar frame update instruction.
4. A storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 3 is implemented.
5. An electronic device comprising a memory and a processor, wherein the memory stores a computer program running on the processor, wherein: When a processor executes the computer program, the method according to any one of claims 1 to 3 is implemented.
Citation Information
Patent Citations
Intelligent image file uploading management method
CN104573079A
Image processing method, head image setting method and device
CN109509141A
User portrait generation method and device, electronic equipment and computer readable medium
CN109785034A
Head portrait pendant generation method and device and related equipment
CN110276723A
Method and device for manufacturing pendant through template and storage equipment
CN110580163A
