Intelligent typesetting method and terminal

文档序号:699317 发布日期:2021-05-04 浏览:13次 中文

阅读说明:本技术 一种智能排版方法及终端 (Intelligent typesetting method and terminal ) 是由 叶荏芊 冯春英 于 2021-01-21 设计创作,主要内容包括:一种智能排版方法及终端,获取预设页面的页面大小以及需排版图片集合的第一数量和第一排列顺序;根据预设的第一比例对需排版图片集合中的每张需排版图片进行缩放,得到缩放图片集合;根据所述缩放图片集合、第一排列顺序及所述预设页面大小,得到预设页面中可放入的第一图片集合及第一图片集合的第二排列顺序;获取位于第一图片集合中第一顺序位的第二图片,将第二图片置于预设页面的第一位置;获取第二图片下一位的第三图片,将第三图片置于第一图片的右侧或下方;重复执行直至所述第一图片集合中剩余的图片数量为0,标记所述预设页面为最终页面并输出;本发明实现将多张需排版图片放置入一个矩形的预设页面中,在预设页面中对图片自动排版。(An intelligent typesetting method and a terminal acquire the page size of a preset page and a first number and a first arrangement sequence of a picture set to be typeset; zooming each picture to be typeset in the picture set to be typeset according to a preset first proportion to obtain a zoomed picture set; obtaining a first picture set which can be put in a preset page and a second arrangement sequence of the first picture set according to the zooming picture set, the first arrangement sequence and the size of the preset page; acquiring a second picture positioned at a first sequence position in the first picture set, and placing the second picture at a first position of a preset page; acquiring a third picture next to the second picture, and placing the third picture at the right side or below the first picture; repeatedly executing until the number of the remaining pictures in the first picture set is 0, marking the preset page as a final page and outputting; the invention realizes that a plurality of pictures to be typeset are placed into a rectangular preset page, and the pictures are automatically typeset in the preset page.)

1. An intelligent typesetting method is characterized by comprising the following steps:

s1, acquiring the page size of a preset page, the first number and the first arrangement sequence of the picture sets to be typeset;

s2, zooming each picture to be typeset in the picture set to be typeset according to a preset first proportion to obtain a zoomed picture set;

s3, obtaining a first picture set which can be put in the preset page and a second arrangement sequence of the first picture set according to the zooming picture set, the first arrangement sequence and the size of the preset page;

s4, acquiring a second picture located at a first sequence position in the first picture set, and placing the second picture at a first position of the preset page; acquiring a third picture next to the second picture, and placing the third picture at the right side or below the first picture;

and S5, repeating the step S4 until the number of the remaining pictures in the first picture set is 0, and marking the preset page as a final page and outputting the final page.

2. The intelligent typesetting method according to claim 1, wherein the S1 specifically comprises:

acquiring a first length value and a first width value of a preset page, and acquiring a first number and a first arrangement sequence of a picture set to be typeset;

acquiring a second length value and a second width value of each picture to be typeset;

the S2 specifically includes:

and respectively zooming the second length value and the second width value of each picture to be typeset according to a preset first proportion to obtain the zoomed picture set.

3. The intelligent typesetting method according to claim 1, wherein the S3 specifically comprises:

sequentially putting the zoom pictures in the zoom picture set into the preset page according to the first arrangement order until new zoom pictures cannot be put into the preset page, and marking the zoom pictures in the preset page as first pictures at the moment to obtain a first picture set;

and taking the sequence of the first pictures in the preset page as a second arrangement sequence.

4. The intelligent typesetting method according to claim 2, wherein the S4 specifically comprises:

s41, acquiring a second picture located at the first sequence position in the first picture set, and placing the second picture at the upper right position of the preset page;

s42, adjusting the scaling of the second picture until the third length value or the third width value of the second picture is equal to the first length value or the first width value of the preset page, judging whether the rest part of the preset page can be placed in other pictures except the second picture in the first picture set at the moment, if so, executing S43, otherwise, executing S44;

s43, saving the scaling as the second scale, and marking the new first length value-the third length value or the new first width value-the third width value; acquiring a third picture next to the second picture, placing the third picture at the right side or below the second picture, and executing the step S42 with the third picture as the second picture;

