[go: up one dir, main page]

CN114625460A - Image-text mixed arranging method, device, equipment and storage medium - Google Patents

Image-text mixed arranging method, device, equipment and storage medium Download PDF

Info

Publication number
CN114625460A
CN114625460A CN202210172990.1A CN202210172990A CN114625460A CN 114625460 A CN114625460 A CN 114625460A CN 202210172990 A CN202210172990 A CN 202210172990A CN 114625460 A CN114625460 A CN 114625460A
Authority
CN
China
Prior art keywords
image
display control
image object
view display
data
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202210172990.1A
Other languages
Chinese (zh)
Other versions
CN114625460B (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.)
Beijing Baidu Netcom Science and Technology Co Ltd
Original Assignee
Beijing Baidu Netcom Science and Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Baidu Netcom Science and Technology Co Ltd filed Critical Beijing Baidu Netcom Science and Technology Co Ltd
Priority to CN202210172990.1A priority Critical patent/CN114625460B/en
Publication of CN114625460A publication Critical patent/CN114625460A/en
Application granted granted Critical
Publication of CN114625460B publication Critical patent/CN114625460B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/451Execution arrangements for user interfaces
    • 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

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • General Engineering & Computer Science (AREA)
  • Processing Or Creating Images (AREA)
  • User Interface Of Digital Computer (AREA)

Abstract

The disclosure provides a method, a device, equipment and a storage medium for mixed arrangement of pictures and texts, and relates to the technical field of computers, in particular to the field of software development. The specific implementation scheme is as follows: acquiring a character object to be typeset, at least one image object and the sequence of the character object and the image object; replacing the image object with a blank attachment, and forming an attribute character string according to the sequence of the character object and the image object; adding the attribute character string into the data display cell, and acquiring a first position of the blank attachment in the data display cell; and adding a first view display control at the first position, wherein the first view display control comprises an image object. The image-text mixed arrangement method achieves mixed arrangement of images and texts, and obtains better performance and display effect.

Description

