A method, device and electronic device for drawing barrage pictures

By setting a preset gallery in the client, the subcontent and elements of the barrage picture are automatically determined and drawn, and the problem of low manual drawing efficiency is solved, and efficient barrage picture generation is achieved.

CN115720282BActive Publication Date: 2025-07-22BEIJING QIYI CENTURY SCI & TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211424047.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-11-14
Publication Date
2025-07-22
Estimated Expiration
2042-11-14

AI Technical Summary

Technical Problem

In the prior art, drawing barrage pictures by manual cutting is inefficient, and as the number of barrages increases, the drawing efficiency problem becomes more prominent.

Method used

Preset preset gallery in the client, obtain sub-contents of the barrage picture and determine the corresponding picture elements in the gallery, determine the splicing order and display rules, call the preset drawing method for bitmap drawing, and generate barrage pictures.

Benefits of technology

Improve the efficiency of drawing barrage pictures, reduce manual operations, and improve drawing speed.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115720282B_ABST
    Figure CN115720282B_ABST
Patent Text Reader

Abstract

An embodiment of the present invention provides a method, device, and electronic device for drawing a barrage picture, which relates to the technical field of image processing. The method includes: obtaining each sub-content included in the picture content of the barrage picture to be generated; determining a picture element corresponding to each sub-content in a preset picture library; determining the splicing order and display rules of each picture element; and based on the splicing order and the display rules, calling a preset drawing method to perform bitmap drawing on each picture element to obtain the barrage picture to be generated. Compared with the prior art, applying the solution provided by the embodiment of the present invention can improve the drawing efficiency of the barrage picture.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of image processing, and in particular to a bullet screen picture drawing method, device and electronic equipment. Background Art

[0002] With the launch of various video playback clients, streaming media service providers have set up a barrage sending function in their clients in order to increase the playback volume of their own clients. Among them, barrage refers to the commentary subtitles that pop up on the video when watching the video on the Internet or video playback client. In this way, through the barrage presented in the video, users can have a sense of interactive chat. When a consistent point of view appears in the barrage, it can strengthen the user's sense of identity with the video.

[0003] However, the content of the bullet screen is mainly text, which lacks interest. Therefore, in order to increase the interest of the bullet screen display, a corresponding bullet screen picture can be added to the bullet screen according to the text content of the bullet screen.

[0004] In the related art, for each bullet screen, a bullet screen image is drawn by manually cutting the image. However, as the number of bullet screens increases, the number of bullet screen images that need to be drawn becomes larger and larger. The manual cutting method of drawing bullet screen images will result in low drawing efficiency. Summary of the invention

[0005] The purpose of the embodiments of the present invention is to provide a method, device and electronic device for drawing a bullet screen image, so as to improve the drawing efficiency of the bullet screen image. The specific technical solution is as follows:

[0006] In a first aspect of an embodiment of the present invention, a method for drawing a bullet screen picture is first provided, which is applied to a client, and the method includes:

[0007] Obtain each sub-content included in the image content of the barrage image to be generated;

[0008] Determine the image element corresponding to each sub-content in the preset image library;

[0009] Determine the splicing order and display rules of each image element;

[0010] Based on the splicing order and the display rules, a preset drawing method is called to perform bitmap drawing on each image element to obtain the bullet screen image to be generated.

[0011] Optionally, in a specific implementation, the method further includes:

[0012] Output the bullet screen image to be generated.

[0013] Optionally, in a specific implementation, the output of the to-be-generated bullet screen image includes:

[0014] Display the bullet screen image and the target text for determining the image content according to a preset positional relationship.

[0015] Optionally, in a specific implementation, the obtaining of each sub-content included in the image content of the to-be-generated bullet screen image includes:

[0016] Receive each sub-content included in the image content of the to-be-generated bullet screen image sent by a preset server;

[0017] Or,

[0018] Obtain the initial text input by the user regarding the to-be-generated bullet screen image; generate the image content of the to-be-generated bullet screen image according to the initial text, and divide the image content into each sub-content.

[0019] Optionally, in a specific implementation, the generating of the image content of the to-be-generated bullet screen image according to the initial text includes:

[0020] Determine the target image content generation rule corresponding to the target application scenario of the initial text;

[0021] Utilize the target image content generation rule to determine the description information matching the initial text based on the text content of the initial text as the image content of the to-be-generated bullet screen image.

[0022] Optionally, in a specific implementation, the dividing of the image content into each sub-content includes:

[0023] Perform word segmentation on the image content belonging to text in the description information to obtain each sub-content, and respectively determine each character not belonging to text in the description information as a sub-content.

[0024] Optionally, in a specific implementation, when each sub-content is obtained based on the initial text, the method further includes:

[0025] Send each sub-content to a preset server.

[0026] In the second aspect of the embodiments of the present invention, a bullet screen image drawing device is further provided, which is applied to a client, and the device includes:

[0027] A sub-content obtaining module, configured to obtain each sub-content included in the image content of the to-be-generated bullet screen image;

[0028] The picture element determination module is used to determine the picture element corresponding to each sub - content in a preset picture library;

[0029] The determination module is used to determine the splicing order and display rules of each picture element;

[0030] The drawing module is used to call a preset drawing method based on the splicing order and the display rules, and perform bitmap drawing on each picture element to obtain the to - be - generated bullet - screen picture.

[0031] Optionally, in a specific implementation, the device further includes:

[0032] The bullet - screen picture output module is used to output the to - be - generated bullet - screen picture.

[0033] Optionally, in a specific implementation, the bullet - screen picture output module is specifically used for:

[0034] Display the bullet - screen picture and the target text for determining the picture content according to a preset positional relationship.

[0035] Optionally, in a specific implementation, the sub - content acquisition module includes:

[0036] The first sub - content acquisition sub - module is used to receive each sub - content included in the picture content of the to - be - generated bullet - screen picture sent by a preset server;