s44, obtaining a third picture next to the second picture, placing the third picture on the right side of the second picture, and splicing the second picture and the third picture to obtain a rectangular fourth picture; performing the S42 with the fourth picture as the second picture.

5. The intelligent typesetting method as claimed in claim 2, further comprising after the step S5:

and automatically scoring the final page according to whether the final page is fully paved and the difference value of the area of the minimum picture and the area of the maximum picture in the final page.

6. An intelligent composition terminal, comprising a memory, a processor and a computer program stored on the memory and operable on the processor, wherein the processor implements the following steps when executing the computer program:

s1, acquiring the page size of a preset page, the first number and the first arrangement sequence of the picture sets to be typeset;

s2, zooming each picture to be typeset in the picture set to be typeset according to a preset first proportion to obtain a zoomed picture set;

s3, obtaining a first picture set which can be put in the preset page and a second arrangement sequence of the first picture set according to the zooming picture set, the first arrangement sequence and the size of the preset page;

s4, acquiring a second picture located at a first sequence position in the first picture set, and placing the second picture at a first position of the preset page; acquiring a third picture next to the second picture, and placing the third picture at the right side or below the first picture;

and S5, repeating the step S4 until the number of the remaining pictures in the first picture set is 0, and marking the preset page as a final page and outputting the final page.

7. The intelligent typesetting terminal as claimed in claim 6, wherein the S1 is specifically:

acquiring a first length value and a first width value of a preset page, and acquiring a first number and a first arrangement sequence of a picture set to be typeset;

acquiring a second length value and a second width value of each picture to be typeset;

the S2 specifically includes:

and respectively zooming the second length value and the second width value of each picture to be typeset according to a preset first proportion to obtain the zoomed picture set.

8. The intelligent typesetting terminal as claimed in claim 6, wherein the S3 is specifically:

sequentially putting the zoom pictures in the zoom picture set into the preset page according to the first arrangement order until new zoom pictures cannot be put into the preset page, and marking the zoom pictures in the preset page as first pictures at the moment to obtain a first picture set;

and taking the sequence of the first pictures in the preset page as a second arrangement sequence.

9. The intelligent typesetting terminal as claimed in claim 7, wherein the S4 is specifically:

s41, acquiring a second picture located at the first sequence position in the first picture set, and placing the second picture at the upper right position of the preset page;

s42, adjusting the scaling of the second picture until the third length value or the third width value of the second picture is equal to the first length value or the first width value of the preset page, judging whether the rest part of the preset page can be placed in other pictures except the second picture in the first picture set at the moment, if so, executing S43, otherwise, executing S44;

s43, saving the scaling as the second scale, and marking the new first length value-the third length value or the new first width value-the third width value; acquiring a third picture next to the second picture, placing the third picture at the right side or below the second picture, and executing the step S42 with the third picture as the second picture;

s44, obtaining a third picture next to the second picture, placing the third picture on the right side of the second picture, and splicing the second picture and the third picture to obtain a rectangular fourth picture; performing the S42 with the fourth picture as the second picture.

10. The intelligent typesetting terminal as claimed in claim 6, further comprising after the step S5:

and automatically scoring the final page according to whether the final page is fully paved and the difference value of the area of the minimum picture and the area of the maximum picture in the final page.

Technical Field

The invention relates to the field of picture typesetting, in particular to an intelligent typesetting method and a terminal.

Background

In daily life, a large amount of valuable text, picture, audio and video data are available, the data are valuable mental wealth of owners, the data are typeset and presented in a more beautiful and theme-appropriate mode, or the data are permanently stored in an electronic book or a physical book mode to become a practical requirement of the data owners, and the existing data typesetting has one or more of the following disadvantages: 1. the format has no fixed specification, and the sizes are all inconsistent; 2. the mode is fixed, and the content cannot be regulated; 3. the picture selection is manually carried out, and the picture cannot be automatically input.

Disclosure of Invention

The technical problem to be solved by the invention is as follows: an intelligent typesetting method and a terminal are provided, which realize automatic typesetting of a certain number of pictures.

