CN113032060A - Visual element display method and device and terminal - Google Patents

Visual element display method and device and terminal Download PDF

Info

Publication number
CN113032060A
CN113032060A CN201911345449.0A CN201911345449A CN113032060A CN 113032060 A CN113032060 A CN 113032060A CN 201911345449 A CN201911345449 A CN 201911345449A CN 113032060 A CN113032060 A CN 113032060A
Authority
CN
China
Prior art keywords
visual element
pixel
display device
display
calculating
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.)
Pending
Application number
CN201911345449.0A
Other languages
Chinese (zh)
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.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen 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 Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN201911345449.0A priority Critical patent/CN113032060A/en
Publication of CN113032060A publication Critical patent/CN113032060A/en
Pending legal-status Critical Current

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

Abstract

The embodiment of the invention discloses a visual element display method, a device and a terminal, wherein the visual element display method comprises the following steps: acquiring a target display size of a visual element in a screen of a first display device; acquiring the number of dots per inch and the pixel density of a screen of first display equipment; calculating the number of first device independent pixels of the visual element in the first display device according to the number of points per inch, the pixel density and the target display size; and controlling the visual element to be displayed on the screen of the first display device according to the number of the independent pixels of the first device. According to the visual element display method provided by the embodiment of the invention, the number of the first equipment independent pixels of the visual element in the display equipment is accurately calculated according to the number of points per inch, the pixel density and the target display size of the visual element of the display equipment, so that the actual display size of the visual element is consistent with the target display size, the interface design of the display equipment is more convenient, and the reading and viewing effects of a user are improved.

Description