[0037] Or,

[0038] The second sub - content acquisition sub - module is used to obtain the initial text input by the user regarding the to - be - generated bullet - screen picture; generate the picture content of the to - be - generated bullet - screen picture according to the initial text, and divide the picture content into each sub - content.

[0039] Optionally, in a specific implementation, the second sub - content acquisition sub - module includes:

[0040] The rule determination sub - module is used to determine the target picture content generation rule corresponding to the target application scenario of the initial text;

[0041] The picture content generation sub - module is used to use the target picture content generation rule to determine the description information matching the initial text based on the text content of the initial text as the picture content of the to - be - generated bullet - screen picture.

[0042] Optionally, in a specific implementation, the second sub - content acquisition sub - module is specifically used for:

[0043] Perform word segmentation on the picture content belonging to text in the described information to obtain each sub-content, and determine each character that does not belong to text in the described information as a sub-content respectively.

[0044] Optionally, in a specific implementation manner, the device further includes:

[0045] A sub-content sending module, configured to send the respective sub-contents to a preset server when each sub-content is obtained based on the initial text.

[0046] In a third aspect of the embodiments of the present invention, an electronic device is further provided, including a processor, a communication interface, a memory, and a communication bus. Among them, the processor, the communication interface, and the memory complete communication with each other through the communication bus; the memory is used to store a computer program; when the processor executes the program stored on the memory, it implements any one of the barrage picture drawing methods provided in the first aspect above.

[0047] In yet another aspect of the implementation of the present invention, a computer-readable storage medium is further provided. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, it implements any one of the barrage picture drawing methods described above.

[0048] In yet another aspect of the implementation of the present invention, a computer program product containing instructions is further provided. When it runs on a computer, it causes the computer to execute any one of the barrage picture drawing methods described above.

[0049] As can be seen above, by applying the solution provided in the embodiments of the present invention, when drawing a barrage picture, the client can obtain each sub-content included in the picture content of the barrage picture to be generated. Thus, the picture element corresponding to each sub-content can be determined in a preset picture library. Then, the splicing order and display rules of each picture element can be determined. Furthermore, based on the above splicing order and the above display rules, a preset drawing method is called to perform bitmap drawing on the above picture elements to obtain the above barrage picture to be generated.

[0050] Based on this, by applying the solution provided in the embodiments of the present invention, a preset picture library storing multiple picture elements can be pre-set in the client. Thus, when generating a barrage picture, the picture element corresponding to each sub-content included in the picture content of the barrage picture can be determined from the above preset picture library to complete the drawing of the barrage picture, without the need to draw the barrage picture by means of manual slicing. Thus, the drawing efficiency of the barrage picture can be improved. Description of the Drawings

[0051] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art.

[0052] Figure 1 It is a schematic flowchart of the first method for drawing bullet screen pictures provided by an embodiment of the present invention;

[0053] Figure 2 It is a schematic diagram showing the positional relationship between a bullet screen picture and a target text provided by an embodiment of the present invention;

[0054] Figure 3 It is a schematic flowchart of the second method for drawing bullet screen pictures provided by an embodiment of the present invention;

[0055] Figure 4 It is a schematic structural diagram of a bullet screen picture drawing device provided by an embodiment of the present invention;

[0056] Figure 5 It is a schematic structural diagram of an electronic device provided by an embodiment of the present invention. Detailed implementation manners

[0057] Next, the technical solutions in the embodiments of the present invention will be described in conjunction with the accompanying drawings in the embodiments of the present invention.

[0058] In the related art, for each bullet screen, the bullet screen picture of the bullet screen is drawn by manually cutting pictures. However, with the continuous increase of bullet screens, the number of bullet screen pictures to be drawn is becoming more and more huge. Using the method of manually cutting pictures to draw bullet screen pictures will result in a low drawing efficiency of bullet screen pictures.

[0059] To solve the above technical problems, an embodiment of the present invention provides a method for drawing bullet screen pictures.

[0060] Among them, this method can be applied to various application scenarios with bullet screen display, for example, bullet screens displayed in video software, bullet screens displayed in audio websites, etc. And this method can be applied to various electronic devices such as laptop computers, tablet computers, desktop computers, etc., hereinafter referred to as electronic devices. Among them, the above-mentioned electronic devices are installed with clients having a bullet screen display function. Based on this, the embodiment of the present invention does not limit the application scenario and execution subject of this method.

[0061] A method for drawing bullet screen pictures provided by an embodiment of the present invention, which is applied to a client, may include the following steps:

[0062] Obtain each sub-content included in the picture content of the bullet screen picture to be generated;

[0063] Determine the picture elements corresponding to each sub-content in a preset picture library;

[0064] Determine the splicing order and display rules of each picture element;

[0065] Based on the splicing order and the display rule, call a preset drawing method to perform bitmap drawing on each of the picture elements to obtain the to-be-generated bullet screen picture.

[0066] As can be seen above, when applying the solution provided by the embodiments of the present invention to draw a bullet screen picture, the client can obtain each sub-content included in the picture content of the to-be-generated bullet screen picture. Thus, in a preset picture library, determine the picture element corresponding to each sub-content, and then, can determine the splicing order and the display rule of each picture element. Furthermore, based on the above splicing order and the above display rule, call a preset drawing method to perform bitmap drawing on the above picture elements to obtain the above to-be-generated bullet screen picture.

[0067] Based on this, when applying the solution provided by the embodiments of the present invention, a preset picture library storing multiple picture elements can be pre-set in the client. Thus, when generating a bullet screen picture, the picture element corresponding to each sub-content included in the picture content of the bullet screen picture can be determined from the above preset picture library to complete the drawing of the bullet screen picture, without having to draw the bullet screen picture by means of manual slicing. Thus, the drawing efficiency of the bullet screen picture can be improved.