In order to solve the technical problems, the invention adopts a technical scheme that:

an intelligent typesetting method comprises the following steps:

s1, acquiring the page size of a preset page, the first number and the first arrangement sequence of the picture sets to be typeset;

s2, zooming each picture to be typeset in the picture set to be typeset according to a preset first proportion to obtain a zoomed picture set;

s3, obtaining a first picture set which can be put in the preset page and a second arrangement sequence of the first picture set according to the zooming picture set, the first arrangement sequence and the size of the preset page;

s4, acquiring a second picture located at a first sequence position in the first picture set, and placing the second picture at a first position of the preset page; acquiring a third picture next to the second picture, and placing the third picture at the right side or below the first picture;

and S5, repeating the step S4 until the number of the remaining pictures in the first picture set is 0, and marking the preset page as a final page and outputting the final page.

In order to solve the technical problem, the invention adopts another technical scheme as follows:

an intelligent composition terminal, comprising a memory, a processor and a computer program stored on the memory and operable on the processor, the processor implementing the following steps when executing the computer program:

s1, acquiring the page size of a preset page, the first number and the first arrangement sequence of the picture sets to be typeset;

s2, zooming each picture to be typeset in the picture set to be typeset according to a preset first proportion to obtain a zoomed picture set;

s3, obtaining a first picture set which can be put in the preset page and a second arrangement sequence of the first picture set according to the zooming picture set, the first arrangement sequence and the size of the preset page;

s4, acquiring a second picture located at a first sequence position in the first picture set, and placing the second picture at a first position of the preset page; acquiring a third picture next to the second picture, and placing the third picture at the right side or below the first picture;

and S5, repeating the step S4 until the number of the remaining pictures in the first picture set is 0, and marking the preset page as a final page and outputting the final page.

The invention has the beneficial effects that: the method comprises the steps of obtaining a picture set needing to be typeset, firstly zooming pictures needing to be typeset in the picture set needing to be typeset according to a preset proportion, then judging which pictures needing to be typeset can be placed in the page size of a preset page after zooming, storing the sequence of the pictures, determining which pictures needing to be typeset can be placed in the preset page, and then typesetting the pictures according to the method that the pictures are placed in sequence and the position relation between the next placed picture and the previous picture is regulated, so that the pictures can achieve the orderly effect visually, and finally placing a plurality of pictures needing to be typeset into a rectangular preset page, thereby realizing the automatic typesetting of the pictures in the preset page.

Drawings

FIG. 1 is a flowchart illustrating steps of an intelligent typesetting method according to an embodiment of the invention;

fig. 2 is a schematic structural diagram of an intelligent composition terminal according to an embodiment of the present invention;

fig. 3 is a schematic diagram of a first picture set according to an embodiment of the invention;

FIG. 4 is a schematic diagram of a typesetting result of the intelligent typesetting method according to the embodiment of the invention;

FIGS. 5-7 are schematic diagrams illustrating the result of the error typesetting according to the embodiment of the invention;

FIG. 8 is a schematic illustration of a manner of determining a first ratio according to an embodiment of the present invention;

FIG. 9 is a diagram illustrating a zoom ratio change according to an embodiment of the present invention;

FIGS. 10-12 are diagrams illustrating layout results of pictures according to embodiments of the present invention;

description of reference numerals:

1. an intelligent typesetting terminal; 2. a processor; 3. a memory.

Detailed Description

In order to explain technical contents, achieved objects, and effects of the present invention in detail, the following description is made with reference to the accompanying drawings in combination with the embodiments.

Referring to fig. 1 and fig. 3 to 12, an intelligent typesetting method includes the steps of:

s1, acquiring the page size of a preset page, the first number and the first arrangement sequence of the picture sets to be typeset;

s2, zooming each picture to be typeset in the picture set to be typeset according to a preset first proportion to obtain a zoomed picture set;

s3, obtaining a first picture set which can be put in the preset page and a second arrangement sequence of the first picture set according to the zooming picture set, the first arrangement sequence and the size of the preset page;