Image-text mixed arranging method, device, equipment and storage medium
Technical Field
The present disclosure relates to the field of computer technology, and more particularly, to the field of software development.
Background
In the related art, when image content and text content to be displayed are subjected to image-text shuffling, a rich text object (including NSAttributedString and nsmustableattemtedstring) provided by an application programming interface of a system can only realize static local image resource and text content shuffling, and cannot realize the shuffling of network images or dynamic images (such as images in gif format) and text content.
Disclosure of Invention
The disclosure provides a method, a device, equipment and a storage medium for mixed arrangement of pictures and texts.
According to an aspect of the present disclosure, there is provided an image-text mixed arranging method, including:
acquiring a character object to be typeset, at least one image object and the sequence of the character object and the image object;
replacing the image object with a blank attachment, and forming an attribute character string according to the sequence of the character object and the image object;
adding the attribute character string into the data display cell, and acquiring a first position of the blank attachment in the data display cell;
and adding a first view display control at the first position, wherein the first view display control comprises an image object.
According to another aspect of the present disclosure, there is provided an image-text mixing and arranging apparatus including:
the acquiring module is used for acquiring the character object to be typeset, at least one image object and the sequence of the character object and the image object;
the space occupying module is used for replacing the image object with a blank attachment and forming an attribute character string according to the sequence of the character object and the image object;
the positioning module is used for adding the attribute character string into the data display cell and acquiring a first position of the blank attachment in the data display cell;
and the adding module is used for adding a first view display control at the first position, wherein the first view display control comprises an image object.
According to another aspect of the present disclosure, there is provided an electronic device including:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the teletext shuffling method described above.
According to another aspect of the present disclosure, there is provided a non-transitory computer-readable storage medium storing computer instructions for causing a computer to perform the above-described teletext shuffling method.
According to another aspect of the present disclosure, a computer program product is provided, comprising a computer program which, when executed by a processor, implements the above teletext shuffling method.
According to the image object display method and device, the blank attachment is used for occupying the image object to be displayed, and the view display control is added to the position of the blank attachment, so that image-text mixed arrangement is achieved.
It should be understood that the statements in this section do not necessarily identify key or critical features of the embodiments of the present disclosure, nor do they limit the scope of the present disclosure. Other features of the present disclosure will become apparent from the following description.
Drawings
The drawings are included to provide a better understanding of the present solution and are not to be construed as limiting the present disclosure. Wherein:
FIG. 1 is a schematic diagram of an application scenario according to the present disclosure;
fig. 2 is a schematic flow chart illustrating an implementation of a mixed image-text arrangement method according to an embodiment of the present disclosure;
fig. 3 is a schematic diagram of an implementation of a mixed-typesetting method according to an embodiment of the disclosure;
fig. 4 is a schematic structural diagram of an image-text mixing and arranging device 400 according to an embodiment of the disclosure;
FIG. 5 is a schematic block diagram of an example electronic device that may be used to implement embodiments of the present disclosure.
Detailed Description
Exemplary embodiments of the present disclosure are described below with reference to the accompanying drawings, in which various details of embodiments of the present disclosure are included to assist understanding, and which are to be considered as merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the present disclosure. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
At present, image-text mixing of moving images such as gif can be realized in the iOS system using YYText. YYText is a powerful graphics and text mixed bank, which supports rich text display and interaction, including moving pictures, highlights, gesture interaction, and the like. Although YYText is powerful, simple to use, and in most cases meets normal requirements, in some cases it has some problems. For example, in an Instant Messaging (IM) group chat supporting rich text, the total amount of messages and a single message data may be huge, and on the premise of considering performance, the UITableView is generally implemented by using a system control with a reuse mechanism such as UITableView, and when the UITableView cell is multiplexed, the UITableView cell in the multiplexing pool may alternately and repeatedly display different data. The YYText has two problems under the situation, namely, as the number of the displayed messages is increased, the memory is increased rapidly all the time, and the memory alarm is triggered; secondly, when the same data model is repeatedly displayed, the gif animation is static. And compared with a method provided by using an iOS system, the method is lower in expandability and transparency and not beneficial to later development and maintenance.
Aiming at the problem, the image-text mixed arranging method provided by the disclosure can realize image-text mixed arranging of dynamic images or network images and texts through an API provided by a system, and has better performance and display effect.
In iOS, to implement presentation of one or more sets of data with similar content styles, the most common practice is to use UITableView. The UITableView inherits from the UIScrollView, supporting vertical scrolling. Each row of UITableView is an UITableViewcell, and the UITableViewcell has a default sub-view inside, namely, contentView, and 3 sub-views are set under the contentView by default, wherein 2 sub-views are UILALALs, and the 3 rd sub-view is UIImageView (accessed through the ImageView attribute of the UITableViewcell).
Due to the limited memory of the iOS device, if thousands of data are displayed with the UITableView, thousands of UITableView cell objects are needed, which will exhaust the memory of the iOS device. To solve this problem, the UITableViewCell object needs to be reused, i.e. the Cell reuse mechanism. The principle of the Cell reuse mechanism is as follows: when the list is scrolled, part of the UITableViewcell will move out of the window, and the UITableView will place the UITableViewcell outside the window into a buffer pool to wait for reuse. When the UITableView requires the dataSource to return to the UITableViewCell, the dataSource firstly checks the cache pool, and if the unused UITableViewCell exists in the cache pool, the dataSource configures the UITableViewCell by using new data, then returns to the UITableView and redisplays the UITableView into a window, thereby avoiding creating a new object.
NSAttributedString, which may also be called rich text, is a string with attributes, through which various styles such as fonts, word sizes, font sizes, etc. can be easily expressed in a string, and paragraphs can also be formatted.
The NSTextAttachment is a style class of NSAttributeString, can be used as an attachment of text, can be used for placing files and data, can realize the display of images in the text, and can only display static local images.
The present disclosure provides a method for mixed typesetting of graphics and text, which can be applied to a data processing apparatus, for example, the apparatus can be deployed in a terminal or other processing devices to implement the method for mixed typesetting of graphics and text. For example, the method may be applied to the application scenario shown in fig. 1, and as shown in fig. 1, a mixed typesetting content of text and images is presented on a terminal display interface, and the content includes a network image 1, text 1, a dynamic image 1, text 2, a dynamic image 2, and text 3.
Fig. 2 is a schematic flow chart illustrating an implementation of an image-text mixed arranging method according to an embodiment of the present disclosure, where the method at least includes the following steps:
s201: and acquiring the character object and at least one image object to be typeset and the sequence of the character object and the image object.
It should be noted that the text objects and image objects to be laid out may be input by a user or generated by any software, and the order of the text objects and image objects is determined during the input or generation. For example, a message, a comment, a barrage, etc. input by a user in any software or web page may contain text and a plurality of dynamic expressions; for example, in weather forecast software, weather forecast information for a plurality of days in the future is generated according to weather data, and the information can comprise text contents such as date and temperature and schematic images representing weather such as rain, snow, cloudy and sunny.
It should be further noted that the image object may be a static image or a dynamic image, and the image source may be a local image or an image obtained through website link, so that the image source of the method is expanded, more image forms are supported, and the application range and the display effect are improved.
S202: and substituting blank attachments for the image objects, and forming the attribute character strings according to the sequence of the character objects and the image objects.
The blank attachment can be NSTextAttachment, and the NSTextAttachment has two attribute parameters, wherein one attribute parameter is image for specifying an image, and the other attribute parameter is bounding for specifying width and height; a blank attachment may refer to NSTextAttachment for which the image attribute parameter does not bind image data. The attribute string may be nsatttributtrong, which may carry data content including text, text attachments.
S203: adding the attribute character string into the data display cell, and acquiring a first position of the blank attachment in the data display cell;
the data presentation cell may use a UITableViewCell, and the control for presenting the content in the UITableViewCell may use UILabel.
S204: and adding a first view display control at the first position, wherein the first view display control comprises an image object.
Wherein the first view presentation control may use UIImageView, which may be used to present the dynamic image.
In some possible embodiments, the obtaining the first position of the blank attachment in the data display cell includes:
using the method of the return image borders (imageframes) parameter of the attachment class, a location parameter of the blank attachment is obtained, the location parameter representing a first location of the blank attachment in the data presentation cell.
For example, the method of returning the image boundary imageframes parameter may employ the imageforframes method: [ NSTextAttachment image for buildings: CharacterIndex: ], the imageBounds parameter returned by this method is the first position of NSTextAttachment in the current data presentation cell.
In the embodiment of the disclosure, the blank attachment is used for occupying the image object in the display area, and the position of the blank attachment is obtained, so that the first view display control containing the image object is covered on the position of the blank attachment.
In some possible embodiments, the adding the first view showing control at the first position includes:
creating at least one first view presentation control in the data presentation cell;
and assigning the attribute parameters of at least one image object to the data model of the data display unit cell, wherein the at least one image object is bound with the first view display control at the corresponding first position.
According to the number of the blank attachments and the corresponding first positions, creating first view display controls of the corresponding number, and covering the first positions of the blank attachments respectively; the image object is bound with a first view presentation control corresponding to a blank attachment replacing the image object.
When the image object is a network image, the image attribute parameter of the image object is a website link of the network image.
In the embodiment of the disclosure, a display position is reserved for the image object through occupation of the front blank accessory, so that the first view display control can add the image object to the reserved position, mixed arrangement of images and texts is realized, and mixed arrangement of images and texts of the dynamic image is realized because the UIImageView adopted by the first view display control can be used for displaying the dynamic image.
In some possible embodiments, the creating at least one first view presentation control in the data presentation cell includes:
and in response to the operation of sliding the screen display area, under the condition that a second view display control which is the same as the first view display control to be created is not contained in the cache pool of the data display cell, directly creating the first view display control.
Taking fig. 3 as an example, fig. 3 shows an implementation schematic diagram of the image-text mixed arrangement method according to an embodiment of the present disclosure in the screen sliding process, compared to fig. 1, a terminal user slides a screen upwards, a data display cell 1 originally located in a screen display area moves upwards and gradually moves out of the screen, and when the data display cell 1 moves out of the screen display area, the data display cell 1 enters a cache pool, and a first view display control in the data display cell 1 becomes a second view display control waiting for reuse. Along with the process that the data display cell 1 moves upwards, the data display cell 2 enters a display area from a screen, the data display cell 2 comprises a plurality of new text objects and image objects, at the moment, a second view display control which is the same as a first view display control to be created in the data cell 2 does not exist in the cache pool, and the first view display control in the data display cell 2 can be directly created.
In some possible embodiments, the creating at least one first view presentation control in the data presentation cell includes:
and in response to the operation of sliding the screen display area, under the condition that a cache pool of the data display cell contains a second view display control which is the same as the first view display control to be created, removing the second view display control added before and then creating the first view display control.
Still taking fig. 3 as an example, when the terminal user slides the screen downwards to make the data display cell 1 return to the display area again, at this time, the cache pool stores the second view display control that is the same as the first view display control of the previous data display cell 1, and the first view display control needs to be created again after the second view display control added before is removed. Since the first view showing control is created again and initialized again, the image object of the dynamic image can be played again.
In some possible embodiments, in order to further control the memory and avoid the problem of excessive data display cells entering the buffer pool and causing a sudden increase in memory occupation, all the second view display controls in the buffer pool may be removed each time the first view display control is created, and a reuse mechanism of the Cell is cancelled.
In the embodiment of the disclosure, when a data model is assigned each time, the previously added view display control is removed, and a new view display control is created again, so that the problem that the view display control corresponding to the data model is initialized only once is avoided, and the dynamic image is ensured to be normally displayed when the UITableViewCell is multiplexed. Meanwhile, the problem that the number of bound view display controls is increased along with the increase of the number of displayed data models, so that the memory burst is caused is solved. The method can improve the display effect and performance when the same data model is repeatedly displayed.
In some possible embodiments, before replacing the image object with the blank attachment in S202, the method further includes:
and acquiring the size of at least one image object, and setting the size of the blank attachment corresponding to the image object according to the size and a preset typesetting rule.
The preset typesetting rule can be that the upper limit of the blank attachment size is preset, and the phenomenon that the typesetting effect is influenced by the overlarge distance between the upper line of characters and the lower line of characters caused by the overlarge image object is avoided. Different upper size limits may also be set for different image formats, such as dynamic expressions and dynamic images. In some specific cases, fixed blank attachment sizes can be preset, and the blank attachments are uniform in size, so that the typesetting effect can be controlled conveniently.
Specifically, the image object is taken as a dynamic image, and the image-text mixed arranging method at least includes the following steps:
the method comprises the following steps: and acquiring the character object to be typeset, at least one dynamic image and the sequence of the character object and the dynamic image.
Step two: and replacing the dynamic image by using the blank attachment of the unbound image data, and forming the attribute character string according to the sequence of the character object and the dynamic image.
Step three: adding the attribute character string into the data display cell, and acquiring a first position of a blank accessory in the data display cell by using an accessory type image boundary parameter returning method;
specifically, the method of returning the image boundary imageframes parameter may be used to adopt the imageforframes method: [ NSTextAttachment image for buildings: CharacterIndex: ], the imageBounds parameter returned by this method is the first position of NSTextAttachment in the current data presentation cell.
Step four: creating at least one first view presentation control in the data presentation cell;
and assigning the attribute parameters of at least one dynamic image to the data model of the data display unit cell, wherein the at least one dynamic image is bound with the first view display control at the corresponding first position.
Specifically, according to the number of blank accessories and the corresponding first positions, first view display controls with corresponding numbers are created and respectively covered on the first positions of the blank accessories; binding the dynamic image with a first view presentation control corresponding to a blank attachment replacing the dynamic image.
In this embodiment, the creating at least one first view display control in the data display cell includes:
and in response to the operation of sliding the screen display area, under the condition that a second view display control which is the same as the first view display control to be created is not contained in the cache pool of the data display cell, directly creating the first view display control.
Taking fig. 3 as an example, fig. 3 shows an implementation schematic diagram of the image-text mixed arrangement method according to an embodiment of the present disclosure in the process of sliding the screen, compared to fig. 1, when a terminal user slides the screen upwards with a finger, a data display cell 1 originally located in a screen display area and containing a plurality of characters and dynamic images moves upwards and gradually moves out of the screen, and when the data display cell 1 moves out of the screen display area, the data display cell 1 enters a cache pool, and a first view display control in the data display cell 1 becomes a second view display control waiting for reuse. Along with the process that the data display cell 1 moves upwards, the data display cell 2 enters a display area from a screen, the data display cell 2 comprises a plurality of new character objects and new dynamic images, and at the moment, a first view display control in the data display cell 2 can be directly created.
And under the condition that the cache pool of the data display cell contains a second view display control which is the same as the first view display control to be created, removing the second view display control added before and then creating the first view display control.
Still taking fig. 3 as an example, when the terminal user slides the screen downwards to make the data display cell 1 above return to the display area again, the created dynamic image 1 and the created dynamic image 2 need to be displayed again, at this time, the cache pool stores the second view display control same as the first view display control of the previous data display cell 1, and the first view display control needs to be created again after the second view display control added before is removed. Since the first view presentation control is re-created, re-initialized, and the dynamic image can be replayed.
In this embodiment, the first step may further obtain a size of at least one of the moving images, and set the size of the blank attachment corresponding to the moving image according to the size and the preset layout rule.
The preset typesetting rule can be that the upper limit of the blank attachment size is preset, and the phenomenon that the typesetting effect is influenced by the overlarge distance between the upper line of characters and the lower line of characters caused by the overlarge size of the dynamic image is avoided. Different upper size limits may also be set for different image formats, such as dynamic expressions and dynamic images. In some specific cases, fixed blank attachment sizes can be preset, so that the blank attachments are uniform in size and the typesetting effect is convenient to control.
Fig. 4 is a schematic structural diagram of an image-text mixing and arranging device according to another embodiment of the disclosure. The image-text mixing and arranging device 400 shown in fig. 4 comprises:
an obtaining module 410, configured to obtain a text object and at least one image object to be typeset, and an order of the text object and the image object;
the placeholder 420 is used for replacing the image object with a blank attachment and forming an attribute character string according to the sequence of the character object and the image object;
the positioning module 430 is configured to add the attribute character string to the data display cell, and obtain a first position of the blank attachment in the data display cell;
an adding module 440, configured to add a first view showing control at a first position, where the first view showing control includes an image object.
In some possible embodiments, the positioning module 430 is configured to:
and acquiring a position parameter of the blank attachment by using a method for returning the image boundary imagebuildings parameter of the attachment class, wherein the position parameter represents the first position of the blank attachment in the data display cell.
In some possible embodiments, the adding module 440 is configured to:
creating at least one first view presentation control in the data presentation cell;
and assigning the attribute parameters of at least one image object to the data model of the data display unit cell, wherein the at least one image object is bound with the first view display control at the corresponding first position.
In some possible embodiments, the adding module 440 is configured to:
and in response to the operation of sliding the screen display area, under the condition that a second view display control which is the same as the first view display control to be displayed is contained in the cache pool of the data display cell, removing the second view display control added before and then creating the first view display control.
In some possible embodiments, the adding module 440 is configured to:
and in response to the operation of sliding the screen display area, under the condition that a cache pool of the data display cell does not contain a second view display control which is the same as the first view display control to be displayed, directly creating the first view display control.
In some possible embodiments, the placeholder module 420 is configured to:
and acquiring the size of at least one image object, and setting the size of the blank attachment corresponding to the image object according to the size and a preset typesetting rule.
In some possible embodiments, the image is a still image, a moving image, a local image, or an image obtained through a website link.
For a description of specific functions and examples of each module and each sub-module of the data processing apparatus in the embodiment of the present disclosure, reference may be made to the related description of the corresponding steps in the above data processing method embodiment, and details are not repeated here.
The present disclosure also provides an electronic device, a readable storage medium, and a computer program product according to embodiments of the present disclosure.
FIG. 5 illustrates a schematic block diagram of an example electronic device 500 that can be used to implement embodiments of the present disclosure. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. Electronic devices may also represent various forms of mobile devices, such as personal digital processors, cellular telephones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be examples only, and are not meant to limit implementations of the disclosure described and/or claimed herein.
As shown in fig. 5, the apparatus 500 comprises a computing unit 501 which may perform various appropriate actions and processes in accordance with a computer program stored in a Read Only Memory (ROM)502 or a computer program loaded from a storage unit 508 into a Random Access Memory (RAM) 503. In the RAM 503, various programs and data required for the operation of the device 500 can also be stored. The calculation unit 501, the ROM 502, and the RAM 503 are connected to each other by a bus 504. An input/output (I/O) interface 505 is also connected to bus 504.
A number of components in the device 500 are connected to the I/O interface 505, including: an input unit 506 such as a keyboard, a mouse, or the like; an output unit 507 such as various types of displays, speakers, and the like; a storage unit 508, such as a magnetic disk, optical disk, or the like; and a communication unit 509 such as a network card, modem, wireless communication transceiver, etc. The communication unit 509 allows the device 500 to exchange information/data with other devices through a computer network such as the internet and/or various telecommunication networks.
The computing unit 501 may be a variety of general-purpose and/or special-purpose processing components having processing and computing capabilities. Some examples of the computing unit 501 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various dedicated Artificial Intelligence (AI) computing chips, various computing units running machine learning model algorithms, a Digital Signal Processor (DSP), and any suitable processor, controller, microcontroller, and so forth. The computing unit 501 performs the various methods and processes described above, such as the graph-text shuffling method. For example, in some embodiments, the teletext method may be implemented as a computer software program tangibly embodied in a machine-readable medium, such as storage unit 508. In some embodiments, part or all of the computer program may be loaded and/or installed onto the device 500 via the ROM 502 and/or the communication unit 509. When loaded into RAM 503 and executed by the computing unit 501, may perform one or more of the steps of the above-described teletext shuffling method. Alternatively, in other embodiments, the computing unit 501 may be configured to perform the teletext method in any other suitable way (e.g. by means of firmware).
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuitry, Field Programmable Gate Arrays (FPGAs), Application Specific Integrated Circuits (ASICs), Application Specific Standard Products (ASSPs), system on a chip (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs that are executable and/or interpretable on a programmable system including at least one programmable processor, which may be special or general purpose, receiving data and instructions from, and transmitting data and instructions to, a storage system, at least one input device, and at least one output device.
Program code for implementing the methods of the present disclosure may be written in any combination of one or more programming languages. These program code may be provided to a processor or controller of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the program code, when executed by the processor or controller, causes the functions/acts specified in the flowchart and/or block diagram to be performed. The program code may execute entirely on the machine, partly on the machine, as a stand-alone software package partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) by which a user can provide input to the computer. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic, speech, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a back-end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back-end, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), Wide Area Networks (WANs), and the Internet.
The computer system may include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server may be a cloud server, a server of a distributed system, or a server with a combined blockchain.
It should be understood that various forms of the flows shown above may be used, with steps reordered, added, or deleted. For example, the steps described in the present disclosure may be executed in parallel, sequentially or in different orders, and are not limited herein as long as the desired results of the technical solutions disclosed in the present disclosure can be achieved.
The above detailed description should not be construed as limiting the scope of the disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may be made in accordance with design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present disclosure should be included in the scope of protection of the present disclosure.