[0068] Next, with reference to the accompanying drawings, a method for drawing a bullet screen picture provided by the embodiments of the present invention will be specifically described.

[0069] Figure 1 is a schematic flowchart of a method for drawing a bullet screen picture provided by the embodiments of the present invention. As Figure 1 shown, the method may include the following steps S101-S104:

[0070] S101: Obtain each sub-content included in the picture content of the to-be-generated bullet screen picture.

[0071] In order to improve the interest when the bullet screen is displayed in the to-be-played file when playing a video or an audio in the client, the client can draw a bullet screen picture for representing the initial text according to the initial text of the bullet screen displayed in the to-be-played file.

[0072] Therefore, when the client draws the to-be-generated bullet screen picture, first, it can obtain each sub-content included in the picture content of the to-be-generated bullet screen picture.

[0073] Among them, the above sub-content may include text or symbols.

[0074] If the above sub-content includes text, the sub-content may be a character or a non-text character, for example, a character, a mathematical symbol, a number, etc.; if the above sub-content includes a symbol, the sub-content may be a symbol for representing an icon, for example, a symbol for representing a small red flag, a symbol for representing a glutinous rice ball, a symbol for representing a zongzi, etc.

[0075] For example, the initial text of bullet screen A is "Without regret, I always have to move forward; there is a part in this story that you and I joined hands", and the picture content used to represent this bullet screen A is "Single rhyme × 1". Therefore, the sub - contents of bullet screen A include: sub - content "Single rhyme", sub - content "×", and sub - content "1".

[0076] Among them, the bullet screen pictures displayed in the client can include bullet screen pictures corresponding to the initial texts of each bullet screen sent by different users at different times. And in the server that provides services for the client, the initial texts of the above - mentioned each bullet screen can be stored. Thus, when displaying the bullet screen pictures corresponding to the initial texts of each bullet screen, for the bullet screens sent by the user at the current moment, the server can determine each sub - content included in the picture content of the bullet screen pictures of the initial texts of each bullet screen stored, and send each sub - content to the client so that the client can draw the bullet screen pictures corresponding to the initial texts of each bullet screen.

[0077] Based on this, optionally, in a specific implementation manner, the above - mentioned step S101 may include the following step 1011:

[0078] Step 1011: Receive each sub - content included in the picture content of the bullet screen picture to be generated sent by the preset server.

[0079] In this specific implementation manner, in the preset server that provides services for the client, the initial texts of each bullet screen sent by the user can be stored. Thus, when the client draws the bullet screen picture, it can receive each sub - content included in the picture content of the bullet screen picture to be generated sent by the preset server, and then the client can draw the bullet screen picture to be generated according to the above - mentioned each received sub - content.

[0080] Among them, optionally, when the preset server receives each bullet screen sent by the user, it can determine the picture content of the bullet screen picture corresponding to each bullet screen according to the initial text of each bullet screen, and split the determined picture content to obtain each sub - content included in the picture content of each bullet screen picture. Furthermore, the preset server can store each sub - content included in the picture content of each bullet screen picture. In this way, when the client draws the bullet screen picture, it can receive each sub - content included in the picture content of the bullet screen picture to be generated sent by the preset server.

[0081] Optionally, when the preset server receives each barrage sent by the user, it can store the initial text of each barrage. In this way, when the client draws the barrage pictures, the preset server can determine the picture content of the barrage pictures corresponding to each barrage according to the initial text of each barrage, and split the determined picture content. Furthermore, the preset server sends each sub-content included in the picture content of each barrage picture obtained by splitting to the client.

[0082] Optionally, for some barrages that are not stored by the preset server, after the client receives the above barrages and generates the barrage pictures corresponding to the above barrages, the client can send each sub-content included in the picture content of the above barrage pictures to the preset server, so that the preset server stores each sub-content included in the picture content of the above barrage pictures. Thus, when the client generates the barrage pictures corresponding to the above barrages again, the preset server can directly send each sub-content included in the picture content of the above barrage pictures to the client, so that the client does not need to determine each sub-content included in the picture content of the above barrage pictures by itself.

[0083] It should be emphasized that the preset server sending each sub-content included in the picture content of each barrage picture in the above various embodiments is only an example illustration of the technical solutions provided by the embodiments of the present invention, rather than a limitation. Any implementation manner in which the preset server sends each sub-content included in the picture content of each barrage picture to the client belongs to the protection scope of the embodiments of the present invention.

[0084] For example, each sub-content received by the client includes "single rhyme", "skipping rhyme", "×", and "9".

[0085] Among them, the so-called single rhyme is a kind of rhyming. It means that between sentences, there are similar or the same finals. Through different arrangements by the user, the whole paragraph presents a sense of rhythm, similar to the way of shulibao, and the end of each paragraph has the same final. That is to say, single rhyme means that a character in the middle or at the end of the previous sentence rhymes with a character in the middle and at the end of the next sentence. And the so-called skipping rhyme means inserting another group of rhymes between two rhyming sentences, giving people a feeling of ups and downs and echoing at the beginning and end.

[0086] In addition, since the picture content of the barrage pictures displayed in the client can usually be determined according to the initial text of the barrages input by the user, the client can, when receiving the barrages sent by the user, determine the picture content of the barrage pictures to be generated according to the initial text of the barrages, and thus obtain each sub-content included in the picture content of the barrage pictures of the pictures to be generated.

[0087] Based on this, optionally, in a specific implementation, the above step S101 may include the following steps 1012-1013:

[0088] Step 1012: Obtain the initial text input by the user regarding the bullet screen picture to be generated;

[0089] Step 1013: Generate the picture content of the bullet screen picture to be generated according to the initial text, and divide the picture content into each sub-content.

