CN107230241B - Image-text mixed arrangement implementation method and device - Google Patents

Image-text mixed arrangement implementation method and device Download PDF

Info

Publication number
CN107230241B
CN107230241B CN201710515433.4A CN201710515433A CN107230241B CN 107230241 B CN107230241 B CN 107230241B CN 201710515433 A CN201710515433 A CN 201710515433A CN 107230241 B CN107230241 B CN 107230241B
Authority
CN
China
Prior art keywords
text
picture
height
width
remaining
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201710515433.4A
Other languages
Chinese (zh)
Other versions
CN107230241A (en
Inventor
霍启圣
张文明
陈少杰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Yami Technology Guangzhou Co ltd
Original Assignee
Wuhan Douyu Network Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Wuhan Douyu Network Technology Co Ltd filed Critical Wuhan Douyu Network Technology Co Ltd
Priority to CN201710515433.4A priority Critical patent/CN107230241B/en
Publication of CN107230241A publication Critical patent/CN107230241A/en
Application granted granted Critical
Publication of CN107230241B publication Critical patent/CN107230241B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T11/002D [Two Dimensional] image generation
    • G06T11/60Editing figures and text; Combining figures or text

Landscapes

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

Abstract

The invention relates to the technical field of Internet, in particular to a method and a device for realizing mixed arrangement of pictures and texts, wherein the method and the device for realizing mixed arrangement of the pictures and the texts are applied to electronic equipment. In the invention, the picture and the text are defined as independent elements to respectively obtain the picture and the text, and the automatic line feed of the picture and the text is realized simultaneously to realize the function of mixed arrangement of pictures and texts, so that the system is simple to operate, and the system operation time is saved.

Description

Image-text mixed arrangement implementation method and device
Technical Field
The invention relates to the technical field of internet, in particular to a method and a device for realizing mixed arrangement of pictures and texts.
Background
In the current system, a TextView tool is provided, which can realize mixed arrangement of pictures and texts to a certain extent by using a compound text constructor SpannablestringBuilder, but the texttool is mainly used for displaying pure texts and has a limited realization degree of mixed arrangement of the pictures and the texts. The text tool is mainly used for realizing mixed arrangement of the pictures and the texts, the text placeholder is used for occupying the picture needing to be inserted into the position, the picture needing to be actually inserted is assigned to the defined picture element, the position occupied by the text placeholder is read, the picture element is inserted into the corresponding position, and mixed arrangement of the pictures and the texts is further realized. Thus, the text tool essentially treats all content as a unique string of text, but replaces text placeholders with images, and the more images in the text that are mixed up, the more images that need to be replaced, and thus is time consuming. Therefore, it is necessary to provide a method for implementing mixed graphics and text arrangement.
Disclosure of Invention
The invention aims to provide a method for realizing mixed arrangement of pictures and texts, which is used for realizing simultaneous output of pictures and texts, and simultaneously has the advantages of simple system operation and saving of system operation time.
Another objective of the present invention is to provide a device for implementing mixed arrangement of graphics and texts, so as to implement simultaneous output of pictures and texts, and simultaneously, the system is simple to operate, and the system operation time is saved.
In order to achieve the above purpose, the embodiment of the present invention adopts the following technical solutions:
in a first aspect, an embodiment of the present invention provides a method for implementing mixed arrangement of images and texts, which is applied to an electronic device, and the method includes:
creating mutually independent picture elements and text elements;
obtaining a picture through the assigned picture address in the picture element;
assigning the text content through the text element to obtain a text;
sequentially drawing the acquired picture and the acquired text on a canvas of the electronic equipment;
and when the total width occupied by the picture and the text exceeds the width of the screen of the electronic equipment, the lines are changed so as to be conveniently displayed on the screen of the electronic equipment for a user to check.
In a second aspect, an embodiment of the present invention further provides an apparatus for implementing mixed image-text arrangement, which is applied to an electronic device, and the apparatus includes:
the creating module is used for creating independent picture elements and text elements;
the first acquisition module is used for acquiring the picture through the assigned picture address in the picture element;
the second acquisition module is used for assigning the text content through the text element to acquire the text;
the drawing module is used for drawing the acquired picture and the acquired text on a canvas of the electronic equipment in sequence;
and the line feed module is used for feeding lines when the total width occupied by the picture and the text exceeds the width of the screen of the electronic equipment, so that the lines can be conveniently displayed on the screen of the electronic equipment for a user to check.
The method for realizing the mixed arrangement of the images and the texts comprises the steps of creating independent picture elements and text elements, obtaining pictures through picture addresses assigned in the picture elements, obtaining texts through text contents assigned by the text elements, drawing the obtained pictures and the obtained texts on canvas of the electronic equipment in sequence, and changing lines when the total width occupied by the pictures and the texts exceeds the screen width of the electronic equipment so as to be conveniently displayed on the screen of the electronic equipment for a user to view. In the invention, the picture and the text are defined as independent elements to respectively obtain the picture and the text, and the automatic line feed of the picture and the text is realized simultaneously to realize the function of mixed arrangement of pictures and texts, so that the system is simple to operate, and the system operation time is saved.
In order to make the aforementioned and other objects, features and advantages of the present invention comprehensible, preferred embodiments accompanied with figures are described in detail below.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the embodiments will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present invention and therefore should not be considered as limiting the scope, and for those skilled in the art, other related drawings can be obtained according to the drawings without inventive efforts.
Fig. 1 shows a schematic flow chart of a method for implementing mixed arrangement of images and texts according to an embodiment of the present invention.
Fig. 2 is a flowchart illustrating sub-steps of a method for implementing mixed graphics and text according to an embodiment of the present invention.
Fig. 3 is a flowchart illustrating another sub-step of a method for implementing mixed-text arrangement according to an embodiment of the present invention.
Fig. 4 is a schematic diagram illustrating an example of practical application of a method for implementing mixed image-text arrangement according to an embodiment of the present invention.
Fig. 5 is a schematic diagram illustrating another practical application of the image-text mixed arrangement implementation method according to the embodiment of the present invention.
Fig. 6 is a schematic diagram illustrating functional modules of an image-text mixed arrangement implementation apparatus according to an embodiment of the present invention.
The figure is as follows: 100-picture and text mixed arrangement realizing device; 110-a creation module; 120-a first acquisition module; 130-a second acquisition module; 140-a drawing module; 150-line feed module; 160-a first recording module; 170-second recording module.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. The components of embodiments of the present invention generally described and illustrated in the figures herein may be arranged and designed in a wide variety of different configurations. Thus, the following detailed description of the embodiments of the present invention, presented in the figures, is not intended to limit the scope of the invention, as claimed, but is merely representative of selected embodiments of the invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments of the present invention without making any creative effort, shall fall within the protection scope of the present invention.
It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, it need not be further defined and explained in subsequent figures. Meanwhile, in the description of the present invention, the terms "first", "second", and the like are used only for distinguishing the description, and are not to be construed as indicating or implying relative importance.
In the prior art, a TextView text tool is usually used for realizing some text shuffling, but the TextView text tool mainly displays pure text and has a limited realization degree on the text shuffling. The method for realizing image-text mixed arrangement by using the textView text tool mainly comprises the following steps: creating a compound text constructor SpannablestringBuilder, and using the compound text constructor to assign the text content to be' the text content is the text and the picture in a picture and text mixed and arranged message [ image ] message, wherein [ image ] is used for occupying the picture to be inserted, and simultaneously determining the position of [ image ] in the whole text, such as the starting position is 10, and the ending position is 17. And then, creating a picture element ImageSpan, assigning a picture to be inserted to the picture element ImageSpan, assigning the picture element ImageSpan to the compound text constructor, and specifying the position of the picture element ImageSpan as the position of [ image ] in the whole text, namely, the starting position is 10, and the ending position is 17. In other words, [ image ] is used for occupying the whole text for the picture element ImageSpan, and the picture element ImageSpan assigns a picture and then places the picture in the occupied position, thereby realizing the simultaneous output of the picture and the text. Therefore, essentially, only text output can be realized by the textView text tool, and simultaneously, pictures and texts are output in the mode, which is long in time consumption.
Therefore, the embodiment of the invention provides a method for realizing mixed arrangement of pictures and texts, which realizes simultaneous output of pictures and texts by defining independent picture elements and text elements in a ChatView control, and can realize automatic line feed of the pictures and the texts at the same time, so as to greatly improve the running time of a system.
The method and the device for realizing mixed arrangement of the images and the texts provided by the embodiment of the invention are applied to electronic equipment, and the electronic equipment can be, but is not limited to, electronic equipment such as a computer or a mobile phone.
Fig. 1 is a schematic flow chart of a method for implementing mixed text-image arrangement according to an embodiment of the present invention, where the method includes:
in step S110, a picture element and a text element are created independently of each other.
The invention defines two mutually independent elements, namely DrawableElement and TextElement, wherein DrawableElement is a picture element, and TextElement is a text element.
And step S120, obtaining the picture through the assigned picture address in the picture element.
And after the picture address is assigned to the picture element, the electronic equipment acquires the picture through the picture address. As assigning a path of a picture to a picture element through drawable. Getdrawable () loads a picture specifying an ID as well. After the electronic equipment obtains the picture, the width and the height of the loaded picture are obtained and stored through a getIntrinsicWidth () method and a getIntrinsicHeight () method.
In step S130, the text content is assigned by the text element to obtain the text.
The text is obtained by assigning the text content to the text element TextElement.
And step S140, drawing the acquired picture and the acquired text on a canvas of the electronic equipment in sequence.
Fig. 2 is a schematic flow chart of a substep S140 of a method for implementing mixed image-text arrangement according to an embodiment of the present invention, where the substep S140 includes:
step S141, the heights of the picture and the text are obtained.
The picture obtained by the picture element and the text obtained by the text element both have a certain height, and therefore, the height of each picture and the height of each text are obtained.
In step S142, if the height of the picture or the text to be drawn on the canvas of the electronic device is less than the line height of the current line of the picture and the text, the canvas is moved by a preset distance so that the picture and the text are centered in the vertical direction of the current line.
The calculation method of the current line height is as follows: recording the height of the previous data drawn on the canvas by the current line, wherein the previous data can be a picture or a text, comparing the height of the current data drawn on the canvas with the height of the previous data, the current data can be a picture or a text, if the height of the current data is higher than that of the previous data, the height of the current data is the height of the current line, and if the height of the current data is lower than or equal to that of the previous data, the height of the previous data is the height of the current line.
Due to the inconsistent height of the data (pictures or texts) drawn on the canvas, when the height of the pictures or texts drawn on the canvas is less than the height of the current line, the canvas is moved downwards by a preset distance, so that the pictures or texts drawn on the canvas are always in a vertically central position on the current line. The preset distance is the difference value of the height of the current line minus the height of the picture or text drawn in real time, and half of the difference value is taken as the preset distance. And when the next picture or text relative to the picture and the text needs to be drawn, moving the canvas up by the preset distance so that the next drawn picture or text can be drawn normally.
And S150, when the total width occupied by the picture and the text exceeds the width of the screen of the electronic equipment, changing lines so as to be conveniently displayed on the screen of the electronic equipment for a user to check.
Fig. 3 is a schematic flow chart illustrating a sub-step of step S150 of a method for implementing mixed image-text arrangement according to an embodiment of the present invention, where the step S150 includes:
and step S151, obtaining the individual widths of the picture and the text, and calculating the actual occupied widths of the picture and the text in the current line according to the individual widths of the picture and the text.
The picture obtained by the picture element and the text obtained by the text element both have a certain width, so that the individual width of each picture and each text is obtained.
And calculating the actual occupied width of all the pictures and texts in the current line according to the number of the pictures and texts in the current line and the individual width of each picture and each text.
Step S152, calculating and calculating the width of the residual screen according to the width actually occupied by the picture and the text on the current line.
And calculating the residual screen width of the current line according to the screen width of the electronic equipment and the actual occupied width of the picture and the text in the current line.
Step S153, acquiring total characters of the text to be input.
All the text quantities obtained by the text elements are calculated and stored.
Step S154, a truncation function is called to calculate the number of remaining total characters that can be accommodated by the remaining screen width according to the truncation position of the total character and the remaining screen width, where the number of remaining total characters is the number of characters counted by the total character from the truncation position.
Fig. 4 is a schematic diagram illustrating an example of practical application of the image-text mixed arrangement implementation method according to the embodiment of the present invention. Such as: all text contents needing to be input are acquired through the text elements, namely, an image-text mixed message which has characters and pictures, when the character information is too long, line feed can be automatically cut off, and all the pictures needing to be input, namely, a ball, an airplane, a magnifying glass, a mobile phone and a lock chain, which are shown in the figure, are acquired through the picture elements.
The picture and the characters displayed in the picture are divided into two lines, the sum of the widths of the characters in the first line, namely a text-text mixed message, the width of the message of the existing characters and the width of the picture, namely the sphere, is equal to the width of the screen, the character content is cut off from the position of the picture in the message of the existing characters and the picture, the position is a cut-off position, the rest of the character content is displayed in the next line by automatically cutting off and changing lines when the character message is too long, and the character quantity of the rest of the character content is the character quantity of the total characters calculated from the cut-off position, namely the quantity of the rest of the total characters.
In the second line, a plurality of pictures, such as an airplane, a magnifier, a mobile phone and a chain, are drawn in sequence, the pictures occupy a certain screen width, and then a truncation function is called to calculate the number of the remaining characters which can be contained in the remaining screen broadband according to the truncation position of the total characters and the remaining screen width, namely, the number of the characters in the line which can be automatically truncated and changed when the character information is too long can be contained in the remaining screen width of the line. Meanwhile, as shown in the figure, the heights of the pictures and the characters and the height of the current row are always compared in real time in the drawing process of the characters and the pictures to ensure that the pictures and the characters are positioned at the vertical central position of the current row, and then the characters and the pictures show the effect of central level.
Step S155, if the number of remaining total characters that can be actually accommodated by the remaining screen width is smaller than the number of remaining total characters, the width occupied by the picture and the text exceeds the screen width of the electronic device.
If the number of characters that can be actually accommodated by the remaining screen width is smaller than the number of the remaining characters, that is, smaller than the number of characters in "when the text message is too long, the line feed can be automatically truncated", which indicates that the width occupied by the picture and the text of the current line will exceed the screen width of the electronic device, and the line feed is required, so that the user can enjoy a better display effect. Fig. 5 is a schematic diagram illustrating an example of a practical application of another image-text mixed arrangement implementation method according to an embodiment of the present invention. The "truncated line feed" character is automatically displayed in the next line because it cannot be accommodated by the remaining screen width of the current line.
In addition, the electronic equipment stores the number of characters actually contained in the remaining screen width of the current line and the next truncation position of the characters, so as to judge whether the remaining character amount can be contained in the screen width of the next line. Meanwhile, the electronic equipment also records the actual occupied width of the picture and the text of the current line, so that when the picture or the text of the next line is drawn on the canvas, the canvas can be moved to the left by the actual occupied width of the picture or the text of the previous line, and the picture or the text of the next line is drawn conveniently.
Fig. 6 is a schematic diagram of functional modules of an apparatus 100 for implementing mixed-text arrangement according to an embodiment of the present invention, where the apparatus 100 includes a creating module 110, a first obtaining module 120, a second obtaining module 130, a drawing module 140, a line feed module 150, a first recording module 160, and a second recording module 170, where:
a creating module 110 for creating independent picture elements and text elements.
In the embodiment of the present invention, step S110 may be performed by the creation module 110.
The first obtaining module 120 is configured to obtain a picture according to the assigned picture address in the picture element.
In the embodiment of the present invention, step S120 may be performed by the first obtaining module 120.
And a second obtaining module 130, configured to assign a value to the text content through the text element to obtain the text.
In the embodiment of the present invention, step S130 may be performed by the second obtaining module 130.
And the drawing module 140 is configured to draw the acquired picture and the acquired text on a canvas of the electronic device in sequence.
In the embodiment of the present invention, steps S140 to S142 may be performed by the rendering module 140.
And the line feed module 150 is configured to feed lines when the total width occupied by the picture and the text exceeds the screen width of the electronic device, so as to be conveniently displayed on the screen of the electronic device for a user to view.
In the embodiment of the present invention, steps S150 to S155 may be performed by the linefeed module 150.
The first recording module 160 is configured to record the number of remaining total characters actually accommodated by the remaining screen width and a next truncation position of the total characters, where the next truncation position is a position where the number of the remaining total characters is calculated from the number of remaining total characters accommodated by the remaining screen width.
And the second recording module 170 is configured to record a width actually occupied by the picture and the text of the current line.
Since the detailed description is already given in the text-mixing implementation method section, no further description is given here.
In summary, embodiments of the present invention provide a method and an apparatus for implementing mixed-typesetting of images and texts, where the method and the apparatus are applied to an electronic device, the method includes creating a picture element and a text element that are independent of each other, obtaining a picture by a picture address assigned in the picture element, obtaining a text by assigning a text content by the text element, and if a height of the picture or the text to be drawn on a canvas of the electronic device is less than a height of a current line of the picture or the text, moving the canvas by a preset distance so that the picture or the text is centered in a vertical direction of the current line, and simultaneously, when a total width occupied by the picture and the text exceeds a screen width of the electronic device, changing the line so that the screen displayed on the electronic device is convenient for a user to view. The invention realizes the simultaneous output of the pictures and the texts and saves the running time of the system.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus and method can be implemented in other ways. The apparatus embodiments described above are merely illustrative, and for example, the flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
In addition, the functional modules in the embodiments of the present invention may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.
The functions, if implemented in the form of software functional modules and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention. It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, it need not be further defined and explained in subsequent figures.
The above description is only for the specific embodiments of the present invention, but the scope of the present invention is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present invention, and all the changes or substitutions should be covered within the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims (8)

1. A method for realizing mixed arrangement of pictures and texts is applied to electronic equipment, and is characterized by comprising the following steps:
creating mutually independent picture elements and text elements;
obtaining a picture through the assigned picture address in the picture element;
assigning the text content through the text element to obtain a text;
acquiring the heights of the picture and the text, wherein the width and the height of the loaded picture are acquired and stored by a getIntrinsicWidth () method and a getIntrinsicHeight () method;
if the height of the picture or the text to be drawn on a canvas of the electronic equipment is less than the height of the current line of the picture and the text, moving the canvas by a preset distance so that the picture or the text is in a central position in the vertical direction of the current line;
and when the total width occupied by the picture and the text exceeds the width of the screen of the electronic equipment, the lines are changed so as to be conveniently displayed on the screen of the electronic equipment for a user to check.
2. The teletext mixed-line implementation method of claim 1, wherein the line height of the current line of the picture and the text is measured in the following way:
recording the height of previous data drawn on the canvas, wherein the data comprises the picture or the text, comparing the height of current data drawn on the canvas with the height of the previous data, if the height of the current data is higher than the height of the previous data, the height of the current data is used as the line height of the current line, and if the height of the current data is lower than or equal to the height of the previous data, the height of the previous data is used as the line height of the current line.
3. The method for realizing mixed arrangement of pictures and texts as claimed in claim 1, wherein when the width occupied by the picture and the text exceeds the width of the screen of the electronic device, the step of line feed comprises:
acquiring the individual widths of the picture and the text, and calculating the actual occupied widths of the picture, the picture and the text in the current line according to the individual widths of the picture and the text;
calculating the width of the residual screen according to the actual occupied width of the picture and the text in the current line;
acquiring total characters of the text needing to be input;
calling a truncation function to calculate the number of the remaining total characters which can be contained in the remaining screen width according to the truncation position of the total characters and the remaining screen width, wherein the number of the remaining total characters is the number of the characters counted by the total characters from the truncation position;
and if the number of the remaining total characters which can be actually contained in the remaining screen width is smaller than the number of the remaining total characters, the width occupied by the picture and the text exceeds the screen width of the electronic equipment.
4. The method for implementing teletext according to claim 3, wherein the method further comprises:
recording the number of the remaining total characters actually contained by the remaining screen width and the next truncation position of the total characters, wherein the next truncation position is a position at which the number of the remaining total characters is calculated from the number of the remaining total characters contained by the remaining screen width;
recording the width actually occupied by the picture and the text of the current line.
5. A picture and text mixed arrangement realizing device is applied to electronic equipment and is characterized by comprising the following components:
the creating module is used for creating independent picture elements and text elements;
the first acquisition module is used for acquiring the picture through the assigned picture address in the picture element;
the second acquisition module is used for assigning the text content through the text element to acquire the text;
a drawing module, configured to obtain heights of the picture and the text, where a width and a height of a loaded picture are obtained and stored by using getIntrinsicWidth () and getIntrinsicHeight () methods, and if a height of the picture or the text to be drawn on a canvas of the electronic device is less than a line height of a current line of the picture and the text, the canvas is moved by a preset distance so that the picture or the text is at a centered position in a vertical direction of the current line;
and the line feed module is used for feeding lines when the total width occupied by the picture and the text exceeds the width of the screen of the electronic equipment, so that the lines can be conveniently displayed on the screen of the electronic equipment for a user to check.
6. The teletext mixed arrangement implementation device of claim 5, wherein the line height of the current line of the picture and the text is measured in the following way:
recording the height of previous data drawn on the canvas, wherein the data comprises the picture or the text, comparing the height of current data drawn on the canvas with the height of the previous data, if the height of the current data is higher than the height of the previous data, the height of the current data is used as the line height of the current line, and if the height of the current data is lower than or equal to the height of the previous data, the height of the previous data is used as the line height of the current line.
7. The apparatus for implementing teletext according to claim 5, wherein the line feed module is further configured to:
acquiring the individual widths of the picture and the text, and calculating the actual occupied widths of the picture and the text in the current line according to the individual widths of the picture and the text;
calculating the width of the residual screen according to the actual occupied width of the picture and the text in the current line;
acquiring total characters of the text needing to be input;
calling a truncation function to calculate the number of the remaining total characters which can be contained in the remaining screen width according to the truncation position of the total characters and the remaining screen width, wherein the number of the remaining total characters is the number of the characters counted by the total characters from the truncation position;
and if the number of the remaining total characters which can be actually contained in the remaining screen width is smaller than the number of the remaining total characters, the width occupied by the picture and the text exceeds the screen width of the electronic equipment.
8. The apparatus for implementing teletext according to claim 7, wherein the apparatus further comprises:
the first recording module is used for recording the number of the remaining total characters actually contained in the remaining screen width and the next truncation position of the total characters, wherein the next truncation position is a position at which the number of the remaining total characters is calculated from the number of the remaining total characters contained in the remaining screen width;
and the second recording module is used for recording the actual occupied width of the picture and the text of the current line.
CN201710515433.4A 2017-06-29 2017-06-29 Image-text mixed arrangement implementation method and device Active CN107230241B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710515433.4A CN107230241B (en) 2017-06-29 2017-06-29 Image-text mixed arrangement implementation method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710515433.4A CN107230241B (en) 2017-06-29 2017-06-29 Image-text mixed arrangement implementation method and device

Publications (2)

Publication Number Publication Date
CN107230241A CN107230241A (en) 2017-10-03
CN107230241B true CN107230241B (en) 2021-01-01

Family

ID=59935169

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710515433.4A Active CN107230241B (en) 2017-06-29 2017-06-29 Image-text mixed arrangement implementation method and device

Country Status (1)

Country Link
CN (1) CN107230241B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110548290B (en) * 2019-09-11 2023-10-03 珠海金山数字网络科技有限公司 Image-text mixed arrangement method and device, electronic equipment and storage medium
CN111596988B (en) * 2020-04-27 2022-01-25 五八有限公司 Terminal page image-text display method and device
CN111552428B (en) * 2020-04-29 2021-12-14 腾讯科技(深圳)有限公司 Data processing method, data processing device, computer equipment and storage medium
CN113378511B (en) * 2021-06-09 2023-07-25 北京百度网讯科技有限公司 Page display method and device, electronic equipment and storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102347913A (en) * 2011-07-08 2012-02-08 个信互动(北京)网络科技有限公司 Method for realizing voice and text content mixed message
CN103631964A (en) * 2013-12-18 2014-03-12 重庆市科学技术研究院 PDF (Portable document format)-embedded hypertext markup language (HTML) file shuffling method
CN103942314A (en) * 2014-04-22 2014-07-23 重庆市科学技术研究院 HTML file image-text integrating display method

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9582917B2 (en) * 2015-03-26 2017-02-28 Wrap Media, LLC Authoring tool for the mixing of cards of wrap packages

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102347913A (en) * 2011-07-08 2012-02-08 个信互动(北京)网络科技有限公司 Method for realizing voice and text content mixed message
CN103631964A (en) * 2013-12-18 2014-03-12 重庆市科学技术研究院 PDF (Portable document format)-embedded hypertext markup language (HTML) file shuffling method
CN103942314A (en) * 2014-04-22 2014-07-23 重庆市科学技术研究院 HTML file image-text integrating display method

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
图文混排与题图文字布局;CSDN;《URL:https://blog.csdn.net/Summer_2016_Sunshine/article/details/53212164》;20161118;1 *

Also Published As

Publication number Publication date
CN107230241A (en) 2017-10-03

Similar Documents

Publication Publication Date Title
CN107230241B (en) Image-text mixed arrangement implementation method and device
US9396167B2 (en) Template-based page layout for hosted social magazines
US20180337880A1 (en) System and method for presentation of content linked comments
CN106294301B (en) Report generation method and device
CN102650985B (en) Dynamic typesetting method of display menu
WO2006067711A2 (en) Method and device for displaying animated buttons
CN102436439A (en) Text box and text display method
CN105824517B (en) A kind of implementation method and device of desktop
US10089120B2 (en) Widgets in digital dashboards
KR102317013B1 (en) Object management and visualization using computing devices
CN108089858B (en) Method and device for creating visual interface
CN105912731A (en) Information showing method and device based on time axis
CN106708478B (en) Scroll view display method and apparatus
US20240143898A1 (en) Content typesetting method and apparatus, computer device, and storage medium
CN112689188B (en) Large-screen rolling caption display method, device, terminal and storage medium
CN117054846A (en) Visual test method, system and device for chip and storage medium
US11929049B2 (en) Output content generation apparatus, output content generation method and program
CN110456999B (en) Program creation method, program creation device, electronic equipment and computer readable storage medium
JP5418740B1 (en) Color arrangement changing device, color arrangement changing method, and color arrangement changing program
CN105988679A (en) Information presentation method and device and user equipment
CN110368692B (en) Image-text mixed arrangement method and device
KR101576563B1 (en) Method of editing multi-language comic contents
US20190124306A1 (en) Content projection control apparatus, content projection control method and program
CN113343027A (en) Interactive video editing and interactive video display method and device
CN108063936B (en) Method and device for realizing augmented reality AR and computer readable storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20240202

Address after: Room 801, 85 Kefeng Road, Huangpu District, Guangzhou City, Guangdong Province

Patentee after: Yami Technology (Guangzhou) Co.,Ltd.

Country or region after: China

Address before: 430000 East Lake Development Zone, Wuhan City, Hubei Province, No. 1 Software Park East Road 4.1 Phase B1 Building 11 Building

Patentee before: WUHAN DOUYU NETWORK TECHNOLOGY Co.,Ltd.

Country or region before: China