Claims (17)

1. A method for mixed arrangement of pictures and texts comprises the following steps:
acquiring a character object to be typeset, at least one image object and the sequence of the character object and the image object;
replacing the image object with a blank attachment, and forming an attribute character string according to the sequence of the character object and the image object;
adding the attribute character string into a data display cell, and acquiring a first position of the blank attachment in the data display cell;
adding a first view display control at the first position, wherein the image object is included in the first view display control.
2. The method of claim 1, wherein said obtaining a first location of the blank attachment in the data presentation cell comprises:
and acquiring a position parameter of the blank attachment by using a method of returning the image boundary parameter of the attachment class, wherein the position parameter represents a first position of the blank attachment in the data display cell.
3. The method of claim 1, wherein said adding a first view presentation control in said first position comprises:
creating at least one first view presentation control in the data presentation cell;
and assigning the attribute parameters of the at least one image object to the data model of the data display unit cell, wherein the at least one image object is bound with the corresponding first view display control at the first position.
4. The method of claim 3, wherein said creating at least one first view presentation control in said data presentation cell comprises:
and in response to the operation of sliding the screen display area, under the condition that a second view display control which is the same as the first view display control to be created is contained in the cache pool of the data display cell, removing the second view display control and then creating the first view display control.
5. The method of claim 3, wherein said creating at least one first view presentation control in said data presentation cell comprises:
and in response to the operation of sliding the screen display area, under the condition that a second view display control which is the same as the first view display control to be created is not contained in the cache pool of the data display unit grid, creating the first view display control.
6. The method of claim 1, wherein prior to said replacing the image object with a blank attachment, further comprising:
and acquiring the size of the at least one image object, and setting the size of the blank attachment corresponding to the image object according to the size and a preset typesetting rule.
7. The method of any of claims 1-6, wherein the image object is a static image, a dynamic image, a local image, or an image obtained through a web site link.
8. An image-text mixing arrangement device, comprising:
an acquisition module, configured to acquire a text object and at least one image object to be typeset, and an order of the text object and the image object;
the space occupying module is used for replacing the image object with a blank attachment and forming an attribute character string according to the sequence of the character object and the image object;
the positioning module is used for adding the attribute character string into a data display cell and acquiring a first position of the blank attachment in the data display cell;
and the adding module is used for adding a first view display control at the first position, wherein the first view display control comprises the image object.
9. The apparatus of claim 8, wherein the positioning module is to:
and acquiring a position parameter of the blank attachment by using a method of returning the image boundary parameter of the attachment class, wherein the position parameter represents a first position of the blank attachment in the data display cell.
10. The apparatus of claim 8, wherein the adding module is to:
creating at least one first view presentation control in the data presentation cell;
and assigning the attribute parameters of the at least one image object to the data model of the data display unit cell, wherein the at least one image object is bound with the corresponding first view display control at the first position.
11. The apparatus of claim 10, wherein the adding module is to:
and in response to the operation of sliding the screen display area, under the condition that a second view display control which is the same as the first view display control to be displayed is contained in the cache pool of the data display cell, removing the second view display control and then creating the first view display control.
12. The apparatus of claim 10, wherein the adding module is to:
and in response to the operation of sliding the screen display area, under the condition that a cache pool of the data display unit cell does not contain a second view display control which is the same as the first view display control to be displayed, creating the first view display control.
13. The apparatus of claim 8, wherein the placeholder is to:
and acquiring the size of the at least one image object, and setting the size of the blank attachment corresponding to the image object according to the size and a preset typesetting rule.
14. The apparatus of any one of claims 8-13, wherein the image object is a static image, a dynamic image, a local image, or an image obtained through a web site link.
15. An electronic device, comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-7.
16. A non-transitory computer readable storage medium having stored thereon computer instructions for causing the computer to perform the method of any one of claims 1-7.
17. A computer program product comprising a computer program which, when executed by a processor, implements the method according to any one of claims 1-7.
CN202210172990.1A 2022-02-24 2022-02-24 Image-text mixed arrangement method, device, equipment and storage medium Active CN114625460B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210172990.1A CN114625460B (en) 2022-02-24 2022-02-24 Image-text mixed arrangement method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210172990.1A CN114625460B (en) 2022-02-24 2022-02-24 Image-text mixed arrangement method, device, equipment and storage medium