[0090] In this specific implementation, the client can obtain the initial text input by the user regarding the bullet screen picture to be generated. Thus, the picture content of the above-mentioned bullet screen picture to be generated can be generated according to the above initial text. In this way, the above picture content can be divided to obtain each sub-content included in the above picture content.

[0091] For example, if the initial text of the bullet screen picture A to be generated is "Without regret, I always have to move forward; there is a part in this story that is you and I working together", then the picture content of the bullet screen picture A to be generated can be determined as "Single rhyme ×1" according to the above initial text. Furthermore, the picture content "Single rhyme ×1" can be split into sub-content "Single rhyme", sub-content "×", and sub-content "1".

[0092] Optionally, after obtaining the initial text input by the user regarding the bullet screen picture to be generated, the text type and text content included in the initial text regarding the bullet screen picture to be generated can be analyzed according to the pre-established picture content generation rule, and the picture content of the bullet screen picture to be generated can be obtained.

[0093] For example, the pre-established picture content generation rule is: analyze the rhyme type and rhyme multiple in the initial text. Then, when the initial text of the bullet screen picture A to be generated is "Without regret, I always have to move forward; there is a part in this story that is you and I working together", the picture content of the bullet screen picture A to be generated can be obtained by using the above picture content generation rule as "Single rhyme ×1".

[0094] In order to improve the adaptability of the bullet screen picture to be generated to the application scenario, corresponding picture content generation rules can be pre-established for different application scenarios, such as the picture content generation rule for the National Day scenario, the picture content generation rule for the rap scenario, etc.

[0095] In this way, after determining the target application scenario of the initial text of the bullet screen picture to be generated, the target picture content generation rule corresponding to the target application scenario can be determined. Thus, by using the determined picture content generation rule, the picture content of the bullet screen picture to be generated can be obtained, and furthermore, each sub-content of the picture content of the bullet screen picture to be generated can be obtained.

[0096] Based on this, optionally, in a specific implementation manner, in the above step 1013, the step of generating the picture content of the to-be-generated bullet screen picture according to the initial text may include the following steps 11-12:

[0097] Step 11: Determine the target picture content generation rule corresponding to the target application scenario of the initial text;

[0098] Step 12: Use the target picture content generation rule to determine the description information that matches the initial text based on the text content of the initial text as the picture content of the to-be-generated bullet screen picture.

[0099] In this specific implementation manner, after the client obtains the initial text input by the user regarding the to-be-generated bullet screen picture, it can determine the target application scenario of the initial text according to the above initial text. Thus, based on the above target application scenario, it can determine the target picture content generation rule corresponding to the above initial text. Furthermore, using the determined target picture content generation rule, based on the text content of the above initial text, it determines the description information that matches the above initial text as the picture content of the above to-be-generated bullet screen picture.

[0100] In this way, it can determine the target picture content generation rule corresponding to the initial text according to the target application scenario of the to-be-generated bullet screen picture, so that it can generate the picture content of the to-be-generated bullet screen picture adapted to the above target application scenario. Further, it obtains a bullet screen picture adapted to the above target application scenario.

[0101] In some application scenarios, regardless of the text type to which the initial text belongs, using the target picture content generation rule corresponding to the application scenario, the picture content of the to-be-generated bullet screen picture set for the application scenario can be obtained. For example, in the National Day scenario, regardless of the text type of the initial text input by the user, the symbols set for the National Day scenario can be obtained as the description information of the initial text: the red flag. Thus, this description information is determined as the picture content of the to-be-generated bullet screen picture.

[0102] For example, the target application scenario corresponding to the initial text sent during the National Day is the National Day scenario. In the National Day scenario, the target picture content generation rule corresponding to the initial text is the picture content generation rule for the National Day scenario. In this way, when using the above picture content generation rule for the National Day scenario to determine the description information that matches the above initial text based on the above initial text, regardless of the category to which the text type of the initial text belongs, the symbols set for the National Day scenario can be obtained as the description information of the initial text as the red flag. Thus, this description information is determined as the picture content of the to-be-generated bullet screen picture.

[0103] In some cases, if there are multiple target application scenarios corresponding to the initial text, the target picture content generation rules corresponding to each target application scenario corresponding to the initial text can be used to generate the picture contents of multiple to-be-generated barrage pictures, and for each picture content, the picture content can be divided into respective sub-contents.

[0104] For example, if the target application scenarios corresponding to the initial text P include: the National Day scenario and the rap scenario, then using the picture content generation rule for the National Day scenario, based on the above initial text P, the description information matching the initial text is determined as the picture content p1 of the to-be-generated barrage picture, and the picture content p1 is divided into respective sub-contents p11. Then, using the picture content generation rule for the rap scenario, based on the above initial text P, the description information matching the initial text P is determined as the picture content p2 of the to-be-generated barrage picture, and the picture content p2 is divided into respective sub-contents p22.

[0105] Optionally, in a specific implementation manner, in the above step 1031, the step of dividing the picture content into respective sub-contents may include the following step 21:

[0106] Step 21: Perform word segmentation on the picture content that belongs to text in the description information to obtain respective sub-contents, and respectively determine each character that does not belong to text in the description information as a sub-content.

[0107] In this specific implementation manner, after the client obtains the initial text input by the user regarding the to-be-generated barrage picture, it can determine the target picture content generation rule corresponding to the above initial text based on the determined target application scenario of the initial text. In this way, the target picture content generation rule can be used to determine the description information matching the above initial text based on the above initial text as the picture content of the above to-be-generated barrage picture.

[0108] If the picture content of the to-be-generated barrage picture includes text content, word segmentation can be performed on the picture content that belongs to text in the above description information to obtain respective sub-contents, and each character that does not belong to text in the above description information is respectively determined as a sub-content.

[0109] Among them, the text content included in the picture content of the to-be-generated barrage picture may include picture content that belongs to text or picture content that does not belong to text. In this regard, the embodiments of the present invention do not make specific limitations.