Visual element display method and device and terminal
Technical Field
The invention relates to the technical field of computers, in particular to a visual element display method, a visual element display device and a terminal.
Background
With the development of communication technology, mobile terminals such as mobile phones, tablet computers, and the like have become popular. For mobile phones or tablet computers with different sizes, sizes of visual elements such as characters, symbols and pictures displayed on screens of the mobile phones or tablet computers are different, so that inconvenience is brought to design of mobile phone interfaces.
Disclosure of Invention
The invention provides a method, a device and a terminal for displaying visual elements, which are used for keeping the target display size of the visual elements in an interface of display equipment consistent with the actual display size and enabling the interface design of the display equipment to be more convenient.
In a first aspect, the present invention provides a visual element display method, comprising:
acquiring a target display size of a visual element in a screen of a first display device;
acquiring the number of dots per inch and the pixel density of a screen of the first display device;
calculating the number of first device independent pixels of the visual element in the first display device according to the points per inch, the pixel density and the target display size;
and controlling the visual element to be displayed on the screen of the first display device according to the number of the independent pixels of the first device.
In some embodiments of the present invention, said calculating a number of first device independent pixels of the visual element in the first display device from the dots per inch, the pixel density, and the target display size comprises:
calculating the number of pixel points contained in each independent pixel of the first equipment according to the points per inch;
calculating the length of the pixel point according to the pixel density;
calculating the length of the first equipment independent pixel according to the number of pixel points contained in the first equipment independent pixel and the length of the pixel points;
and calculating a first ratio of the target display size to the length of the first device independent pixels to obtain the number of the first device independent pixels of the visual element in the first display device.
In some embodiments of the invention, the obtaining a target size of the visual element in the first display device comprises:
and acquiring the actual display size of the visual element in the screen of the second display device as the target display size.
In some embodiments of the invention, the actual display size comprises a number of second device independent pixels of the visual element in a screen of the second display device; the calculating the number of first device independent pixels of the visual element in the first display device according to the number of dots per inch, the pixel density and the target display size comprises:
and calculating the number of first equipment independent pixels of the visual element in the first display equipment according to the number of the second equipment independent pixels, the points per inch and the pixel density.
In some embodiments of the present invention, said calculating a number of first device independent pixels of the visual element in the first display device from the number of second device independent pixels, the number of dots per inch, and the pixel density comprises:
calculating a second ratio of said number of dots per inch to said pixel density;
and calculating the product of the second ratio and the second device independent pixel to obtain the number of the first device independent pixels of the visual element in the first display device.
In some embodiments of the present invention, said calculating a number of first device independent pixels of the visual element in the first display device from the number of second device independent pixels, the number of dots per inch, and the pixel density comprises:
calculating the number of pixel points contained in each independent pixel of the first equipment according to the points per inch;
calculating the length of the pixel point according to the pixel density;
calculating the length of the first equipment independent pixel according to the number of pixel points contained in the first equipment independent pixel and the length of the pixel points;
acquiring the length of the independent pixel of the second device;
calculating a third ratio of the length of the second device independent pixel to the length of the first device independent pixel;
and calculating the product of the third ratio and the number of the second equipment independent pixels to obtain the number of the first equipment independent pixels of the visual element in the first display equipment.
In some embodiments of the invention, the number of first device independent pixels of the visual element in the first display device is saved in a tile chain in the form of a tile.
In a second aspect, the present invention provides a visual element display apparatus comprising:
a first acquisition unit configured to acquire a target display size of a visual element in a screen of a first display device;
a second acquisition unit configured to acquire a number of dots per inch and a pixel density of a screen of the first display device;
the calculating unit is used for calculating the number of first equipment independent pixels of the visual element in the first display equipment according to the points per inch, the pixel density and the target display size;
and the control unit is used for controlling the visual elements to be displayed on the screen of the first display device according to the number of the independent pixels of the first device.
In some embodiments of the invention, the computing unit comprises:
the first calculating subunit is used for calculating the number of pixel points contained in each first equipment independent pixel according to the points per inch;
the second calculating subunit is used for calculating the length of the pixel point according to the pixel density;
the third calculation subunit is used for calculating the length of the first equipment independent pixel according to the number of the pixel points contained in the first equipment independent pixel and the length of the pixel points;
and the fourth calculating subunit is configured to calculate a first ratio of the target display size to the length of the first device independent pixel, so as to obtain the number of the first device independent pixels of the visual element in the first display device.
In some embodiments of the present invention, the first acquiring unit is configured to acquire an actual display size of the visual element in a screen of the second display device as the target display size.
In some embodiments of the invention, the actual display size comprises a number of second device independent pixels of the visual element in a screen of the second display device; the calculation unit is used for calculating the number of first equipment independent pixels of the visual element in the first display equipment according to the number of the second equipment independent pixels, the number of the points per inch and the pixel density.
In some embodiments of the invention, the computing unit comprises:
a fifth sub-calculation unit for calculating a second ratio of the number of dots per inch to the pixel density;
a sixth sub-calculation unit, configured to calculate a product of the second ratio and the second device independent pixel, so as to obtain the number of first device independent pixels of the visual element in the first display device.
In some embodiments of the invention, the computing unit comprises:
a first number calculating unit, configured to calculate, according to the number of dots per inch, a number of pixels included in each of the first device independent pixels;
the first length calculating unit is used for calculating the length of the pixel point according to the pixel density;
the second length calculation unit is used for calculating the length of the first equipment independent pixel according to the number of pixel points contained in the first equipment independent pixel and the length of the pixel points;
a third acquisition unit configured to acquire a length of the second device independent pixel;
a third ratio calculation unit configured to calculate a third ratio of the length of the second device-independent pixel to the length of the first device-independent pixel;
and a second quantity calculating unit, configured to calculate a product of the third ratio and the number of the second device independent pixels, to obtain the number of the first device independent pixels of the visual element in the first display device.
In some embodiments of the invention, the visual element display apparatus further comprises a blockchain unit for saving the number of first device independent pixels of the visual element in the first display device in a blockchain in the form of a block.
In a third aspect, the present invention provides a terminal, including: a processor and a memory; the memory stores a plurality of instructions, and the processor loads the instructions stored in the memory to perform the steps of the visual element display method of any one of the first aspect.
In a fourth aspect, the present invention provides a computer readable storage medium having stored thereon a computer program which is loaded by a processor to perform the steps of the visual element display method according to any one of the first aspect.
According to the embodiment of the invention, the target display size of the visual element in the screen of the first display device is obtained; acquiring the number of dots per inch and the pixel density of a screen of the first display device; then calculating the number of first equipment independent pixels of the visual elements in the first display equipment according to the number of points per inch, the pixel density and the target display size; and finally, controlling the visual elements to be displayed on a screen of the first display device according to the number of the independent pixels of the first device. According to the embodiment of the invention, the number of the first equipment independent pixels of the visual elements in the first display equipment can be accurately calculated according to the number of the dots per inch, the pixel density and the target display size of the visual elements, and then the actual display size of the visual elements on the screen of the first display equipment can be accurately controlled according to the number of the first equipment independent pixels, so that the actual display size of the visual elements is consistent with the target display size, the interface design of the first display equipment is more convenient, the physical display size can be compressed, and the reading and viewing effects of a user are improved.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
FIG. 1 is a schematic diagram of an application scenario of a visual element display method according to an embodiment of the present invention;
FIG. 2 is a block chain system of a distributed system according to an embodiment of the present invention;
FIG. 3 is a block diagram illustrating an embodiment of a block structure provided in an embodiment of the present invention;
FIG. 4 is a flowchart of one embodiment of a method for displaying visual elements provided in embodiments of the present invention;
FIG. 5 is a schematic flow chart diagram illustrating one embodiment of calculating the number of first device independent pixels of a visual element in a first display device, as provided in embodiments of the present invention;
fig. 6 is a schematic structural diagram of a screen of the first display device in the embodiment of the present invention;
fig. 7 is a schematic structural diagram of a screen of a second display device in the embodiment of the present invention;
FIG. 8 is a schematic diagram of the structure of one embodiment of a visual element display apparatus provided in embodiments of the present invention;
fig. 9 is a schematic structural diagram of a terminal provided in an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
In the description that follows, specific embodiments of the present invention are described with reference to steps and symbols executed by one or more computers, unless otherwise indicated. Accordingly, these steps and operations will be referred to, several times, as being performed by a computer, the computer performing operations involving a processing unit of the computer in electronic signals representing data in a structured form. This operation transforms the data or maintains it at locations in the computer's memory system, which may be reconfigured or otherwise altered in a manner well known to those skilled in the art. The data maintains a data structure that is a physical location of the memory that has particular characteristics defined by the data format. However, while the principles of the invention have been described in language specific to above, it is not intended to be limited to the specific form set forth herein, but on the contrary, it is to be understood that various steps and operations described hereinafter may be implemented in hardware.
The term "module" or "unit" as used herein may be considered a software object executing on the computing system. The various components, modules, engines, and services described herein may be viewed as objects implemented on the computing system. The apparatus and method described herein are preferably implemented in software, but may also be implemented in hardware, and are within the scope of the present invention.
As used herein, the singular forms "a", "an", "the" and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It will be further understood that the terms "comprises" and/or "comprising," when used in this specification, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof. It will be understood that when an element is referred to as being "connected" or "coupled" to another element, it can be directly connected or coupled to the other element or intervening elements may also be present. Further, "connected" or "coupled" as used herein may include wirelessly connected or wirelessly coupled. As used herein, the term "and/or" includes all or any element and all combinations of one or more of the associated listed items.
To facilitate an understanding of the embodiments of the present invention, a few basic concepts that will be introduced in the description of the embodiments of the present invention will be introduced first:
1) px (pixel).
Pixels, also called image elements, are units of size of resolution, and a pixel is actually a color point, so the physical size of the pixel is not fixed. In an electronic device, a large number of different color points form an image, and the size of the image and the resolution of a display are mainly represented by pixels, for example, when the resolution of a screen of a certain electronic device is 1920 × 1080px, the number of pixels of the screen in the horizontal direction (length direction) is 1920, and the number of pixels in the vertical direction (width direction) is 1080.
2) pt (point, device independent pixel).
The length of the device independent pixel (pt) is a fixed value and does not change with the change of the pixel density of the screen. In the iOS system, 1pt is 1/163 inches, and when the screen of the display device is a normal screen, the length of 1 device independent pixel (pt) is equal to the length of 1 pixel point (px); when the screen of the display device is a high definition screen, the length of 1 device independent pixel (pt) is equal to the length of 2 pixel points (px).
3) dp (sensitivity-independent pixel).
The device independent pixel is a length unit for development of an Android system, and the length of the device independent pixel (dp) is a fixed value and does not change with the change of the pixel density of a screen. In the android system, 1dp is 1/160 inches, the length of a device independent pixel (dp) and the length of a pixel point (px) have different multiple relations according to the pixel density of screens of different display devices, and the length of 1 device independent pixel (dp) is equal to the length of 1 pixel point (px) when the pixel density of a screen is 160 ppi. When the screen of the display device is a middle clear screen, the length of 1 device independent pixel (dp) is equal to the length of 1 pixel point (px); when the screen of the display device is high definition, the length of 1 device independent pixel (dp) is equal to the length of 1.5 pixel points (px); when the screen of the display device is super-clear, the length of 1 device independent pixel (dp) is equal to the length of 2 pixel points (px).
4) dpi (Dots Per Inch Per Dots)
Dots per inch is a unit of measure for a Dot-matrix digital image, and refers to the number of sampled, displayable or output dots (dots) per inch of length. For example: a 160dpi screen would indicate that an Inch contains 160 dots, and a 320dpi screen would indicate that an Inch has 320 dots. The dots (Dot) on the screen are different in size for screens with different dots per inch.
5) ppi (pixels per inch, pixel density)
The pixel density is a unit of density for representing the amount of pixels displayed on a 1-inch screen. The higher the pixel density of the screen is, the higher the density of the image displayed on the screen can be represented by the screen, and the finer the details of the picture displayed on the screen can be.
Artificial Intelligence (AI) is a theory, method, technique and application system that uses a digital computer or a machine controlled by a digital computer to simulate, extend and expand human Intelligence, perceive the environment, acquire knowledge and use the knowledge to obtain the best results. In other words, artificial intelligence is a comprehensive technique of computer science that attempts to understand the essence of intelligence and produce a new intelligent machine that can react in a manner similar to human intelligence. Artificial intelligence is the research of the design principle and the realization method of various intelligent machines, so that the machines have the functions of perception, reasoning and decision making.
The artificial intelligence technology is a comprehensive subject and relates to the field of extensive technology, namely the technology of a hardware level and the technology of a software level. The artificial intelligence infrastructure generally includes technologies such as sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing technologies, operation/interaction systems, mechatronics, and the like. The artificial intelligence software technology mainly comprises a computer vision technology, a voice processing technology, a natural language processing technology, machine learning/deep learning and the like.
Machine Learning (ML) is a multi-domain cross discipline, and relates to a plurality of disciplines such as probability theory, statistics, approximation theory, convex analysis, algorithm complexity theory and the like. The special research on how a computer simulates or realizes the learning behavior of human beings so as to acquire new knowledge or skills and reorganize the existing knowledge structure to continuously improve the performance of the computer. Machine learning is the core of artificial intelligence, is the fundamental approach for computers to have intelligence, and is applied to all fields of artificial intelligence. Machine learning and deep learning generally include techniques such as artificial neural networks, belief networks, reinforcement learning, transfer learning, inductive learning, and formal education learning.
The scheme provided by the embodiment of the application can be a visual element display method related to artificial intelligence, namely, the embodiment of the application provides a visual element display method based on artificial intelligence, and the method comprises the following steps: acquiring a target display size of a visual element in a screen of a first display device by using machine learning; acquiring the number of dots per inch and the pixel density of a screen of first display equipment; calculating the number of first device independent pixels of the visual element in the first display device according to the number of points per inch, the pixel density and the target display size; and controlling the visual element to be displayed on the screen of the first display device according to the number of the independent pixels of the first device.
An embodiment of the present invention provides a visual element display method, where an execution main body of the visual element display method may be the visual element display apparatus provided in the embodiment of the present invention, or a terminal integrated with the visual element display apparatus, where the visual element display apparatus may be implemented in a hardware or software manner.
Referring to fig. 1, fig. 1 is a schematic view of an application scenario of a visual element display method according to an embodiment of the present invention, taking an example that a visual element display device is integrated in a terminal, where the terminal is connected to a server through a network, the server may be a working platform server (i.e., a server loaded with a working platform), and the terminal may access the server, obtain display information such as pictures, texts, videos from the server, process the display information, convert the display information into a visual element with a preset size, and display the visual element in a display device.
In this embodiment of the present invention, the server may be an independent server, or may be a server network or a server cluster composed of servers, for example, the server described in this embodiment of the present invention includes, but is not limited to, a computer, a network host, a single network server, a plurality of network server sets, or a cloud server composed of a plurality of servers. Among them, the cloud server is constituted by a large number of computers or web servers based on cloud computing (CloudComputing). In the embodiment of the present invention, the server and the terminal may implement communication through any communication manner, including but not limited to mobile communication based on the third Generation Partnership Project (3 GPP), Long Term Evolution (LTE), Worldwide Interoperability for Microwave Access (WiMAX), or computer network communication based on the TCP/IP Protocol Suite (TCP/IP), User Datagram Protocol (UDP) Protocol, and the like.
It is to be understood that the terminal used in the embodiments of the present invention may be understood as a client device, and the client device includes both a device of receiving and transmitting hardware, that is, a device having receiving and transmitting hardware capable of performing bidirectional communication over a bidirectional communication link. Such a client device may include: a cellular or other communication device having a single line display or a multi-line display or a cellular or other communication device without a multi-line display. The specific terminal may specifically be a desktop terminal or a mobile terminal, and specifically includes: one of a mobile phone, a tablet computer, a notebook computer, etc.
Those skilled in the art will understand that the application environment shown in fig. 1 is only one application scenario related to the present invention, and does not constitute a limitation on the application scenario of the present invention, and that other application environments may further include more or less servers than those shown in fig. 1, or a server network connection relationship, for example, only 1 server and 1 terminal are shown in fig. 1, and it is understood that one or more other servers, or/and one or more terminals connected to the server network may also be included, and this is not limited herein.
In addition, the system to which the visual element display method according to the embodiment of the present invention is applied may be a distributed system formed by connecting a first display device, a plurality of nodes (any form of computing devices in an access network, such as a server and a user terminal) through a network communication form.
Taking a distributed system as an example of a blockchain system, referring To fig. 2, fig. 2 is an optional structural schematic diagram of the distributed system 500 applied To the blockchain system provided by the embodiment of the present invention, and is formed by a plurality of nodes 600 (computing devices in any form in an access network, such as servers and user terminals) and clients, a Peer-To-Peer (P2P, Peer To Peer) network is formed between the nodes 600, and the P2P Protocol is an application layer Protocol operating on a Transmission Control Protocol (TCP). In a distributed system, any machine, such as a server or a terminal, can join to become the node 600, and the node 600 includes a hardware layer, an intermediate layer, an operating system layer, and an application layer.
Referring to the functions of each node in the blockchain system shown in fig. 2, the functions involved include:
1) routing, a basic function that a node has, is used to support communication between nodes.
Besides the routing function, the node may also have the following functions:
2) the application is used for being deployed in a block chain, realizing specific services according to actual service requirements, recording data related to the realization functions to form recording data, carrying a digital signature in the recording data to represent a source of task data, and sending the recording data to other nodes in the block chain system, so that the other nodes add the recording data to a temporary block when the source and integrity of the recording data are verified successfully.
For example, the services implemented by the application include:
2.1) wallet, for providing the function of transaction of electronic money, including initiating transaction (i.e. sending the transaction record of current transaction to other nodes in the blockchain system, after the other nodes are successfully verified, storing the record data of transaction in the temporary blocks of the blockchain as the response of confirming the transaction is valid; of course, the wallet also supports the querying of the remaining electronic money in the electronic money address;
and 2.2) sharing the account book, wherein the shared account book is used for providing functions of operations such as storage, query and modification of account data, record data of the operations on the account data are sent to other nodes in the block chain system, and after the other nodes verify the validity, the record data are stored in a temporary block as a response for acknowledging that the account data are valid, and confirmation can be sent to the node initiating the operations.
2.3) Intelligent contracts, computerized agreements, which can enforce the terms of a contract, implemented by codes deployed on a shared ledger for execution when certain conditions are met, for completing automated transactions according to actual business requirement codes, such as querying the logistics status of goods purchased by a buyer, transferring the buyer's electronic money to the merchant's address after the buyer signs for the goods; of course, smart contracts are not limited to executing contracts for trading, but may also execute contracts that process received information.
3) And the Block chain comprises a series of blocks (blocks) which are mutually connected according to the generated chronological order, new blocks cannot be removed once being added into the Block chain, and recorded data submitted by nodes in the Block chain system are recorded in the blocks.
Referring to fig. 3, fig. 3 is an optional schematic diagram of a Block Structure (Block Structure) according to an embodiment of the present invention, where each Block includes a hash value of a transaction record stored in the Block (hash value of the Block) and a hash value of a previous Block, and the blocks are connected by the hash values to form a Block chain. The block may include information such as a time stamp at the time of block generation. A block chain (Blockchain), which is essentially a decentralized database, is a string of data blocks associated by using cryptography, and each data block contains related information for verifying the validity (anti-counterfeiting) of the information and generating a next block.
When the system applied by the visual element display method in the embodiment of the present invention is a blockchain system, and the first display device in the embodiment of the present invention is a node in the blockchain system, the number of first device independent pixels of the visual element may be stored in the blockchain. Specifically, in the embodiment of the present invention, the visual element display method further includes: the number of first device independent pixels of the visual element in the first display device is saved in the form of tiles in a tile chain. For a specific manner of adding a new block, reference may be made to the description of the block chain system, and details are not described herein.
The following is a detailed description of specific embodiments.
The embodiment of the invention provides a visual element display method, which comprises the following steps: acquiring a target display size of a visual element in a screen of a first display device; acquiring the number of dots per inch and the pixel density of a screen of first display equipment; calculating the number of first device independent pixels of the visual element in the first display device according to the number of points per inch, the pixel density and the target display size; the visual element is controlled to be displayed on a screen of the first display device in accordance with the number of independent pixels of the first device.
Referring to fig. 4, fig. 4 is a flowchart illustrating an embodiment of a visual element displaying method according to an embodiment of the present invention, the visual element displaying method includes:
101. a target display size of a visual element in a screen of a first display device is obtained.
In some embodiments of the invention, the visual elements comprise pictures, text, symbols or the like displayed in the screen of the first display device. The target display size of the visual element in the screen of the first display device may be a length, a width, a diameter, etc. of the visual element desired to be displayed in the screen of the first display device.
Specifically, taking the visual element as an image as an example, the target display size of the visual element in the screen of the first display device may include a target display length and a target display width of the image in the screen of the first display device, and the target display length and the target display width may be determined according to the size of the screen of the first display device, so that the image can be clearly displayed in the screen of the first display device.
In some embodiments of the invention, obtaining a target size of the visual element in the first display device may comprise: and acquiring the actual display size of the visual element in the screen of the second display device as the target display size.
Wherein the actual display size of the visual element in the screen of the second display device may be a length, a width, a diameter, etc. of the visual element actually displayed in the screen of the second display device. Taking the visual element as an example of a picture, the actual display size of the visual element in the screen of the second display device may include an actual display length and an actual display width of the picture in the screen of the second display device. By setting the actual display size of the visual element in the screen of the second display device as the target display size, the sizes of the visual elements displayed in the screens of the different display devices can be made the same.
In some embodiments of the present invention, the first display device may be an Android system-based display device, and the second display device may be an iOS system-based display device. Of course, the first display device may be a display device based on an iOS system, and the second display device may be a display device based on an Android system, or both the first display device and the second display device may be a display device based on an iOS system or a display device based on an Android system.
In addition, the first display device and the second display device may also be display devices based on the Windows Phone system or other systems.
102. The number of dots per inch and the pixel density of the screen of the first display device are acquired.
In some embodiments of the present invention, the number of dots per inch and the pixel density of the screen of the first display device may be acquired by acquiring screen model information of the first display device and then acquiring the number of dots per inch and the pixel density of the screen of the first display device from the screen model information. In addition, the pixel density of the screen of the first display device may also be calculated by obtaining the screen size and the resolution of the first display device, and the specific calculation method is as follows:
ppi=M/Z=√(X2+Y2)/Z;
wherein ppi is the screen pixel density of the first display device; m is the pixel amount on the diagonal of the screen of the first display device; z is a diagonal length of the screen of the first display device or a screen size (in); x is the number of pixels in the transverse direction (length direction) of the screen of the first display device; y is the number of pixels in the vertical direction (width direction) of the screen of the first display device.
Taking the screen resolution of the first display device as 3120 × 1440px with a size of 6.39 inches as an example, the pixel density ppi of the screen is √ (3120)2+14402)/6.39=538。
103. The number of first device independent pixels of the visual element in the first display device is calculated based on the number of dots per inch, the pixel density, and the target display size.
In some embodiments of the present invention, the first device independent pixel may be a length unit for Android (Android) system development, and may also be a length unit for iOS system development or other system development, and the length of the first device independent pixel is a fixed value and does not change with a change of the screen pixel density. The number of first device independent pixels of the visual element in the first display device may comprise: a first device independent pixel number of the visual element in a screen landscape (length direction) of the first display device, and a first device independent pixel number in a portrait (width direction).
In some embodiments of the present invention, after the number of dots per inch and the pixel density of the first display device and the target display size of the visual element are obtained, the number of first device independent pixels of the visual element in the first display device can be accurately calculated.
In some embodiments of the present invention, the method for calculating the number of independent pixels of the visual element in the first display device according to the number of dots per inch, the pixel density, and the target display size, as shown in fig. 5, may specifically include steps 301 to 304, which are described in detail as follows:
301. and calculating the number of pixel points contained in each independent pixel of the first equipment according to the number of points per inch.
In some embodiments of the present invention, the first display device has a screen with different dots per inch and the first display device has a screen with different numbers of pixels contained in individual pixels. Taking the first display device as an example of the Android system-based display device, the number of pixels included in the independent pixel of the first device is a ratio of the number of dots per inch to 160. When the number of dots per inch of the first display device is 160, the number of dots per inch is 160, and the number of 1 first device independent pixel comprises 1 pixel point; when the number of dots per inch of the first display device is 320, it means that 320 dots per inch are included and 1 first device independent pixel includes 2 pixel points.
302. And calculating the length of the pixel point according to the pixel density.
In some embodiments of the present invention, the length of the pixel points of the first display device is inversely proportional to the pixel density. Similarly, taking the first display device as an example of a display device based on an Android system, the length of a pixel point is a ratio of 1 to the pixel density. For example: when the pixel density of the first display device was 538ppi, the length of its single pixel point was 1/538 inches.
303. And calculating the length of the first equipment independent pixel according to the number of the pixel points contained in the first equipment independent pixel and the length of the pixel points.
In some embodiments of the present invention, the length of the first device independent pixel may be obtained by calculating the number of pixels included in each first device independent pixel by calculating the number of dots per inch, and multiplying the product of the number of pixels and the length of the pixels.
304. Calculating a first ratio of the target display size to the length of the first device independent pixels to obtain the number of the first device independent pixels of the visual element in the first display device.
In some embodiments of the present invention, a first ratio of the target display size to the length of the first device-independent pixels may be calculated and used as the number of first device-independent pixels of the visual element in the first display device, enabling the actual display size of the visual element on the screen of the first display device to be consistent with the target display size.
The specific calculation method of the number of first device independent pixels of the visual element in the first display device is as follows:
N=160L*ppi/dpi;
wherein N is the number of first device independent pixels of the visual element in the first display device; l is the target display size of the visual element; ppi is the screen pixel density of the first display device; dpi is the number of dots per inch of the screen of the first display device.
The derivation step of calculating the number of first device independent pixels of the visual element in the first display device is described in detail below:
the dots per inch of the screen of the first display device are known as dpi; the pixel density is ppi; the target display size is L. The number of pixels contained in an independent pixel of the first device is dpi/160, the length of one pixel is 1/ppi, and the length of the independent pixel of the first device is dpi/(160 × ppi) through calculating the product of the number of pixels contained in the independent pixel of the first device and the length of one pixel.
Assuming that the number of first device-independent pixels displayed by the visual element in the screen of the first display device is N, the product N × dpi/(160 × ppi) of N and the length of one first device-independent pixel is the actual display size of the visual element in the screen of the first display device, and by making the actual display size equal to the target display size, that is: n × dpi/(160 × ppi) ═ L; N160L ppi/dpi can be calculated.
It should be noted that, the step 301 may be before the step 302, or after the step 302, or the step 301 and the step 302 are performed simultaneously, which is not limited herein.
104. The visual element is controlled to be displayed on a screen of the first display device in accordance with the number of independent pixels of the first device.
In some embodiments of the present invention, the above calculation method may be adopted to calculate the number of first device independent pixels of the visual element in the horizontal direction and the vertical direction of the screen of the first display device, respectively, and then control the visual element to be displayed on the screen of the first display device according to the number in the horizontal direction and the vertical direction, so that the actual display size of the visual element on the screen of the first display device is consistent with the target display size.
According to the embodiment of the invention, the number of the first equipment independent pixels of the visual elements in the first display equipment can be accurately calculated according to the number of the dots per inch, the pixel density and the target display size of the visual elements, and then the actual display size of the visual elements on the screen of the first display equipment can be accurately controlled according to the number of the first equipment independent pixels, so that the actual display size of the visual elements is consistent with the target display size, the interface design of the first display equipment is more convenient, the physical display size can be compressed, and the reading and viewing effects of a user are improved.
It should be noted that, the step 101 and the step 102 may be executed simultaneously, or the step 101 may be executed first and then the step 102 is executed, or the step 102 is executed first and then the step 101 is executed, that is, the target display size of the visual element in the screen of the first display device may be acquired first, and then the dots per inch and the pixel density of the screen of the first display device may be acquired; or acquiring the number of dots per inch and the pixel density of the screen of the first display device, and then acquiring the target display size of the visual element in the screen of the first display device; or, the number of the first device independent pixels of the visual element in the first display device can be calculated by acquiring the dots per inch and the pixel density of the screen of the first display device while acquiring the target display size of the visual element in the screen of the first display device.
In other embodiments of the present invention, the actual display size may include the number of second device independent pixels of the visual element in the screen of the second display device, and then the number of first device independent pixels of the visual element in the first display device is calculated based on the number of second device independent pixels, the number of dots per inch, and the pixel density. As such, the display size of the visual element in the screen of the first display device can be made the same as the display size in the screen of the second display device.
In some embodiments of the present invention, the calculating the number of first device independent pixels of the visual element in the first display device according to the number of second device independent pixels, the number of dots per inch and the pixel density may include the following steps:
(1) and calculating the number of pixel points contained in each independent pixel of the first equipment according to the number of points per inch.
In some embodiments of the present invention, the first display device has a different number of dots per inch of screen and the first device has a different number of pixels contained in individual pixels. Taking the first display device as an example of the Android system-based display device, the number of pixels contained in each first device independent pixel is a ratio of the number of dots per inch to 160. That is, X is dpi/160, where X is the number of pixels included in the first device independent pixel of the first display device; dpi is the number of dots per inch of the screen of the first display device.
Specific examples thereof include: when the screen of the first display device is 160dpi, the number of pixel points contained in each independent pixel of the first display device is 1; when 320dpi of the screen of the first display device, each of the first device independent pixels thereof contains 2 pixels.
(2) And calculating the length of the pixel point according to the pixel density.
In some embodiments of the present invention, the length of the pixel point of the screen of the first display device is in inverse proportion to the pixel density, that is, the larger the pixel density of the screen of the first display device is, the smaller the length of the pixel point is.
Alternatively, the following formula may be followed: d1 is 1/ppi (inches), where D1 is the length of a pixel point of the screen of the first display device and ppi is the pixel density of the screen of the first display device. Specific examples thereof include: when the pixel density of the screen of the first display device was 538ppi, the length of its single pixel point was 1/538 inches.
Of course, the length of the pixel point of the screen of the first display device may also be known, and at this time, the length of the pixel point may be directly obtained from the first display device without calculation.
(3) And calculating the length of the first equipment independent pixel according to the number of the pixel points contained in the first equipment independent pixel and the length of the pixel points.
In some embodiments of the present invention, the length of the first device independent pixel may be obtained by calculating a product of the number of pixels included in the first device independent pixel and the length of the pixels.
Alternatively, the following formula may be followed: d2 ═ X × D1 ═ dpi/160 ═ dpi/(160 × ppi) (inches), where D2 is the length of the first device individual pixels, D1 is the length of the pixel points of the screen of the first display device, ppi is the pixel density of the screen of the first display device; dpi is the number of dots per inch of the screen of the first display device.
(4) The length of the second device independent pixel is obtained.
In some embodiments of the present invention, the length of the second device independent pixel of the second display device may be calculated according to the length of the second device independent pixel of the first display device, or may be a length known in advance. Taking the second display device as an iOS system based display device as an example, the length of the individual pixels of the second device is 1/163 inches.
(5) A third ratio of the length of the second device independent pixel to the length of the first device independent pixel is calculated.
In some embodiments of the present invention, when the first display device is an Android system-based display device and the second display device is an iOS system-based display device, a third ratio of the length of the second device-independent pixel to the length of the first device-independent pixel is (1/163)/(dpi/(160 ppi)), (160 ppi)/(163 dpi).
Of course, when the first display device and the second display device are both display devices based on an Android system or display devices based on an iOS system, the third ratio of the length of the independent pixel of the second device to the length of the independent pixel of the first device is 1.
(7) And calculating the product of the third ratio and the number of the second equipment independent pixels to obtain the number of the first equipment independent pixels of the visual element in the first display equipment.
In some embodiments of the present invention, by calculating the product of the third ratio and the number of the second device independent pixels, the number of the first device independent pixels of the visual element in the first display device can be accurately obtained, so that the display size of the visual element in the first display device is consistent with the display size of the visual element in the second display device.
The derivation step of calculating the number of first device independent pixels of the visual element in the first display device is described in detail below:
the dots per inch of the screen of the first display device are known as dpi; the pixel density is ppi; the number of the independent pixels of the second device is P; the length of the second device individual pixel is 1/163 inches. The number of pixels contained in an independent pixel of the first device is dpi/160, the length of one pixel is 1/ppi, and the length of the independent pixel of the first device is dpi/(160 × ppi) through calculating the product of the number of pixels contained in the independent pixel of the first device and the length of one pixel.
Assuming that the number of first device-independent pixels displayed by the visual element in the screen of the first display device is N, the product N × dpi/(160 × ppi) of N and the length of one first device-independent pixel is the actual display size of the visual element in the screen of the first display device. And the actual display size of the visual element in the screen of the second display device is the product of the number of second device independent pixels and the length of the second device independent pixels, i.e., P/163 inches.
By making the actual display size of the visual element in the screen of the first display device equal to the actual display size of the visual element in the screen of the second display device, the following equation can be derived:
N*dpi/(160*ppi)=P/163;
the above equation is converted to obtain the number N of first device independent pixels (160 appi)/(163 dpi) of the visual element displayed in the screen of the first display device, that is, the product of the third ratio and the number of second device independent pixels.
In other embodiments of the present invention, a method for calculating the number of first device independent pixels of a visual element in a first display device based on the number of second device independent pixels, dots per inch, and pixel density may also include the steps of:
(1) a second ratio of the number of dots per inch to the pixel density is calculated.
In some embodiments of the present invention, a second ratio of dots per inch to pixel density of the first display device may be calculated. Taking the Android system-based display device as an example, the second ratio of the number of dots per inch to the pixel density of the first display device is dpi/ppi.
(2) And calculating the product of the second ratio and the second device independent pixel to obtain the number of the first device independent pixels of the visual element in the first display device.
In some embodiments of the present invention, the number of first device independent pixels of the visual element in the first display device can be obtained relatively accurately by calculating the product of the second ratio and the second device independent pixels, so that the display size of the visual element in the first display device is substantially consistent with the display size in the second display device.
It will be appreciated that the above formula: n ═ P × (160 × ppi)/(163 × dpi) ═ P × (160/163) × (ppi/dpi), where 160/163 ≈ 0.98 ≈ 1, and therefore (160/163) in the formula can be omitted, the number of first device-independent pixels of the visual element in the first display device can be obtained directly by calculating the product of the second ratio and the second device-independent pixels, the calculation step can be simplified, and the number of first device-independent pixels of the visual element in the first display device can be obtained more accurately, so that the display size of the visual element in the first display device and the display size in the second display device can be substantially maintained to be the same.
In the following, taking the first display device as an Android system-based display device and the second display device as an iOS system-based display device as an example, the display of the visual elements on the first display device is described.
Fig. 6 is a schematic structural diagram of a screen of the first display device in the embodiment of the present invention; fig. 7 is a schematic structural diagram of a screen of the second display device in the embodiment of the present invention. Referring to fig. 6, the visual element is displayed as a square in the screen of the first display device, which has N number of first device individual pixels (dp) in both the horizontal direction (length direction) and vertical direction (width direction) of the screen. Referring to fig. 7, the visual element is displayed as a square in the screen of the second display device, which has P numbers of second device independent pixels (pt) in both the horizontal (length direction) and vertical (width direction) directions of the screen.
Wherein the pixel density of the screen of the first display device is 538ppi and the pixel density of the screen of the second display device is 326 ppi. If the visual element is displayed on the screen of the first display device with N equal to 100, the actual display length (or width) of the visual element on the screen of the first display device is N (dpi/160) (1/538) (100 (538/dpi) (dpi/160) (1/538) (100/160) (0.625 inches). If the visual element is displayed on the screen of the second display device with P equal to 100, the actual display length (or width) of the visual element on the screen of the second display device is 200/326 ═ 0.613 inch.
Obviously, the size of the visual element displayed in the screen of the first display device is smaller than the size displayed in the screen of the second display device.
In order to make the size of the visual element displayed in the screen of the first display device equal to the size of the visual element displayed in the screen of the second display device. The number of first device-independent pixels of the visual element in the first display device may be calculated according to the formula N ═ P (160 × ppi)/(163 × dpi) so that the size of the visual element displayed in the screen of the first display device is equal to the size of the visual element displayed in the screen of the second display device. Or, the number of first device independent pixels of the visual element in the first display device is calculated according to the formula N ═ P pi)/dpi, so that the size of the visual element displayed in the screen of the first display device is approximately equal to the size of the visual element displayed in the screen of the second display device.
In order to better implement the visual element display method provided by the embodiment of the invention, the embodiment of the invention also provides a device based on the visual element display method. Wherein the meaning of the noun is the same as that in the above-mentioned visual element display method, and the details of the implementation can be referred to the description in the method embodiment.
Referring to fig. 8, fig. 8 is a schematic structural diagram of a visual element display device according to an embodiment of the present invention, where the visual element display device is applied to a terminal, where the visual element display device 300 may include a first obtaining unit 310, a second obtaining unit 320, a calculating unit 330, and a control unit 340, specifically as follows:
a first obtaining unit 310, configured to obtain a target display size of the visual element in a screen of the first display device.
In some embodiments of the invention, the visual elements comprise pictures, text, symbols or the like displayed in the screen of the first display device. The target display size of the visual element in the screen of the first display device may be a length, a width, a diameter, etc. of the visual element desired to be displayed in the screen of the first display device.
A second obtaining unit 320 for obtaining the number of dots per inch and the pixel density of the screen of the first display device.
In some embodiments of the present invention, the visual element display apparatus 300 may obtain the number of dots per inch and the pixel density of the screen of the first display device from the screen model information by obtaining the screen model information of the first display device.
A calculating unit 330, configured to calculate, according to the number of dots per inch, the pixel density, and the target display size, the number of first device independent pixels of the visual element in the first display device.
In some embodiments of the invention, the number of first device independent pixels of the visual element in the first display device may comprise: a first device independent pixel number of the visual element in a screen landscape (length direction) of the first display device, and a first device independent pixel number in a portrait (width direction).
A control unit 340, configured to control the visual element to be displayed on the screen of the first display device according to the number of the first device independent pixels.
According to the embodiment of the invention, the target display size of the visual element in the screen of the first display device is obtained through the first obtaining unit, the number of dots per inch and the pixel density of the screen of the first display device are obtained through the second obtaining unit, then the number of the first device independent pixels of the visual element in the first display device is calculated through the calculating unit according to the number of dots per inch, the pixel density and the target display size, and finally the visual element is controlled through the control unit to be displayed on the screen of the first display device according to the number of the first device independent pixels. According to the embodiment of the invention, the number of the first equipment independent pixels of the visual elements in the first display equipment can be accurately calculated according to the number of the dots per inch, the pixel density and the target display size of the visual elements, and then the actual display size of the visual elements on the screen of the first display equipment can be accurately controlled according to the number of the first equipment independent pixels, so that the actual display size of the visual elements is consistent with the target display size, the interface design of the first display equipment is more convenient, the physical display size can be compressed, and the reading and viewing effects of a user are improved.
In some embodiments of the present invention, the calculation unit 330 comprises:
the first calculating subunit is used for calculating the number of pixel points contained in each first equipment independent pixel according to the points per inch;
the second calculating subunit is used for calculating the length of the pixel point according to the pixel density;
the third calculation subunit is used for calculating the length of the first equipment independent pixel according to the number of the pixel points contained in the first equipment independent pixel and the length of the pixel points;
and the fourth calculating subunit is configured to calculate a first ratio of the target display size to the length of the first device independent pixel, so as to obtain the number of the first device independent pixels of the visual element in the first display device.
In some embodiments of the present invention, the visual element display apparatus 300 may calculate a first ratio of the target display size to the length of the first device-independent pixels, and use the ratio as the number of first device-independent pixels of the visual element in the first display device, so as to enable the actual display size of the visual element on the screen of the first display device to be consistent with the target display size.
In some embodiments of the present invention, the first obtaining unit 310 is configured to obtain an actual display size of the visual element in a screen of a second display device as the target display size.
In some embodiments of the invention, the actual display size comprises a number of second device independent pixels of the visual element in a screen of the second display device; the calculating unit 330 is configured to calculate the number of first device independent pixels of the visual element in the first display device according to the number of second device independent pixels, the number of dots per inch, and the pixel density.
In some embodiments of the present invention, the calculation unit 330 comprises:
a fifth sub-calculation unit for calculating a second ratio of the number of dots per inch to the pixel density;
a sixth sub-calculation unit, configured to calculate a product of the second ratio and the second device independent pixel, so as to obtain the number of first device independent pixels of the visual element in the first display device.
In the embodiment of the present invention, the visual element displaying apparatus 300 can obtain the number of the first device independent pixels of the visual element in the first display device more accurately by calculating the product of the second ratio and the second device independent pixels, so that the display size of the visual element in the first display device is substantially consistent with the display size of the visual element in the second display device.
In other embodiments of the present invention, the calculation unit 330 includes:
a first number calculating unit, configured to calculate, according to the number of dots per inch, a number of pixels included in each of the first device independent pixels;
the first length calculating unit is used for calculating the length of the pixel point according to the pixel density;
the second length calculation unit is used for calculating the length of the first equipment independent pixel according to the number of pixel points contained in the first equipment independent pixel and the length of the pixel points;
a third acquisition unit configured to acquire a length of the second device independent pixel;
a third ratio calculation unit configured to calculate a third ratio of the length of the second device-independent pixel to the length of the first device-independent pixel;
and a second quantity calculating unit, configured to calculate a product of the third ratio and the number of the second device independent pixels, to obtain the number of the first device independent pixels of the visual element in the first display device.
According to the embodiment of the invention, the product of the third ratio and the number of the independent pixels of the second device is calculated, so that the number of the independent pixels of the first device of the visual element in the first display device can be accurately obtained, and the display size of the visual element in the first display device is consistent with that of the visual element in the second display device.
In some embodiments of the invention, the visual element display apparatus further comprises a blockchain unit for saving the number of first device independent pixels of the visual element in the first display device in the blockchain in the form of a block.
An embodiment of the present invention further provides a terminal, as shown in fig. 9, which shows a schematic structural diagram of the terminal according to the embodiment of the present invention, specifically:
the terminal may include components such as a processor 401 of one or more processing cores, memory 402 of one or more computer-readable storage media, a power supply 403, and an input unit 404. Those skilled in the art will appreciate that the terminal structure shown in fig. 9 does not constitute a limitation of the terminal, and may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components. Wherein:
the processor 401 is a control center of the terminal, connects various parts of the entire terminal using various interfaces and lines, and performs various functions of the terminal and processes data by operating or executing software programs and/or modules stored in the memory 402 and calling data stored in the memory 402, thereby performing overall monitoring of the terminal. Optionally, processor 401 may include one or more processing cores; preferably, the processor 401 may integrate an application processor and a modem processor, wherein the application processor mainly handles operations of storage media, user interfaces, application programs, and the like, and the modem processor mainly handles wireless communications. It will be appreciated that the modem processor described above may not be integrated into the processor 401.
The memory 402 may be used to store software programs and modules, and the processor 401 executes various functional applications and data processing by operating the software programs and modules stored in the memory 402. The memory 402 may mainly include a storage program area and a storage data area, wherein the storage program area may store an application program (such as a sound playing function, an image playing function, etc.) required for operating a storage medium, at least one function, and the like; the storage data area may store data created according to the use of the terminal, and the like. Further, the memory 402 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device. Accordingly, the memory 402 may also include a memory controller to provide the processor 401 access to the memory 402.
The terminal further comprises a power supply 403 for supplying power to the various components, and preferably, the power supply 403 is logically connected to the processor 401 via a power management storage medium, so that functions of managing charging, discharging, and power consumption are realized via the power management storage medium. The power supply 403 may also include any component of one or more of a dc or ac power source, a rechargeable storage medium, a power failure detection circuit, a power converter or inverter, a power status indicator, and the like.
The terminal may further include an input unit 404, and the input unit 404 may be used to receive input numeric or character information and generate a keyboard, mouse, joystick, optical or trackball signal input in relation to user settings and function control.
Although not shown, the terminal may further include a display unit and the like, which will not be described in detail herein. Specifically, in this embodiment, the processor 401 in the terminal loads the executable file corresponding to the process of one or more application programs into the memory 402 according to the following instructions, and the processor 401 runs the application programs stored in the memory 402, thereby implementing various functions as follows:
acquiring a target display size of a visual element in a screen of a first display device; acquiring the number of dots per inch and the pixel density of a screen of first display equipment; calculating the number of first device independent pixels of the visual element in the first display device according to the number of points per inch, the pixel density and the target display size; the visual element is controlled to be displayed on a screen of the first display device in accordance with the number of independent pixels of the first device.
It will be understood by those skilled in the art that all or part of the steps of the methods of the above embodiments may be performed by instructions or by associated hardware controlled by the instructions, which may be stored in a computer readable storage medium and loaded and executed by a processor.
To this end, the embodiment of the present invention provides a computer-readable storage medium, on which a computer program is stored, and the computer program is loaded by a processor to execute the steps in any one of the visual element display methods provided by the embodiment of the present invention. For example, the computer program may be loaded by a processor to perform the steps of:
acquiring a target display size of a visual element in a screen of a first display device; acquiring the number of dots per inch and the pixel density of a screen of first display equipment; calculating the number of first device independent pixels of the visual element in the first display device according to the number of points per inch, the pixel density and the target display size; the visual element is controlled to be displayed on a screen of the first display device in accordance with the number of independent pixels of the first device.
The above operations can be implemented in the foregoing embodiments, and are not described in detail herein.
Wherein the computer-readable storage medium may include: read Only Memory (ROM), Random Access Memory (RAM), magnetic or optical disks, and the like.
Since the computer program stored in the computer-readable storage medium can execute the steps in any visual element display method provided in the embodiments of the present invention, the beneficial effects that can be achieved by any visual element display method provided in the embodiments of the present invention can be achieved, which are detailed in the foregoing embodiments and will not be described herein again.
The method, the device and the terminal for displaying visual elements provided by the embodiments of the present invention are described in detail above, and the principle and the implementation of the present invention are explained in the present document by applying specific examples, and the description of the above embodiments is only used to help understanding the method and the core idea of the present invention; meanwhile, for those skilled in the art, according to the idea of the present invention, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present invention.