Publications (2)

Publication Number Publication Date
CN114625460A true CN114625460A (en) 2022-06-14
CN114625460B CN114625460B (en) 2024-02-06

Family

ID=81899296

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210172990.1A Active CN114625460B (en) 2022-02-24 2022-02-24 Image-text mixed arrangement method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114625460B (en)

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090172635A1 (en) * 2007-12-28 2009-07-02 Auriemma Stephen T System and method for allowing the creation of composite applications through the wiring of loosely coupled existing or custom components of disparate technologies
EP2447885A2 (en) * 2010-11-01 2012-05-02 Apple Inc. A font file with graphic images
CN106802796A (en) * 2016-12-28 2017-06-06 重庆可兰达科技有限公司 A kind of Composing Method of Mixing and system based on IOS systems
CN106951405A (en) * 2017-03-14 2017-07-14 东软集团股份有限公司 Data processing method and device based on typesetting engine
CN107479930A (en) * 2017-08-16 2017-12-15 四川长虹电器股份有限公司 Method for loading dynamic content mixing in iOS system
WO2018064880A1 (en) * 2016-10-09 2018-04-12 武汉斗鱼网络科技有限公司 Method and system for creating list views in ios system
CN108805960A (en) * 2018-05-31 2018-11-13 北京字节跳动网络技术有限公司 Composing Method of Mixing, device, computer readable storage medium and terminal
CN110321506A (en) * 2019-07-04 2019-10-11 广州小鹏汽车科技有限公司 Webpage data loading method, device, computer equipment and storage medium
CN113986426A (en) * 2021-10-26 2022-01-28 腾讯科技(深圳)有限公司 Image detection method and device, readable medium and electronic equipment

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090172635A1 (en) * 2007-12-28 2009-07-02 Auriemma Stephen T System and method for allowing the creation of composite applications through the wiring of loosely coupled existing or custom components of disparate technologies
EP2447885A2 (en) * 2010-11-01 2012-05-02 Apple Inc. A font file with graphic images
WO2018064880A1 (en) * 2016-10-09 2018-04-12 武汉斗鱼网络科技有限公司 Method and system for creating list views in ios system
CN106802796A (en) * 2016-12-28 2017-06-06 重庆可兰达科技有限公司 A kind of Composing Method of Mixing and system based on IOS systems
CN106951405A (en) * 2017-03-14 2017-07-14 东软集团股份有限公司 Data processing method and device based on typesetting engine
CN107479930A (en) * 2017-08-16 2017-12-15 四川长虹电器股份有限公司 Method for loading dynamic content mixing in iOS system
CN108805960A (en) * 2018-05-31 2018-11-13 北京字节跳动网络技术有限公司 Composing Method of Mixing, device, computer readable storage medium and terminal
CN110321506A (en) * 2019-07-04 2019-10-11 广州小鹏汽车科技有限公司 Webpage data loading method, device, computer equipment and storage medium
CN113986426A (en) * 2021-10-26 2022-01-28 腾讯科技(深圳)有限公司 Image detection method and device, readable medium and electronic equipment

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
杨勇刚;程文青;: "基于XML的图文混排方案与实现", 计算机应用与软件, no. 01 *