[0110] For example, the initial text of the barrage picture A to be generated is "Without regret, I always have to move forward; there is a part in this story that you and I joined hands". The target application scenario of this initial text is the rap scenario. Therefore, it can be determined that the target picture content generation rule corresponding to this initial text is the picture content generation rule for rap texts. Thus, based on the above initial file, the description information matching the above initial text is determined, and the description information "Single rhyme × 1" matching the above initial text is obtained. In this way, the picture content "Single rhyme" belonging to text in the above description information can be tokenized to obtain sub - contents "Single" and "rhyme", and each character that does not belong to text in the description information, namely "×" and "1", is respectively determined as a sub - content, obtaining sub - contents "×" and "1".

[0111] It should be emphasized that the above step 21 is only an example of a way to split the above - mentioned description information provided by the embodiments of the present invention, rather than a limitation. Any way that can split the above - mentioned description information into multiple sub - contents belongs to the protection scope of the present invention.

[0112] Among them, optionally, the picture content belonging to text and the picture content not belonging to text in the description information are respectively determined as a sub - content. Thus, two sub - contents are obtained.

[0113] For example, if the description information of the initial text of the barrage picture B to be generated is "Triplet rhyme, double rhyme × 10". In this way, the picture content belonging to text and the picture content not belonging to text in the above - mentioned description information can be respectively determined as a sub - content, obtaining sub - contents "Triplet rhyme, double rhyme" and "× 10".

[0114] Optionally, the picture content belonging to text in the description information is tokenized to obtain each sub - content. The character belonging to a mathematical symbol in the description information is determined as a sub - content, and each continuous character that does not belong to text and does not belong to a mathematical symbol in the description information is determined as a sub - content.

[0115] For example, if the description information of the initial text of the barrage picture B to be generated is "Triplet rhyme, double rhyme × 10". In this way, the picture content belonging to text in the above - mentioned description information can be tokenized to obtain sub - contents "Triplet rhyme" and "double rhyme", the character belonging to a mathematical symbol in the description information is determined as a sub - content, obtaining sub - content "×", and each character that does not belong to text and does not belong to a mathematical symbol in the description information, namely "1" and "0", is determined as a sub - content, obtaining sub - content "10".

[0116] S102: Determine the picture element corresponding to each sub - content in the preset picture library.

[0117] To facilitate the client to draw bullet screen images, a preset image library for storing various image elements can be pre-set in the client.

[0118] Among them, according to the requirements for displaying bullet screen images in actual applications, each sub-content of the bullet screen images that may be displayed can be determined in advance. Thus, for each sub-content, an image element corresponding to the sub-content is pre-generated, and the generated image elements are stored in the image library pre-set in the client.

[0119] Moreover, the image elements in the preset image library can be replaced based on actual user needs. In this way, when the display style of the bullet screen image is revised, only the image elements in the preset image library need to be replaced. For example, adjusting the overall style of the bullet screen image, adjusting the display color of the image elements, etc. Thus, when using the image elements in the replaced preset image library to draw the bullet screen image, the drawing method executed is a bullet screen image drawing method provided by an embodiment of the present invention.

[0120] For example, when the bullet screen image to be generated is a bullet screen image during the broadcast of a rap program, sub-contents of text types such as "single rhyme", "double rhyme", "skipping rhyme", "rhyme" and non-text types such as "x", "0", "1" can be determined. Thus, image elements corresponding to each sub-content are generated.

[0121] In this way, after the client obtains each sub-content included in the image content of the bullet screen image to be generated, it can determine the image element corresponding to each sub-content in the above-mentioned preset image library.

[0122] In addition, in some cases, when displaying the bullet screen image, the user hopes that the image content of the displayed bullet screen image can have a corresponding background image, so as to further enrich the displayed bullet screen image and improve the interest of the bullet screen image.

[0123] Based on this, optionally, after the client obtains each sub-content included in the image content of the bullet screen image to be generated, it can further determine the background image of the bullet screen image to be generated according to the content of each sub-content.

[0124] For example, after the client obtains each sub-content included in the image content of the bullet screen image to be generated as "single rhyme", "x" and "1", it can determine the background image of the bullet screen image to be generated as a "red flame image" according to the image content "single rhyme x1" of the bullet screen image to be generated.

[0125] For another example, after the client obtains that each sub - content included in the picture content of the bullet - screen picture to be generated is "double rhyme", "skipped rhyme", "x", "1", and "0", it can determine that the background picture of the bullet - screen picture to be generated is a "blue sea picture" according to the picture content of the bullet - screen picture to be generated, which is "double rhyme skipped rhyme x10".

[0126] S103: Determine the splicing order and display rules of each picture element.

[0127] After the client determines the picture elements corresponding to each sub - content, it can determine the splicing order and display rules of each picture element.

[0128] Among them, the client can determine the order of each sub - content in the picture content of the bullet - screen picture to be generated as the splicing order of each picture element. And it can further determine the size, shape of the picture elements corresponding to each sub - content in the bullet - screen picture to be generated, as well as the spacing data and positional relationship between every two adjacent picture elements, etc. as the display rules of each picture element.

[0129] For example, the picture content of the bullet - screen picture to be generated is "skipped rhyme double rhyme ×10", where the sub - content "skipped rhyme" corresponds to picture element 1; the sub - content "double rhyme" corresponds to picture element 2; the sub - content "×" corresponds to picture element 3; the sub - content "1" corresponds to picture element 4; the sub - content "0" corresponds to picture element 5.

[0130] According to the above picture content, it can be determined that the splicing order of the above 5 sub - contents is successively the sub - content "skipped rhyme", the sub - content "double rhyme", the sub - content "×", the sub - content "1", and the sub - content "0". Thus, it can be determined that the splicing order of the above 5 picture elements is successively picture element 1, picture element 2, picture element 3, picture element 4, and picture element 5.

