Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
The invention provides a focus display method, which is used for adapting parallelogram pictures with different sizes on the premise of no distortion of a point nine picture.
As shown in fig. 1, fig. 1 is a schematic terminal structure diagram of a hardware operating environment according to an embodiment of the present invention.
The terminal of the embodiment of the invention can be a television, and can also be a mobile terminal device with a display function, such as a PC, a tablet computer, a portable computer and the like.
As shown in fig. 1, the terminal may include: a processor 1001, such as a CPU, a network interface 1004, a user interface 1003, a memory 1005, a communication bus 1002. Wherein a communication bus 1002 is used to enable connective communication between these components. The user interface 1003 may include a Display screen (Display), an input unit such as a Keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface, a wireless interface. The network interface 1004 may optionally include a standard wired interface, a wireless interface (such as a non-volatile memory, e.g., disk storage) and the memory 1005 may optionally also be a storage device separate from the processor 1001.
Those skilled in the art will appreciate that the configuration of the terminal shown in fig. 1 is not intended to be limiting and may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components.
As shown in fig. 1, a memory 1005, which is a kind of computer storage medium, may include therein an operating system, a network communication module, a user interface module, and a focus display program.
In the terminal shown in fig. 1, the network interface 1004 is mainly used for connecting to a backend server and performing data communication with the backend server; the user interface 1003 is mainly used for connecting a client (user side) and performing data communication with the client; and the processor 1001 may be configured to call the focus display program stored in the memory 1005, and perform the following operations:
acquiring attribute information of a picture corresponding to the position of a focus to be displayed, wherein the attribute information comprises the size and the inclination angle of the picture;
adjusting a preset focal point picture according to the size of the picture so that the size of the preset focal point picture is consistent with that of the picture, and adjusting the canvas of the current interface according to the inclination angle of the picture so that the inclination angle of the canvas is consistent with that of the picture;
and drawing the preset focus picture at the position of the focus to be displayed in the canvas, wherein the preset focus picture is a transparent picture.
Further, the processor 1001 may call the focus display program stored in the memory 1005, and also perform the following operations:
stretching the stretchable region of the preset focal point picture to make the size of the preset focal point picture consistent with the size of the picture.
Further, the processor 1001 may call the focus display program stored in the memory 1005, and also perform the following operations:
and carrying out staggered cutting on the canvas so as to enable the inclination angle of the canvas to be consistent with that of the picture.
Further, the processor 1001 may call the focus display program stored in the memory 1005, and also perform the following operations:
switching the attribute of the canvas from invalid conversion to valid conversion, wherein when the attribute of the canvas is valid conversion, the picture and the preset focal point picture in the canvas are inclined according to the inclination angle of the canvas, and when the attribute of the canvas is invalid conversion, the picture and the preset focal point picture in the canvas are not inclined according to the inclination angle of the canvas;
and drawing the preset focal point picture at the position of the focal point to be displayed in the canvas.
Further, the processor 1001 may call the focus display program stored in the memory 1005, and also perform the following operations:
switching the attribute of the canvas from transformation effective to transformation ineffective;
restoring the original state of the canvas;
before the canvas is cut by mistake, the method further comprises the following steps:
and memorizing the original state of the canvas.
Further, the processor 1001 may call the focus display program stored in the memory 1005, and also perform the following operations:
acquiring the sizes of all pictures in the current interface;
and generating the preset focal point image according to the size, wherein the size of the preset focal point image is smaller than the sizes of all images in the interface.
Referring to fig. 2, in a first embodiment, the focus display method includes:
step S10, acquiring attribute information of a picture corresponding to the position of the focus to be displayed, wherein the attribute information comprises the size and the inclination angle of the picture corresponding to the position of the focus to be displayed;
in the first embodiment, in the display interface of the television, in order to improve the UI experience of the user, the poster is often displayed in an irregular shape, such as a parallelogram. The poster display method comprises the following steps: and drawing the poster on the canvas of the current interface, and displaying the poster. Therefore, when the focus is displayed on the poster, a preset focus picture is drawn at the position of the poster in the canvas, and the poster displays the focus.
The size of the picture refers to the length and width of the picture, and the inclination of the picture may be an inclination in the X direction or an inclination in the Y direction.
Step S20, adjusting a preset focus picture according to the size of the picture corresponding to the position of the focus to be displayed, so that the size of the preset focus picture is consistent with the size of the picture corresponding to the position of the focus to be displayed, and adjusting the canvas of the current interface according to the inclination angle of the picture corresponding to the position of the focus to be displayed, so that the inclination angle of the canvas is consistent with the inclination angle of the picture corresponding to the position of the focus to be displayed;
in the first embodiment, the preset focus picture is generated by a point nine manufacturing tool of the android standard, which is a point nine picture. The preset focal point picture is a rectangle, and a certain area of the rectangle is set as a stretchable area, such as the right and the lower sides of the rectangle. And the length and the width of the preset focus picture are consistent with those of the picture corresponding to the position of the focus to be displayed through stretching. The method comprises the following specific steps: firstly, the length and the width of a picture corresponding to the position of a focus to be displayed are obtained, and then the stretchable area of the preset focus picture is stretched, so that the length and the width of the preset focus picture are respectively consistent with the length and the width of the picture. For example, the length and width of the picture are 20cm and 10cm, respectively, and then the length and width of the preset focal point picture are also extended to 20cm and 10cm, respectively.
In the first embodiment, the picture of the android system and the preset focus picture are drawn on the canvas of the interface first and then displayed on the interface. The canvas has two attributes of conversion invalidity and conversion validity, wherein when the attribute of the canvas is conversion validity, the picture in the canvas and the preset focus picture are inclined according to the inclination angle of the canvas, and when the attribute of the canvas is conversion invalidity, the picture in the canvas and the preset focus picture are not inclined along with the inclination of the canvas. The attribute of the canvas can be switched, for example, when the inclination angle of the canvas is adjusted, the attribute of the canvas is invalid for conversion, and pictures on the canvas do not incline along with the inclination of the canvas; the adjustment of the inclination angle of the canvas is completed, and before the preset focus picture is drawn, the attribute of the canvas is switched to be effective, so that the inclination angle of the preset focus picture drawn on the canvas is consistent with the inclination angle of the canvas. It should be noted that the condition for triggering attribute switching is preset, and when the preset condition is met, the attribute switching is performed, where the preset condition may be that the adjustment of the inclination angle of the canvas is completed and the preset focus picture is not yet drawn, or that the drawing of the preset focus picture is completed and the attribute information of the picture corresponding to the position of the focus to be displayed is not yet acquired, and the present invention is not particularly limited.
And step S30, drawing the preset focus picture at the position of the focus to be displayed in the canvas, wherein the preset focus picture is a transparent picture.
In the first embodiment, the preset focal point image is a transparent image, and is drawn on the image of the interface to highlight the image.
In the first embodiment, when the size and the inclination angle of the picture corresponding to the position of the focus to be displayed are obtained, the transparent preset focus picture is adjusted according to the size of the picture, and the canvas of the current interface is adjusted according to the inclination angle of the picture, so that the size of the preset focus picture is consistent with the size of the picture, and the inclination angle of the canvas is consistent with the inclination angle of the picture. Therefore, when the preset focus picture is drawn at the position of the focus to be displayed in the canvas, the size and the inclination angle of the preset focus picture are consistent with those of the picture, and the picture is highlighted.
In a second embodiment, as shown in fig. 3, on the basis of the first embodiment shown in fig. 2, the step of adjusting the preset focal point picture according to the size of the picture corresponding to the position of the focal point to be displayed includes:
and step S21, stretching the stretchable region of the preset focus picture to make the size of the preset focus picture consistent with the size of the picture corresponding to the position of the focus to be displayed.
In the second embodiment, the preset focus picture is generated by a point nine manufacturing tool of the android standard, which is a point nine picture. The method is characterized in that a nine-point picture, namely 9, is a special picture form in the application software development of the android platform, and the file extension name is as follows: 9. png. The preset focal point image is a rectangle, and a certain region of the rectangle is set as a stretchable region, such as the right side and the lower side of the rectangle, or the left side and the upper side of the rectangle, which is not limited in the present invention.
It should be noted that the size of the preset focus image refers to the length and width of the preset focus image, and the size of the picture refers to the length and width of the picture corresponding to the position of the focus to be displayed. And stretching the stretchable region of the preset focal point picture to enable the length and width of the preset focal point picture to be consistent with the length and width of the picture corresponding to the position of the focal point to be displayed. The method comprises the following specific steps: firstly, the length and the width of the picture are acquired, and then the stretchable area of the preset focal point picture is stretched, so that the length and the width of the preset focal point picture are respectively consistent with the length and the width of the picture. For example, the length and width of the picture are 20cm and 10cm, respectively, and then the length and width of the preset focal point picture are also extended to 20cm and 10cm, respectively.
In the second embodiment, stretching the stretchable region of the preset focal point picture realizes that the length and width of the preset focal point picture respectively accord with the length and width of the picture.
In a third embodiment, as shown in fig. 4, on the basis of the first embodiment shown in fig. 2, the step of adjusting the canvas of the current interface according to the tilt angle of the picture corresponding to the position of the focus to be displayed includes:
and step S22, performing miscut on the canvas to enable the inclination angle of the canvas to be consistent with the inclination angle of the picture corresponding to the position of the focus to be displayed.
In a third embodiment, the miscut is a planar graph obtained by scaling the directional distance from each point of the graph to a line parallel to a certain direction according to a certain proportion in the certain direction. Among them, the miscut usually includes X-direction miscut and Y-direction miscut. By the aid of the staggered cutting, the inclination angle of the canvas is consistent with that of the picture. The method comprises the following specific steps: firstly, determining whether a picture corresponding to the position of a focus to be displayed is inclined in the X direction or the Y direction, then obtaining the inclination angle in the direction, and inclining the canvas in the same direction by the same angle. For example, the picture corresponding to the position of the focus to be displayed is inclined by sixty degrees in the X direction, and then the canvas is also inclined by sixty degrees in the X direction by the cross-cut.
In a third embodiment, the canvas is cut in a staggered manner, so that the inclination angle of the canvas is consistent with that of the picture.
In a fourth embodiment, as shown in fig. 5, based on the first embodiment shown in fig. 2, the step of drawing the preset focal point picture at the position of the focal point to be displayed in the canvas includes:
step S31, the attribute of the canvas is switched from invalid conversion to valid conversion, wherein when the attribute of the canvas is valid conversion, the picture corresponding to the position of the focus to be displayed in the canvas and the preset focus picture are inclined according to the inclination angle of the canvas, and when the attribute of the canvas is invalid conversion, the picture corresponding to the position of the focus to be displayed in the canvas and the preset focus picture are not inclined according to the inclination angle of the canvas;
and step S32, drawing the preset focal point picture at the position of the focal point to be displayed in the canvas.
In a fourth embodiment, the canvas has two attributes, transform valid and transform invalid. When the property of the canvas is effective, the picture in the canvas and the picture with the preset focus are inclined along with the inclination of the canvas. For example, when the inclination angle of the canvas is consistent with the inclination angle of the picture, the attribute of the canvas is switched to be effective in transformation, so that when the position where the focus is to be displayed is drawn to preset the focus picture, the preset focus picture is inclined along with the inclination of the canvas. When the property of the canvas is that the transformation is invalid, the picture in the canvas and the preset focus picture are not inclined along with the inclination of the canvas. For example, when the focus is displayed on the picture corresponding to the position of the focus to be displayed, the attribute of the canvas is switched from effective conversion to ineffective conversion, so that when the canvas is restored to the original state, the picture in the canvas and the preset focus picture are not inclined along with the inclination of the canvas.
It should be noted that the attribute of the canvas may be switched, the condition for triggering attribute switching is preset, and when the preset condition is met, the attribute switching is performed, where the preset condition may be that the adjustment of the inclination angle of the canvas is completed and the preset focal point picture is not yet drawn, or that the preset focal point picture is drawn and the attribute information of the picture corresponding to the position of the focal point to be displayed is not yet acquired, and the present invention is not particularly limited.
In the fourth embodiment, the attribute of the canvas is switched from invalid to valid, and a preset focus picture is drawn at the position of the focus to be displayed in the canvas, so that the preset focus picture is inclined according to the inclination angle of the canvas.
In a fifth embodiment, as shown in fig. 6, on the basis of the fourth embodiment shown in fig. 5, after the drawing the preset focal point picture at the position of the focal point to be displayed in the canvas, the method further includes:
step S33, the attribute of the canvas is switched from effective transformation to ineffective transformation;
and step S34, restoring the original state of the canvas.
In the fifth embodiment, before the cloth is cut by mistake, the original state of the canvas is memorized, and after the picture display focus corresponding to the position of the focus to be displayed is displayed, the original state of the canvas can be quickly recovered. It should be noted that the original state of the canvas is a rectangle, and the canvas is tilted by a certain angle in the X direction or the Y direction by the cross cutting.
In a fifth embodiment, the properties of the canvas are switched from transformation-valid to transformation-invalid and the original state of the canvas is restored. Therefore, when the inclination angle of the picture corresponding to the position of the focus to be displayed is obtained, the canvas is cut in a staggered mode according to the inclination angle of the picture.
In a sixth embodiment, as shown in fig. 7, on the basis of the first embodiment shown in fig. 2, before the obtaining of the attribute information of the picture corresponding to the position of the focus to be displayed, the method further includes:
step S40, acquiring the sizes of all pictures in the current interface;
and step S50, generating the preset focal point image according to the size, wherein the size of the preset focal point image is smaller than the sizes of all the images in the interface.
In the sixth embodiment, the preset focus picture is generated by a point nine manufacturing tool of the android standard, which is a point nine picture. Since the dot nine picture can only be stretched and can not be compressed, the size of the dot nine picture generated is smaller than that of all pictures in the interface. The size of the point nine picture may be set to be eighty percent of the size of the smallest picture of the current interface, for example, the length of the smallest picture in the current interface is 10cm, and the width of the smallest picture in the current interface is 5cm, and then the length of the generated point nine picture may be 8cm, and the width of the generated point nine picture may be 4 cm.
In a sixth embodiment, the sizes of all pictures in the current interface are obtained, and a preset focal point picture is generated, where the size of the preset focal point picture is smaller than the sizes of all pictures in the interface. In this way, it is ensured that the generated preset focus picture can fit the sizes of all pictures in the interface.
The present invention also provides a focus display apparatus, including: a focus display program configured to implement operations of:
acquiring attribute information of a picture corresponding to the position of a focus to be displayed, wherein the attribute information comprises the size and the inclination angle of the picture corresponding to the position of the focus to be displayed;
adjusting a preset focus picture according to the size of the picture corresponding to the position of the focus to be displayed, so that the size of the preset focus picture is consistent with the size of the picture corresponding to the position of the focus to be displayed, and adjusting the canvas of the current interface according to the inclination angle of the picture corresponding to the position of the focus to be displayed, so that the inclination angle of the canvas is consistent with the inclination angle of the picture corresponding to the position of the focus to be displayed;
and drawing the preset focus picture at the position of the focus to be displayed in the canvas, wherein the preset focus picture is a transparent picture.
Further, the focus display program is configured to implement the following operations:
stretching the stretchable area of the preset focal point picture to enable the size of the preset focal point picture to be consistent with the size of the picture corresponding to the position of the to-be-displayed focal point.
Further, the focus display program is configured to implement the following operations:
and carrying out cross cutting on the canvas so as to enable the inclination angle of the canvas to be consistent with the inclination angle of the picture corresponding to the position of the focus to be displayed.
Further, the focus display program is configured to implement the following operations:
switching the attribute of the canvas from invalid conversion to valid conversion, wherein when the attribute of the canvas is valid conversion, the picture corresponding to the position of the focal point to be displayed in the canvas and the preset focal point picture are inclined according to the inclination angle of the canvas, and when the attribute of the canvas is invalid conversion, the picture corresponding to the position of the focal point to be displayed in the canvas and the preset focal point picture are not inclined according to the inclination angle of the canvas;
and drawing the preset focal point picture at the position of the focal point to be displayed in the canvas.
Further, the focus display program is configured to implement the following operations:
switching the attribute of the canvas from transformation effective to transformation ineffective;
restoring the original state of the canvas;
before the canvas is cut by mistake, the method further comprises the following steps:
and memorizing the original state of the canvas.
Further, the focus display program is configured to implement the following operations:
acquiring the sizes of all pictures in the current interface;
and generating the preset focal point image according to the size, wherein the size of the preset focal point image is smaller than the sizes of all images in the interface.
The focus display device provided by the invention firstly obtains the attribute information of the picture corresponding to the position of the focus to be displayed, wherein the attribute information comprises the size and the inclination angle of the picture corresponding to the position of the focus to be displayed, then, adjusting a preset focus picture according to the size of the picture corresponding to the position of the focus to be displayed, so that the size of the preset focus picture is consistent with the size of the picture corresponding to the position of the focus to be displayed, and adjusting the canvas of the current interface according to the inclination angle of the picture corresponding to the position of the focus to be displayed, so that the inclination angle of the canvas is consistent with the inclination angle of the picture corresponding to the position of the focus to be displayed, and finally, and drawing the preset focus picture at the position of the focus to be displayed in the canvas, wherein the preset focus picture is a transparent picture. Therefore, the point nine picture is adaptive to the parallelogram pictures with different sizes on the premise of no distortion.
An embodiment of the present invention further provides a computer-readable storage medium, where a focus display program is stored on the computer-readable storage medium, and the focus display program is executed by a processor to implement the following operations:
acquiring attribute information of a picture corresponding to the position of a focus to be displayed, wherein the attribute information comprises the size and the inclination angle of the picture corresponding to the position of the focus to be displayed;
adjusting a preset focus picture according to the size of the picture corresponding to the position of the focus to be displayed, so that the size of the preset focus picture is consistent with the size of the picture corresponding to the position of the focus to be displayed, and adjusting the canvas of the current interface according to the inclination angle of the picture corresponding to the position of the focus to be displayed, so that the inclination angle of the canvas is consistent with the inclination angle of the picture corresponding to the position of the focus to be displayed;
and drawing the preset focus picture at the position of the focus to be displayed in the canvas, wherein the preset focus picture is a transparent picture.
Further, the focus display program is executed by the processor to implement the following operations:
stretching the stretchable area of the preset focal point picture to enable the size of the preset focal point picture to be consistent with the size of the picture corresponding to the position of the to-be-displayed focal point.
Further, the focus display program is executed by the processor to implement the following operations:
and carrying out cross cutting on the canvas so as to enable the inclination angle of the canvas to be consistent with the inclination angle of the picture corresponding to the position of the focus to be displayed.
Further, the focus display program is executed by the processor to implement the following operations:
switching the attribute of the canvas from invalid conversion to valid conversion, wherein when the attribute of the canvas is valid conversion, the picture corresponding to the position of the focal point to be displayed in the canvas and the preset focal point picture are inclined according to the inclination angle of the canvas, and when the attribute of the canvas is invalid conversion, the picture corresponding to the position of the focal point to be displayed in the canvas and the preset focal point picture are not inclined according to the inclination angle of the canvas;
and drawing the preset focal point picture at the position of the focal point to be displayed in the canvas.
Further, the focus display program is executed by the processor to implement the following operations:
switching the attribute of the canvas from transformation effective to transformation ineffective;
restoring the original state of the canvas;
before the canvas is cut by mistake, the method further comprises the following steps:
and memorizing the original state of the canvas.
Further, the focus display program is executed by the processor to implement the following operations:
acquiring the sizes of all pictures in the current interface;
and generating the preset focal point image according to the size, wherein the size of the preset focal point image is smaller than the sizes of all images in the interface.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. 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 (e.g., ROM/RAM, magnetic disk, optical disk) as described above and includes instructions for enabling a terminal device (e.g., a television, a mobile phone, a computer, a server, an air conditioner, or a network device) to execute the method according to the embodiments of the present invention.
The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.