Also Published As

Publication number Publication date
CN114625460B (en) 2024-02-06

Similar Documents

Publication Publication Date Title
CN109801347B (en) Method, device, equipment and medium for generating editable image template
CN106991154B (en) Webpage rendering method and device, terminal and server
CN109933322B (en) Page editing method and device and computer readable storage medium
CN110717120B (en) Webpage list display method and device
CN113138827B (en) Method, device, electronic equipment and medium for displaying data
CN113268949B (en) Form display method and device based on dynamic fields, computer equipment and medium
CN115309470B (en) Method, device, equipment and storage medium for loading widget
CN109145272B (en) Text rendering and layout method, device, equipment and storage medium
CN114035865B (en) Method, device and equipment for starting small program and storage medium
CN113722124B (en) Content processing method, device, equipment and storage medium of cloud mobile phone
CN113342450B (en) Page processing method, device, electronic equipment and computer readable medium
CN114218890A (en) Page rendering method and device, electronic equipment and storage medium
CN113656041A (en) Data processing method, device, equipment and storage medium
CN113656533A (en) Tree control processing method and device and electronic equipment
CN112634406A (en) Method, device, electronic equipment, storage medium and program product for generating picture
CN114625460B (en) Image-text mixed arrangement method, device, equipment and storage medium
CN114489639B (en) File generation method, device, equipment and storage medium
CN114415892B (en) Interface control generation method and device, readable medium and electronic equipment
EP4379596A1 (en) Text typesetting
CN113642295B (en) Page typesetting method, device and computer program product
CN110750973A (en) Dynamic template configuration method and system
CN115329720A (en) Document display method, device, equipment and storage medium
CN112417345B (en) Rendering method, rendering device, electronic equipment and storage medium
CN112861504A (en) Text interaction method, device, equipment, storage medium and program product
CN113343636B (en) Method and device for setting marking line width, electronic equipment and 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