[0131] Optionally, the size of each picture element, as well as the spacing data between every two adjacent picture elements, etc. may be different. Therefore, in order to improve the display effect of the bullet - screen picture to be generated, the size of each picture element and the spacing data between every two adjacent picture elements, etc. can be adjusted and unified, so as to determine the display rules of each picture element.

[0132] Optionally, using the View component of the Android system, through code or xml files, the size of each picture element and the spacing data between every two adjacent picture elements, etc. are adjusted and unified, so as to determine the display rules of each picture element.

[0133] S104: Based on the splicing order and display rules, call the preset drawing method to perform bitmap drawing on each picture element to obtain the bullet - screen picture to be generated.

[0134] When the client displays the barrage image, the image format of the displayed image is a bitmap. Therefore, after determining the splicing order and display rules of each image element, a preset drawing method can be called to perform bitmap drawing on each image element, so that the above-mentioned barrage image to be generated can be obtained.

[0135] Optionally, the above-mentioned preset drawing method may include: calculating the bitmap size of the barrage image to be generated, calculating the display position of each image element in the barrage image to be generated, and drawing the above-mentioned barrage image to be generated by using the determined splicing order and display rules.

[0136] For example, after using the View of the Android system to determine the splicing order and display rules of each image element, the onMeasure, onLayout, and onDraw methods of the View component can be used to complete the drawing of the View and obtain the barrage image to be generated.

[0137] After the client obtains the barrage image to be generated, the generated barrage image to be generated can be output and displayed on the screen of the file to be played corresponding to the barrage image to be generated.

[0138] Optionally, in the case where the background image of the barrage image to be generated is determined, when calling the preset drawing method to perform bitmap drawing on each image element based on the splicing order and display rules, the above-mentioned preset drawing method can be called simultaneously to perform bitmap drawing on the background image, so that the bitmap of the obtained background image can be used as the background of the bitmaps of each image element for display.

[0139] Optionally, in a specific implementation manner, a method for drawing a barrage image provided by an embodiment of the present invention may include the following step 105:

[0140] Step 105: Output the barrage image to be generated.

[0141] In this specific implementation manner, after obtaining the barrage image to be generated, the barrage image to be generated can be output. For example, the above-mentioned barrage image to be generated is displayed in the client interface.

[0142] In some cases, as mentioned above, the image content of the barrage image is determined based on the initial text of the barrage input by the user. Therefore, when the client displays the barrage image to be generated, the target text for determining the image content of the barrage image to be generated can be displayed simultaneously.

[0143] Based on this, optionally, in a specific implementation manner, the above-mentioned step 105 may include the following step 1051:

[0144] Step 1051: Display the barrage image and the target text for determining the text content according to the preset positional relationship.

[0145] In this specific implementation, the client can display the above barrage image and the target text for determining the text content of the above barrage image according to the preset positional relationship.

[0146] Optionally, the display position of the above barrage image can be any display position associated with the above target text.

[0147] For example, the display position of the above barrage image can be after the display position of the above target text.

[0148] Exemplarily, as Figure 2 shown, the display position of the barrage image 202 is after the display position of the target text 201.

[0149] If each sub - content included in the image content of the barrage image to be generated obtained by the client is based on the initial text input by the user regarding the barrage image to be generated, then when the client outputs the barrage image, it can send each sub - content included in the image content of the barrage image to the preset server, so that the preset server stores each sub - content included in the image content of the barrage image, and when the client redraws the barrage image, it can directly obtain each sub - content included in the image content of the barrage image, thereby improving the drawing efficiency of the barrage image.

[0150] Optionally, a specific implementation, as Figure 3 shown, is a schematic flowchart of a method for drawing a barrage image provided by an embodiment of the present invention. The method for drawing a barrage image provided by an embodiment of the present invention may include the following steps S301 - S306:

[0151] S301: Obtain the initial text input by the user regarding the barrage image to be generated;

[0152] S302: Generate the image content of the barrage image to be generated according to the initial text, and divide the image content into each sub - content;

[0153] S303: Determine the image element corresponding to each sub - content in the preset image library;

[0154] S304: Determine the splicing order and display rules of each image element;

[0155] S305: Based on the splicing order and display rules, call the preset drawing method to perform bitmap drawing on each image element to obtain the barrage image to be generated;

[0156] S306: Send each sub - content to the preset server.

[0157] Among them, the specific implementation manners of the above-mentioned step S301 and the above-mentioned step 1012 are the same, the specific implementation manners of the above-mentioned step S302 and the above-mentioned step 1013 are the same, the specific implementation manners of the above-mentioned step S303 and the above-mentioned step S102 are the same, the specific implementation manners of the above-mentioned step S304 and the above-mentioned step S103 are the same, the specific implementation manners of the above-mentioned step S305 and the above-mentioned step S104 are the same, and will not be elaborated herein.

[0158] In this specific implementation manner, the client can obtain the initial text input by the user regarding the barrage picture to be generated. Thus, the picture content of the barrage picture to be generated can be generated according to the above initial text. In this way, the above picture content can be divided to obtain each sub-content included in the above picture content.

[0159] After the client obtains each sub-content included in the picture content of the barrage picture to be generated, it can determine the picture element corresponding to each sub-content in the above preset picture library. Thus, the splicing order and display rules of each picture element can be determined. Then, based on the above splicing order and the above display rules, the preset drawing method is called to perform bitmap drawing on each picture element. Thus, the above barrage picture to be generated is obtained.

[0160] Since the barrage pictures displayed in the client can include the barrage pictures corresponding to the initial texts of each barrage sent by different users at different times, and the server providing services for the client can store the initial texts of the above barrages. Thus, when displaying the barrage pictures corresponding to the initial texts of each barrage, for the barrages sent by the user at the current moment, the above server can determine each sub-content included in the picture content of the barrage pictures of the initial texts of each barrage stored, and send each sub-content to the client so that the client can draw the barrage pictures corresponding to the initial texts of each barrage. Therefore, after obtaining the barrage picture to be generated, each of the above sub-contents can be sent to the preset server.