Claims (10)

1. A visual element display method, comprising:
acquiring a target display size of a visual element in a screen of a first display device;
acquiring the number of dots per inch and the pixel density of a screen of the first display device;
calculating the number of first device independent pixels of the visual element in the first display device according to the points per inch, the pixel density and the target display size;
and controlling the visual element to be displayed on the screen of the first display device according to the number of the independent pixels of the first device.
2. The visual element display method of claim 1, wherein said calculating a number of first device independent pixels of said visual element in said first display device based on said dots per inch, said pixel density, and said target display size comprises:
calculating the number of pixel points contained in each independent pixel of the first equipment according to the points per inch;
calculating the length of the pixel point according to the pixel density;
calculating the length of the first equipment independent pixel according to the number of pixel points contained in the first equipment independent pixel and the length of the pixel points;
and calculating a first ratio of the target display size to the length of the first device independent pixels to obtain the number of the first device independent pixels of the visual element in the first display device.
3. The visual element display method of claim 1, wherein said obtaining a target size of the visual element in the first display device comprises:
and acquiring the actual display size of the visual element in the screen of the second display device as the target display size.
4. The visual element display method of claim 3, wherein the actual display size comprises a number of second device independent pixels of the visual element in a screen of the second display device; the calculating the number of first device independent pixels of the visual element in the first display device according to the number of dots per inch, the pixel density and the target display size comprises:
and calculating the number of first equipment independent pixels of the visual element in the first display equipment according to the number of the second equipment independent pixels, the points per inch and the pixel density.
5. The visual element display method of claim 4, wherein said calculating the number of first device independent pixels of the visual element in the first display device from the number of second device independent pixels, the number of dots per inch, and the pixel density comprises:
calculating a second ratio of said number of dots per inch to said pixel density;
and calculating the product of the second ratio and the second device independent pixel to obtain the number of the first device independent pixels of the visual element in the first display device.
6. The visual element display method of claim 4, wherein said calculating the number of first device independent pixels of the visual element in the first display device from the number of second device independent pixels, the number of dots per inch, and the pixel density comprises:
calculating the number of pixel points contained in each independent pixel of the first equipment according to the points per inch;
calculating the length of the pixel point according to the pixel density;
calculating the length of the first equipment independent pixel according to the number of pixel points contained in the first equipment independent pixel and the length of the pixel points;
acquiring the length of the independent pixel of the second device;
calculating a third ratio of the length of the second device independent pixel to the length of the first device independent pixel;
and calculating the product of the third ratio and the number of the second equipment independent pixels to obtain the number of the first equipment independent pixels of the visual element in the first display equipment.
7. A visual element display method as claimed in any one of claims 1 to 6, further comprising:
saving the number of first device independent pixels of the visual element in the first display device in a tile chain.
8. A visual element display device, the visual element display device comprising:
a first acquisition unit configured to acquire a target display size of a visual element in a screen of a first display device;
a second acquisition unit configured to acquire a number of dots per inch and a pixel density of a screen of the first display device;
the calculating unit is used for calculating the number of first equipment independent pixels of the visual element in the first display equipment according to the points per inch, the pixel density and the target display size;
and the control unit is used for controlling the visual elements to be displayed on the screen of the first display device according to the number of the independent pixels of the first device.
9. The visual element display apparatus of claim 8, wherein the computing unit comprises:
the first calculating subunit is used for calculating the number of pixel points contained in each first equipment independent pixel according to the points per inch;
the second calculating subunit is used for calculating the length of the pixel point according to the pixel density;
the third calculation subunit is used for calculating the length of the first equipment independent pixel according to the number of the pixel points contained in the first equipment independent pixel and the length of the pixel points;
and the fourth calculating subunit is configured to calculate a first ratio of the target display size to the length of the first device independent pixel, so as to obtain the number of the first device independent pixels of the visual element in the first display device.
10. A terminal, comprising: a processor and a memory; the memory stores a plurality of instructions that the processor loads to perform the steps in the visual element display method of any one of claims 1 to 7.
CN201911345449.0A 2019-12-24 2019-12-24 Visual element display method and device and terminal Pending CN113032060A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911345449.0A CN113032060A (en) 2019-12-24 2019-12-24 Visual element display method and device and terminal

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911345449.0A CN113032060A (en) 2019-12-24 2019-12-24 Visual element display method and device and terminal