s4, acquiring a second picture located at a first sequence position in the first picture set, and placing the second picture at a first position of the preset page; acquiring a third picture next to the second picture, and placing the third picture at the right side or below the first picture;

and S5, repeating the step S4 until the number of the remaining pictures in the first picture set is 0, and marking the preset page as a final page and outputting the final page.

From the above description, the beneficial effects of the present invention are: the method comprises the steps of obtaining a picture set needing to be typeset, firstly zooming pictures needing to be typeset in the picture set needing to be typeset according to a preset proportion, then judging which pictures needing to be typeset can be placed in the page size of a preset page after zooming, storing the sequence of the pictures, determining which pictures needing to be typeset can be placed in the preset page, and then typesetting the pictures according to the method that the pictures are placed in sequence and the position relation between the next placed picture and the previous picture is regulated, so that the pictures can achieve the orderly effect visually, and finally placing a plurality of pictures needing to be typeset into a rectangular preset page, thereby realizing the automatic typesetting of the pictures in the preset page.

Further, the S1 specifically includes:

acquiring a first length value and a first width value of a preset page, and acquiring a first number and a first arrangement sequence of a picture set to be typeset;

acquiring a second length value and a second width value of each picture to be typeset;

the S2 specifically includes:

and respectively zooming the second length value and the second width value of each picture to be typeset according to a preset first proportion to obtain the zoomed picture set.

From the above description, it can be known that the length value and the width value of the preset page are obtained, the length value and the width value of the picture to be typeset are obtained, and the scaling of the picture to be typeset can be conveniently realized by changing the length value and the width value and simultaneously keeping the proportion between the length value and the width value.

Further, the S3 specifically includes:

sequentially putting the zoom pictures in the zoom picture set into the preset page according to the first arrangement order until new zoom pictures cannot be put into the preset page, and marking the zoom pictures in the preset page as first pictures at the moment to obtain a first picture set;

and taking the sequence of the first pictures in the preset page as a second arrangement sequence.

According to the description, the zoom pictures in the zoom picture set are sequentially placed into the preset page according to the first arrangement sequence, and the total number of the pictures which can be placed into the preset page is determined until the new zoom pictures cannot be placed into the preset page, so that the pictures which are confirmed to be placed into the preset page can be successfully placed into the preset page at last, and the typesetting visual effect is tidy.

Further, the S4 specifically includes:

s41, acquiring a second picture located at the first sequence position in the first picture set, and placing the second picture at the upper right position of the preset page;

s42, adjusting the scaling of the second picture until the third length value or the third width value of the second picture is equal to the first length value or the first width value of the preset page, judging whether the rest part of the preset page can be placed in other pictures except the second picture in the first picture set at the moment, if so, executing S43, otherwise, executing S44;

s43, saving the scaling as the second scale, and marking the new first length value-the third length value or the new first width value-the third width value; acquiring a third picture next to the second picture, placing the third picture at the right side or below the second picture, and executing the step S42 with the third picture as the second picture;

s44, obtaining a third picture next to the second picture, placing the third picture on the right side of the second picture, and splicing the second picture and the third picture to obtain a rectangular fourth picture; performing the S42 with the fourth picture as the second picture.

According to the description, the minimum margin of the finally formed typesetting result and the orderly arrangement of the pictures can be ensured by taking whether the length or the width of the preset page can be fully paved and whether other pages can be put down after the preset page as the evaluation standard for putting the first picture set in the preset page, and the automatic typesetting can be realized without manual alignment.

Further, the step S5 is followed by:

and automatically scoring the final page according to whether the final page is fully paved and the difference value of the area of the minimum picture and the area of the maximum picture in the final page.

As can be seen from the above description, after the automatic typesetting is completed, the grading is automatically performed according to the typesetting result, which can help to optimize the typesetting mode and provide intuitive typesetting effect comparison for the user.

Referring to fig. 2, an intelligent composition terminal includes a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor executes the computer program to implement the following steps:

s1, acquiring the page size of a preset page, the first number and the first arrangement sequence of the picture sets to be typeset;

s2, zooming each picture to be typeset in the picture set to be typeset according to a preset first proportion to obtain a zoomed picture set;