[0161] For example, the picture content of the barrage picture A to be generated is "Single rhyme × 1". The sub-contents of the barrage picture A to be generated include: sub-content "Single rhyme", sub-content "×", and sub-content "1". Therefore, when outputting the barrage picture A to be generated, the sub-content "Single rhyme", the sub-content "×", and the sub-content "1" can be sent to the preset server.

[0162] As can be seen above, when applying the solution provided by the embodiments of the present invention to draw a bullet screen picture, the client can obtain each sub-content included in the picture content of the bullet screen picture to be generated. Thus, in the preset picture library, the picture element corresponding to each sub-content can be determined. Then, the splicing order and display rules of each picture element can be determined. Furthermore, based on the above splicing order and the above display rules, a preset drawing method is called to perform bitmap drawing on the above picture elements to obtain the bullet screen picture to be generated.

[0163] Based on this, when applying the solution provided by the embodiments of the present invention, a preset picture library storing multiple picture elements can be pre-set in the client. Thus, when generating a bullet screen picture, the picture element corresponding to each sub-content included in the picture content of the bullet screen picture can be determined from the above preset picture library to complete the drawing of the bullet screen picture, without the need to draw the bullet screen picture by means of manual slicing. Therefore, the drawing efficiency of the bullet screen picture can be improved.

[0164] Corresponding to the bullet screen picture drawing method provided by the embodiments of the present invention, the embodiments of the present invention also provide a bullet screen picture drawing device, which is applied to the client.

[0165] Figure 4 The structural schematic diagram of a bullet screen picture drawing device provided by the embodiments of the present invention is as Figure 4 shown, and the device includes the following modules:

[0166] The sub-content obtaining module 410 is used to obtain each sub-content included in the picture content of the bullet screen picture to be generated;

[0167] The picture element determining module 420 is used to determine the picture element corresponding to each sub-content in the preset picture library;

[0168] The determining module 430 is used to determine the splicing order and display rules of each picture element;

[0169] The drawing module 440 is used to perform bitmap drawing on the above picture elements based on the splicing order and the display rules, and call a preset drawing method to obtain the bullet screen picture to be generated.

[0170] As can be seen above, when applying the solution provided by the embodiments of the present invention to draw a bullet screen picture, the client can obtain each sub-content included in the picture content of the bullet screen picture to be generated. Thus, in the preset picture library, the picture element corresponding to each sub-content can be determined. Then, the splicing order and display rules of each picture element can be determined. Furthermore, based on the above splicing order and the above display rules, a preset drawing method is called to perform bitmap drawing on the above picture elements to obtain the bullet screen picture to be generated.

[0171] Based on this, by applying the solution provided in the embodiments of the present invention, a preset picture library storing multiple picture elements can be preset in the client. Thus, when generating a bullet screen picture, the picture elements corresponding to each sub - content included in the picture content of the bullet screen picture can be determined from the above - mentioned preset picture library to complete the drawing of the bullet screen picture, without the need to draw the bullet screen picture by manual picture cutting. Therefore, the drawing efficiency of the bullet screen picture can be improved.

[0172] Optionally, in a specific implementation manner, the device further includes:

[0173] A bullet screen picture output module, configured to output the bullet screen picture to be generated.

[0174] Optionally, in a specific implementation manner, the bullet screen picture output module is specifically configured to:

[0175] Display the bullet screen picture and the target text for determining the picture content according to a preset positional relationship.

[0176] Optionally, in a specific implementation manner, the sub - content acquisition module 410 includes:

[0177] A first sub - content acquisition sub - module, configured to receive each sub - content included in the picture content of the bullet screen picture to be generated sent by a preset server;

[0178] Or,

[0179] A second sub - content acquisition sub - module, configured to acquire an initial text input by a user regarding the bullet screen picture to be generated; generate the picture content of the bullet screen picture to be generated according to the initial text, and divide the picture content into each sub - content.

[0180] Optionally, in a specific implementation manner, the second sub - content acquisition sub - module includes:

[0181] A rule determination sub - module, configured to determine a target picture content generation rule corresponding to the target application scenario of the initial text;

[0182] A picture content generation sub - module, configured to use the target picture content generation rule to determine, based on the text content of the initial text, description information matching the initial text as the picture content of the bullet screen picture to be generated.

[0183] Optionally, in a specific implementation manner, the second sub - content acquisition sub - module is specifically configured to:

[0184] Perform word segmentation processing on the picture content belonging to text in the description information to obtain each sub - content, and respectively determine each character that does not belong to text in the description information as a sub - content.

[0185] Optionally, in a specific implementation, the apparatus further includes:

[0186] A sub-content sending module, configured to send each sub-content to a preset server when each sub-content is obtained based on the initial text.

[0187] Corresponding to the barrage image drawing method provided in the foregoing embodiments of the present invention, embodiments of the present invention further provide an electronic device, as Figure 5 shown, including a processor 501, a communication interface 502, a memory 503, and a communication bus 504. Among them, the processor 501, the communication interface 502, and the memory 503 complete communication with each other through the communication bus 504.

[0188] The memory 503 is used to store a computer program.

[0189] The processor 501, when executing the program stored on the memory 503, implements the steps of any of the barrage image drawing methods provided in the foregoing embodiments of the present invention.

[0190] The communication bus mentioned in the foregoing terminal may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. This communication bus can be divided into an address bus, a data bus, a control bus, etc. For the sake of simplicity, only a thick line is shown in the figure, but it does not mean that there is only one bus or one type of bus.

[0191] The communication interface is used for communication between the foregoing terminal and other devices.