Publications (1)

Publication Number Publication Date
CN113032060A true CN113032060A (en) 2021-06-25

Family

ID=76451540

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911345449.0A Pending CN113032060A (en) 2019-12-24 2019-12-24 Visual element display method and device and terminal

Country Status (1)

Country Link
CN (1) CN113032060A (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103473044A (en) * 2013-08-20 2013-12-25 广东明创软件科技有限公司 Drawing method for application program interface adaptive to mobile terminals with different resolutions
CN104238890A (en) * 2014-09-19 2014-12-24 小米科技有限责任公司 Text display method and device
CN107450841A (en) * 2017-08-08 2017-12-08 腾讯科技(深圳)有限公司 interactive object control method and device
CN108519962A (en) * 2018-04-03 2018-09-11 优视科技有限公司 A kind of font display methods, device and terminal device applied to Android system

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103473044A (en) * 2013-08-20 2013-12-25 广东明创软件科技有限公司 Drawing method for application program interface adaptive to mobile terminals with different resolutions
CN104238890A (en) * 2014-09-19 2014-12-24 小米科技有限责任公司 Text display method and device
CN107450841A (en) * 2017-08-08 2017-12-08 腾讯科技(深圳)有限公司 interactive object control method and device
CN108519962A (en) * 2018-04-03 2018-09-11 优视科技有限公司 A kind of font display methods, device and terminal device applied to Android system

Similar Documents

Publication Publication Date Title
CN104025078B (en) Method and apparatus for promoting to sign electronically in the client computing device being associated with subscriber
CN108897507B (en) Whiteboard synchronous display method and system based on android intelligent classroom
CN102713848B (en) For using lightweight client to calculate, with virtualization, the method that service is docked by network
CN110809175A (en) Video recommendation method and device
CN104572084B (en) User interface generation and data distributing method, device in card business
CN110609970B (en) User identity identification method and device, storage medium and electronic equipment
CN106055383A (en) Request processing method and device
CN110472087A (en) A kind of facial expression image recommended method, device, equipment and medium
CN111414842A (en) Video comparison method and device, computer equipment and storage medium
CN109635266A (en) Three-dimensional visualization edit methods, device and three-dimension visible sysem
CN109344294A (en) Feature generation method, device, electronic equipment and computer readable storage medium
CN113032060A (en) Visual element display method and device and terminal
CN116800671A (en) Data transmission method, apparatus, computer device, storage medium, and program product
CN112044061A (en) Game picture processing method and device, electronic equipment and storage medium
CN111797822A (en) Character object evaluation method and device and electronic equipment
CN112084763A (en) Wrong question management method and system
CN112115703B (en) Article evaluation method and device
CN115001692A (en) Model updating method and device, computer readable storage medium and electronic device
CN104516883A (en) Webpage sharing method, device and system
CN117557240B (en) Method, system, device and storage medium for reading jobs
CN113688809B (en) Model training method, text removal method and related device
CN115205416B (en) Image generation method, device, computer equipment and storage medium
CN109445729A (en) A kind of PDF is hand-written with stamped signature Display on the same screen method
CN117151449B (en) Data platform chain type information interaction method based on full scene linkage
CN105100245A (en) Method and system for intelligently distributing network files

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