s3, obtaining a first picture set which can be put in the preset page and a second arrangement sequence of the first picture set according to the zooming picture set, the first arrangement sequence and the size of the preset page;

s4, acquiring a second picture located at a first sequence position in the first picture set, and placing the second picture at a first position of the preset page; acquiring a third picture next to the second picture, and placing the third picture at the right side or below the first picture;

and S5, repeating the step S4 until the number of the remaining pictures in the first picture set is 0, and marking the preset page as a final page and outputting the final page.

The invention has the beneficial effects that: the method comprises the steps of obtaining a picture set needing to be typeset, firstly zooming pictures needing to be typeset in the picture set needing to be typeset according to a preset proportion, then judging which pictures needing to be typeset can be placed in the page size of a preset page after zooming, storing the sequence of the pictures, determining which pictures needing to be typeset can be placed in the preset page, and then typesetting the pictures according to the method that the pictures are placed in sequence and the position relation between the next placed picture and the previous picture is regulated, so that the pictures can achieve the orderly effect visually, and finally placing a plurality of pictures needing to be typeset into a rectangular preset page, thereby realizing the automatic typesetting of the pictures in the preset page.

Further, the S1 specifically includes:

acquiring a first length value and a first width value of a preset page, and acquiring a first number and a first arrangement sequence of a picture set to be typeset;

acquiring a second length value and a second width value of each picture to be typeset;

the S2 specifically includes:

and respectively zooming the second length value and the second width value of each picture to be typeset according to a preset first proportion to obtain the zoomed picture set.

From the above description, it can be known that the length value and the width value of the preset page are obtained, the length value and the width value of the picture to be typeset are obtained, and the scaling of the picture to be typeset can be conveniently realized by changing the length value and the width value and simultaneously keeping the proportion between the length value and the width value.

Further, the S3 specifically includes:

sequentially putting the zoom pictures in the zoom picture set into the preset page according to the first arrangement order until new zoom pictures cannot be put into the preset page, and marking the zoom pictures in the preset page as first pictures at the moment to obtain a first picture set;

and taking the sequence of the first pictures in the preset page as a second arrangement sequence.

According to the description, the zoom pictures in the zoom picture set are sequentially placed into the preset page according to the first arrangement sequence, and the total number of the pictures which can be placed into the preset page is determined until the new zoom pictures cannot be placed into the preset page, so that the pictures which are confirmed to be placed into the preset page can be successfully placed into the preset page at last, and the typesetting visual effect is tidy.

Further, the S4 specifically includes:

s41, acquiring a second picture located at the first sequence position in the first picture set, and placing the second picture at the upper right position of the preset page;

s42, adjusting the scaling of the second picture until the third length value or the third width value of the second picture is equal to the first length value or the first width value of the preset page, judging whether the rest part of the preset page can be placed in other pictures except the second picture in the first picture set at the moment, if so, executing S43, otherwise, executing S44;

s43, saving the scaling as the second scale, and marking the new first length value-the third length value or the new first width value-the third width value; acquiring a third picture next to the second picture, placing the third picture at the right side or below the second picture, and executing the step S42 with the third picture as the second picture;

s44, obtaining a third picture next to the second picture, placing the third picture on the right side of the second picture, and splicing the second picture and the third picture to obtain a rectangular fourth picture; performing the S42 with the fourth picture as the second picture.

According to the description, the minimum margin of the finally formed typesetting result and the orderly arrangement of the pictures can be ensured by taking whether the length or the width of the preset page can be fully paved and whether other pages can be put down after the preset page as the evaluation standard for putting the first picture set in the preset page, and the automatic typesetting can be realized without manual alignment.

Further, the step S5 is followed by:

and automatically scoring the final page according to whether the final page is fully paved and the difference value of the area of the minimum picture and the area of the maximum picture in the final page.

As can be seen from the above description, after the automatic typesetting is completed, the grading is automatically performed according to the typesetting result, which can help to optimize the typesetting mode and provide intuitive typesetting effect comparison for the user.

Referring to fig. 1, a first embodiment of the present invention is:

an intelligent typesetting method comprises the following steps:

s1, obtaining the page size of the preset page, the first number and the first arrangement sequence of the picture sets to be typeset, specifically: acquiring a first length value and a first width value of a preset page, and acquiring a first number and a first arrangement sequence of a picture set to be typeset; acquiring a second length value and a second width value of each picture to be typeset;

s2, zooming each picture to be typeset in the picture set to be typeset according to a preset first proportion to obtain a zoomed picture set, which specifically comprises: respectively zooming the second length value and the second width value of each picture to be typeset according to a preset first proportion to obtain a zoomed picture set;

s3, obtaining a first picture set which can be put in the preset page and a second arrangement sequence of the first picture set according to the zooming picture set, the first arrangement sequence and the size of the preset page;

in this embodiment, S3 specifically includes: sequentially putting the zoom pictures in the zoom picture set into the preset page according to the first arrangement order until new zoom pictures cannot be put into the preset page, and marking the zoom pictures in the preset page as first pictures at the moment to obtain a first picture set; taking the sequence of the first pictures in the preset page as a second arrangement sequence;

specifically, if the remaining length of the length or width of the preset page is less than one side (length or width) of a zoom picture, a new zoom picture cannot be placed in the preset page;

if the number of the first pictures in the first picture set corresponding to a preset page is 0, obtaining the first ordered alternative pictures in the zoom picture set at the moment, zooming the alternative pictures until the alternative pictures can be placed in the preset page, and enabling the number of the first pictures in the first picture set which win by the preset page to be 1;

s4, acquiring a second picture located at a first sequence position in the first picture set, and placing the second picture at a first position of the preset page; acquiring a third picture next to the second picture, and placing the third picture at the right side or below the first picture;

the method specifically comprises the following steps:

s41, acquiring a second picture located at the first sequence position in the first picture set, and placing the second picture at the upper right position of the preset page;

s42, adjusting the scaling of the second picture until the third length value or the third width value of the second picture is equal to the first length value or the first width value of the preset page, judging whether the rest part of the preset page can be placed in other pictures except the second picture in the first picture set at the moment, if so, executing S43, otherwise, executing S44;

wherein, until the third length value or the third width value of the second picture is equal to the first length value or the first width value of the preset page, the method comprises the following steps: the third length value of the second picture is equal to the first length value of the preset page, or the third width value of the second picture is equal to the first width value of the preset page;

the length of the picture is only compared with the length of the preset page because the picture is not rotated in the typesetting process;

s43, saving the scaling as the second scale, and marking the new first length value-the third length value or the new first width value-the third width value; acquiring a third picture next to the second picture, placing the third picture at the right side or below the second picture, and executing the step S42 with the third picture as the second picture;

s44, obtaining a third picture next to the second picture, placing the third picture on the right side of the second picture, and splicing the second picture and the third picture to obtain a rectangular fourth picture; performing the S42 with the fourth picture as the second picture;

s5, repeatedly executing the S4 until the number of the remaining pictures in the first picture set is 0, and marking the preset page as a final page and outputting the final page;

s6, automatically scoring the final page according to whether the final page is fully paved and the difference value between the area of the minimum picture and the area of the maximum picture in the final page;

in this embodiment, when scaling a picture, the aspect ratio of the picture is not changed.

Referring to fig. 3 to 12, a second embodiment of the present invention is:

applying the above-mentioned intelligent typesetting method to an actual scene, referring to fig. 3, taking four pictures in the first picture set as an example, picture 1 is 216 pixels long, 114 pixels wide, picture 2 is 90 pixels long, 58 pixels wide, picture 3 is 148 pixels long, 124 pixels wide, picture 4 is 124 pixels long, 62 pixels wide, and the preset page is a rectangular container with 138 pixels long and 157 pixels wide;

zooming four first pictures in the first picture set according to a preset first proportion;

obtaining a shorter side of the first picture, if the shorter side is wide, the first proportion is the ratio of one fourth of the width of the preset page to the width of the first picture, and recording as: p ═ h0/4)/h1Wherein P represents a first ratio, h0Represents a quarter of the width of a preset page, h in this embodiment0Is 39.25; h is1Indicating the width of the first picture, h if picture 1 is taken1Is 114;