[0192] The memory may include a Random Access Memory (RAM), and may also include a non-volatile memory, such as at least one disk memory. Optionally, the memory may also be at least one storage device located far from the foregoing processor.

[0193] The above-mentioned processor may be a general-purpose processor, including a Central Processing Unit (CPU for short), a Network Processor (NP for short), etc.; it may also be a Digital Signal Processor (DSP for short), an Application Specific Integrated Circuit (ASIC for short), a Field-Programmable Gate Array (FPGA for short), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.

[0194] In another embodiment provided by the present invention, there is also provided a computer-readable storage medium, in which a computer program is stored, and when the computer program is executed by a processor, the method for drawing bullet screen pictures described in any one of the above embodiments is implemented.

[0195] In another embodiment provided by the present invention, there is also provided a computer program product containing instructions, which when running on a computer, causes the computer to execute the method for drawing bullet screen pictures described in any one of the above embodiments.

[0196] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented using software, it can 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 the computer program instructions are loaded and executed on a computer, the processes or functions described in the embodiments of the present invention are generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center in a wired manner (such as coaxial cable, optical fiber, Digital Subscriber Line (DSL)) or a wireless manner (such as infrared, wireless, microwave, etc.). The computer-readable storage medium may be any available medium that can be accessed by a computer, or a data storage device such as a server or a data center that includes one or more integrated available media. The available medium may be a magnetic medium (such as a floppy disk, a hard disk, a magnetic tape), an optical medium (such as a DVD), or a semiconductor medium (such as a Solid State Disk (SSD)).

[0197] It should be noted that in this text, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "comprising", "including" or any other variant thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device comprising a series of elements not only includes those elements, but also includes other elements not expressly listed, or further includes elements inherent to such process, method, article or device. Without further limitation, an element defined by the statement "comprising an..." does not exclude the presence of additional identical elements in the process, method, article or device comprising the said element.

[0198] Each embodiment in this specification is described in a related manner. For the same or similar parts among the embodiments, reference can be made to each other. Each embodiment focuses on the differences from other embodiments. In particular, for the device embodiments, electronic device embodiments, computer-readable storage medium embodiments and computer program product embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and reference can be made to the partial description of the method embodiments for the relevant parts.

[0199] The above description is only a preferred embodiment of the present invention and is not intended to limit the protection scope of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention are all included in the protection scope of the present invention.

Claims

1. A method for drawing a bullet screen picture, characterized in that, Applied to a client, the method includes: Obtaining each sub - content included in the picture content of the bullet - screen picture to be generated; Determining, in a preset picture library, the picture element corresponding to each sub - content; wherein, the preset picture library is a picture library for storing various picture elements, and each picture element in the preset picture library is a picture element pre - generated for a sub - content; Determining the splicing order and display rules of each picture element; Based on the splicing order and the display rules, calling a preset drawing method to perform bitmap drawing on each picture element to obtain the bullet - screen picture to be generated; Among them, the obtaining each sub - content included in the picture content of the bullet - screen picture to be generated includes: Receiving each sub - content included in the picture content of the bullet - screen picture to be generated sent by a preset server; Or, Obtaining the initial text input by the user regarding the bullet - screen picture to be generated; according to the initial text, generating the picture content of the bullet - screen picture to be generated, and dividing the picture content into each sub - content.

2. The method according to claim 1, wherein The method further includes: Outputting the bullet - screen picture to be generated.

3. The method according to claim 2, wherein The outputting the bullet - screen picture to be generated includes: Displaying the bullet - screen picture and the target text for determining the picture content according to a preset positional relationship.

4. The method according to claim 1, wherein The generating the picture content of the bullet - screen picture to be generated according to the initial text includes: Determining the target picture content generation rule corresponding to the target application scenario of the initial text; Using the target picture content generation rule, based on the text content of the initial text, determining the description information matching the initial text as the picture content of the bullet - screen picture to be generated.

5. The method according to claim 4, characterized in that, The dividing the picture content into each sub - content includes: Performing word - segmentation processing on the picture content belonging to text in the description information to obtain each sub - content, and respectively determining each character that does not belong to text in the description information as a sub - content.

6. The method according to claim 1, characterized in that, When each sub - content is obtained based on the initial text, the method further includes: Sending each sub - content to a preset server.

7. A barrage picture drawing device, characterized in that, Applied to a client, the device includes: A sub - content obtaining module, configured to obtain each sub - content included in the picture content of the bullet - screen picture to be generated; A picture - element determining module, configured to determine, in a preset picture library, the picture element corresponding to each sub - content; wherein, the preset picture library is a picture library for storing various picture elements, and each picture element in the preset picture library is a picture element pre - generated for a sub - content; A determining module, configured to determine the splicing order and display rules of each picture element; A drawing module, configured to, based on the splicing order and the display rules, call a preset drawing method to perform bitmap drawing on each picture element to obtain the bullet - screen picture to be generated; Among them, the sub - content obtaining module includes: A first sub - content obtaining sub - module, configured to receive each sub - content included in the picture content of the bullet - screen picture to be generated sent by a preset server; Or, The second sub-content acquisition sub-module is used to obtain the initial text input by the user regarding the barrage picture to be generated; according to the initial text, generate the picture content of the barrage picture to be generated, and divide the picture content into each sub-content.

8. An electronic device, characterized in that, It includes a processor, a communication interface, a memory, and a communication bus. Among them, the processor, the communication interface, and the memory complete mutual communication through the communication bus; The memory is used to store computer programs; The processor is used to implement the method steps described in any one of claims 1-6 when executing the programs stored on the memory.

9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, and when the computer program is executed by the processor, it implements the method steps described in any one of claims 1-6.

Citation Information

Patent Citations

  • Display method of picture barrage

    CN104703018A

  • Bullet screen information processing method and device

    CN106210849A