if the shorter side is long, the first ratio is the ratio of one fourth of the length of the preset page to the width of the first picture, and is recorded as: p ═ l0/4)/l1Wherein P represents a first ratio, l0Width for representing preset pageOne fourth of (1) in this example0Is 39.25; l1Indicating the length of the first picture, i.e. taking picture 11Is 216;

in an alternative embodiment, the first picture is verified after being scaled down by a first scale; referring to fig. 8, a dashed line frame is a comparison graph obtained by dividing the length and width of the preset page by a quarter; after the first picture is reduced according to the first proportion, verifying whether the first picture can cover the comparison graph, and if the first picture can cover the comparison graph, passing the verification;

referring to fig. 9, the two pictures are respectively scaled according to the same ratio and then merged, and the two pictures are merged and then scaled according to the same ratio, so that the final result of scaling is not changed, as can be seen from the above steps, the new length, 74.37 pixels, and the new width, 39.25 pixels are obtained after the picture 1 is scaled, and in this embodiment, the layout process is described by taking fig. 4 as an example:

s41, acquiring a picture 1, and placing the picture 1 at the upper right position of the preset page, specifically, overlapping the left side of the picture 1 with the left side of the preset page, and overlapping the upper side of the picture 1 with the upper side of the preset page;

in an alternative embodiment, if the preset page is provided with a blank area, the left side is overlapped with the boundary between the upper side and the blank area, such as the upper blank area is set in fig. 4;

s42, adjusting the scaling of the picture 1, if the length 74.37 is increased to 198, the width at this time is 104.405, and combining the length and width data of the pictures 2 to 4 provided above, it can be determined without any doubt, if the length or width value is completely filled with the picture 1, the rest pictures cannot be put in the preset page, and S44 is executed;

s44, obtaining a next picture 2 of the picture 1, placing the picture 2 at the right side of the picture 1, and splicing the picture 1 and the picture 2 to obtain a rectangular fourth picture; referring to the calculation process in S42, at this time, if the fourth picture can be placed into the pictures 3 and 4 after the length value or the width value is completely filled, then S45 is executed;

and S45, keeping the state of the fourth picture with the completely filled length value, placing the picture 3 on the left side of the remaining position, judging whether the remaining position of the picture 3 with the completely filled length value or width value can be placed into the picture 4, if so, adjusting the picture 4 to be the maximum value which can be placed after the picture 3 is completely filled with the length value or width value, and finishing typesetting, otherwise, splicing the picture 3 and the picture 4 and enabling the picture 3 and the picture 4 to be maximally filled into the remaining position, and finishing typesetting.

Referring to fig. 2, a third embodiment of the present invention is:

an intelligent typesetting terminal 1 comprises a processor 2, a memory 3 and a computer program which is stored on the memory 3 and can run on the processor 2, wherein the processor 2 executes the computer program to realize the steps of the first embodiment or the second embodiment.

To sum up, the invention provides an intelligent typesetting method and a terminal, acquiring a picture set to be typeset, firstly zooming pictures to be typeset in the picture set to be typeset according to a preset proportion, then judging that several zoomed pictures to be typeset can be put into the page size of a preset page, accurately determining the number of pictures which can be put into each preset page, simultaneously saving the sequence of the pictures, determining which specific pictures to be typeset need to be put into the preset page are, then typesetting the pictures according to the method of putting the pictures in sequence and defining the position relationship between the next picture and the previous picture, specifically, each picture judges whether the maximum filling of vacant positions can be realized under the condition that the putting of other pictures is not influenced, so that the pictures can achieve the orderly effect visually, and finally, a plurality of pictures to be typeset can be put into a rectangular preset page, and realizing automatic typesetting of the pictures in the preset page.

The above description is only an embodiment of the present invention, and not intended to limit the scope of the present invention, and all equivalent changes made by using the contents of the present specification and the drawings, or applied directly or indirectly to the related technical fields, are included in the scope of the present invention.

16页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:文本匹配方法、装置、计算机可读存储介质和计算机设备

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!