CN116166165B - Visual text selection method, visual text selection device and storage medium - Google Patents
Visual text selection method, visual text selection device and storage medium Download PDFInfo
- Publication number
- CN116166165B CN116166165B CN202310452675.9A CN202310452675A CN116166165B CN 116166165 B CN116166165 B CN 116166165B CN 202310452675 A CN202310452675 A CN 202310452675A CN 116166165 B CN116166165 B CN 116166165B
- Authority
- CN
- China
- Prior art keywords
- range
- rendering
- content
- coordinates
- touch screen
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/01—Input arrangements or combined input and output arrangements for interaction between user and computer
- G06F3/048—Interaction techniques based on graphical user interfaces [GUI]
- G06F3/0481—Interaction techniques based on graphical user interfaces [GUI] based on specific properties of the displayed interaction object or a metaphor-based environment, e.g. interaction with desktop elements like windows or icons, or assisted by a cursor's changing behaviour or appearance
- G06F3/0483—Interaction with page-structured environments, e.g. book metaphor
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/01—Input arrangements or combined input and output arrangements for interaction between user and computer
- G06F3/048—Interaction techniques based on graphical user interfaces [GUI]
- G06F3/0484—Interaction techniques based on graphical user interfaces [GUI] for the control of specific functions or operations, e.g. selecting or manipulating an object, an image or a displayed text element, setting a parameter value or selecting a range
- G06F3/04842—Selection of displayed objects or displayed text elements
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/01—Input arrangements or combined input and output arrangements for interaction between user and computer
- G06F3/048—Interaction techniques based on graphical user interfaces [GUI]
- G06F3/0487—Interaction techniques based on graphical user interfaces [GUI] using specific features provided by the input device, e.g. functions controlled by the rotation of a mouse with dual sensing arrangements, or of the nature of the input device, e.g. tap gestures based on pressure sensed by a digitiser
- G06F3/0488—Interaction techniques based on graphical user interfaces [GUI] using specific features provided by the input device, e.g. functions controlled by the rotation of a mouse with dual sensing arrangements, or of the nature of the input device, e.g. tap gestures based on pressure sensed by a digitiser using a touch-screen or digitiser, e.g. input of commands through traced gestures
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements 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/44—Arrangements for executing specific programs
- G06F9/451—Execution arrangements for user interfaces
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Human Computer Interaction (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Software Systems (AREA)
- User Interface Of Digital Computer (AREA)
Abstract
The invention provides a visual text selection method, a visual text selection device and a storage medium, which relate to the technical field of computers, wherein the visual text selection method comprises the following steps: determining a first shielding range corresponding to the target object on the touch screen based on the contact point coordinates of the target object on the preset touch screen; converting screen coordinates corresponding to the first shielding range into document coordinates corresponding to a second shielding range in the format document currently displayed by the touch screen; based on the document coordinates, acquiring first text content and attribute information thereof in a second shielding range from the format document, and rendering the first text content and the attribute information thereof in a picture outline range in real time; acquiring a highlight outline corresponding to the second text content selected by the text selection operation of the target object on the format document, and rendering the highlight outline in real time within the highlight outline range; and in the rendering range on the touch screen, rendering the corresponding content in the intersection of the picture contour range and the highlight contour range into visual content in real time.
Description
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a visual text selection method, device and storage medium.
Background
Mobile reading has become a very popular way of reading electronic documents in people's daily lives, and people no longer need to rely on traditional paper books to acquire knowledge, but use mobile devices to access electronic books, technical documents, reports, and other related materials. The expression of format text is particularly important when electronic documents are read on mobile devices, and text selection becomes a very important function as people rely more and more on mobile devices to read format documents.
Touch screens have become a primary human-machine interaction in terms of interaction with mobile devices. However, when the user performs text selection, the finger or the touch pen and the like easily cover the text, which affects the judgment of the user on the text selection range, and is one of the problems to be solved when reading the layout document.
Currently, when a user reads a layout document through a touch screen, in order to reduce the influence caused by text selection of a finger, a touch pen or the like, a screen capture is usually performed on a document page currently displayed by the user, and the screen capture is displayed in a non-shielded area.
However, the above manner often has a problem that the display content is distorted, or the display content contains other shielding content, so that the selected text is invisible, which results in poor reading experience of the user.
Disclosure of Invention
The invention provides a visual text selection method, a visual text selection device and a visual text selection storage medium, which are used for solving the problem that the display content is distorted or the display content contains other shielding content so that the selected text is invisible in the prior art, and the problem that the experience of reading by a user is poor is solved.
The invention provides a visual text selection method, which comprises the following steps:
determining a first shielding range corresponding to a target object on a touch screen based on a contact point coordinate of the target object on the preset touch screen;
converting screen coordinates corresponding to the first shielding range into document coordinates corresponding to a second shielding range in the format document currently displayed by the touch screen;
based on the document coordinates, acquiring first text content and attribute information thereof in the second shielding range from the format document, and rendering the first text content and the attribute information thereof in a picture outline range in real time;
acquiring a highlight outline corresponding to the second text content selected by the text selection operation of the target object on the format document, and rendering the highlight outline in real time within a highlight outline range;
In a rendering range on the touch screen, rendering the corresponding content in the intersection of the picture outline range and the highlight outline range into visual content in real time; the rendering range is a range of the touch screen except the first shielding range.
According to the visual text selection method provided by the invention, the first text content and the attribute information thereof are rendered in the picture outline range in real time, and the visual text selection method comprises the following steps:
amplifying the first text content and the attribute information thereof according to a preset proportional parameter constant, and then rendering the first text content and the attribute information thereof in the picture outline range in real time;
wherein the proportionality parameter constant is used for representing the magnification factor in rendering.
According to the visual text selection method provided by the invention, the real-time rendering of the highlight outline in the highlight outline range comprises the following steps:
and amplifying the highlight contour according to the proportional parameter constant, and then rendering in real time within the highlight contour range.
According to the visual text selection method provided by the invention, before the corresponding content in the intersection of the picture outline range and the highlight outline range is rendered into the visual content in real time in the rendering range on the touch screen, the method further comprises:
Determining the rendering range based on a preset offset constant and the contact point coordinates;
wherein the offset constant is used to characterize the degree of offset of the coordinates of the rendering range relative to the coordinates of the contact point.
According to the visual text selection method provided by the invention, the rendering range is determined based on a preset offset constant and the contact point coordinates, and the visual text selection method comprises the following steps of;
determining a first candidate range based on the offset constant and the contact point coordinates;
when the first candidate range is included in the display range of the touch screen, the first candidate range is used as the rendering range;
in a case where the first candidate range is not included in the display range of the touch screen, a second candidate range included in the display range is selected as the rendering range based on the offset constant and the contact point coordinates.
According to the visual text selection method provided by the invention, in the process of updating the coordinates of the contact point, the method further comprises the following steps:
determining a third candidate range based on the offset constant and the updated contact point coordinates;
And when the third candidate range is not included in the display range of the touch screen, rendering the visual content corresponding to the updated touch point coordinate in the rendering range corresponding to the touch point coordinate before updating.
According to the visual text selection method provided by the invention, the first shielding range corresponding to the target object on the touch screen is determined based on the contact point coordinates of the target object on the preset touch screen, and the method comprises the following steps:
and determining a first shielding range corresponding to the target object on the touch screen based on the coordinates of the contact point and at least one preset constant.
The invention also provides a visual text selection device, which comprises:
the determining module is used for determining a first shielding range corresponding to a target object on a touch screen based on the coordinates of the contact point of the target object on the preset touch screen;
the conversion module is used for converting the screen coordinates corresponding to the first shielding range into document coordinates corresponding to a second shielding range in the format document currently displayed by the touch screen;
the first acquisition module is used for acquiring first text content and attribute information thereof in the second shielding range from the format document based on the document coordinates, and rendering the first text content and the attribute information thereof in a picture outline range in real time;
The second acquisition module is used for acquiring a highlight outline corresponding to the second text content selected by the text selection operation of the target object on the layout document, and rendering the highlight outline in a highlight outline range in real time;
the rendering module is used for rendering the corresponding content in the intersection of the picture outline range and the highlight outline range into visual content in real time in the rendering range on the touch screen; the rendering range is a range of the touch screen except the first shielding range.
The invention also provides an electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing a method of text selection for visualisation as described in any of the above when executing the program.
The present invention also provides a non-transitory computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements a method of text selection for visualization as described in any of the above.
The invention also provides a computer program product comprising a computer program which when executed by a processor implements a method of text selection for visualisation as described in any of the above.
Compared with the method, the device and the storage medium for selecting the visualized text, which are provided by the invention, in the prior art, the displayed content is obtained in a screenshot way, and the displayed content is distorted, or the displayed content contains other shielding content so that the selected text is invisible; the visualized content rendered does not have the problem of distortion of the displayed content caused by operations such as screenshot and the like, and even if the displayed content contains other shielding content, the rendered visualized content is not influenced by the other shielding content, so that clearer and more accurate text selection experience can be provided for a user, and the comfort and fluency of reading experience are improved.
Drawings
In order to more clearly illustrate the invention or the technical solutions of the prior art, the following description will briefly explain the drawings used in the embodiments or the description of the prior art, and it is obvious that the drawings in the following description are some embodiments of the invention, and other drawings can be obtained according to the drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flow chart of a visual text selection method provided by the present invention;
FIG. 2 is a schematic diagram of a page displayed for text selection by a user in accordance with the related art;
FIG. 3 is a second flow chart of a visual text selection method according to the present invention;
FIG. 4 is a schematic diagram of a visual text selection device provided by the present invention;
fig. 5 is a schematic structural diagram of an electronic device provided by the present invention.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the present invention more apparent, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings, and it is apparent that the described embodiments are some embodiments of the present invention, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
The visualized text selection method, apparatus and storage medium of the present invention are described below with reference to the accompanying drawings.
FIG. 1 is a schematic flow chart of a visual text selection method according to the present invention, as shown in FIG. 1, the method includes steps 101 to 105; wherein:
104, acquiring a highlight outline corresponding to the second text content selected by the text selection operation of the target object on the layout document, and rendering the highlight outline in a highlight outline range in real time;
At present, when a mobile device such as a touch screen device is used for reading a layout document, due to the existence of a finger or a touch pen, part of text contents are often shielded, so that a user cannot determine which text contents are selected at present when selecting the text, and the problem is very unfriendly to user experience.
In the related art, when a user reads a layout document through a touch screen, in order to reduce the influence caused by text selection of a finger, a touch pen or the like, the user usually performs screenshot on a document page currently displayed by the user, and the screenshot is displayed in a non-occluded area.
However, the above manner often has a problem that the display content is distorted, or the display content contains other shielding content, so that the selected text is invisible, which results in poor reading experience of the user.
Fig. 2 is a schematic diagram of a page displayed by a text selection by a user in the related art, as shown in fig. 2, because ink is contained in display content of the page, if the screen capturing is adopted for displaying, the selected text is still blocked by the ink after the screen capturing, so that the selected text is invisible, and further the user is affected to perform text selection.
Aiming at the problems, the visual text selection method provided by the invention can enable a user to conveniently and rapidly select the text when reading the format document on the mobile equipment, and simultaneously ensure the accuracy and the visual effect of the selected text, the content display effect is not distorted, the content is not blocked, the comfort and the fluency of the reading experience are improved, and the user can copy, paste, annotate or share the text content more conveniently.
Specifically, the embodiment of the invention firstly determines a first shielding range corresponding to a target object on a touch screen based on the coordinates of the contact point of the target object on the touch screen;
alternatively, the target object may be an object such as a finger or a stylus that may obscure the text selection range.
After determining a first shielding range corresponding to the touch screen, converting screen coordinates corresponding to the first shielding range into document coordinates corresponding to a second shielding range in a format document currently displayed by the touch screen, wherein the coordinate conversion can be performed specifically in combination with the screen size of the touch screen; acquiring first text content and attribute information thereof in a second shielding range in the format document based on the document coordinates, and rendering the first text content and the attribute information thereof in a picture outline range in real time;
alternatively, the above-mentioned first text content and attribute information thereof may include text content and some text content and corresponding attribute information thereof, the attribute information being, for example, a font size, a word spacing, and the like;
optionally, the first text content may be only content information of the layout document, and does not contain other content that may obstruct text selection, such as notes, pictures, signatures, and software interfaces, so that the pureness of the content is ensured, and the influence of the notes, pictures, signatures, and software interfaces on the obstruction of visual text selection is reduced.
In addition, in the text selection process, the range of the selected text is generally marked by rendering highlight outlines (also called highlight areas), the highlight areas can be rendered in real time in the content to be rendered, and only the highlight areas in the first shielding range can be rendered;
specifically, the method and the device not only render the first text content and the attribute information thereof in the picture outline range in real time, but also acquire the highlight outline corresponding to the selected second text content when the target object executes text selection operation, wherein the method and the device specifically can calculate the position and the size of the highlight outline and then render the highlight outline in the highlight outline range in real time;
alternatively, the number of highlighting contours corresponding to the second text content may be one or more.
After rendering the content in the picture outline range and the content in the highlight outline range, the corresponding content in the intersection of the picture outline range and the highlight outline range can be rendered into visual content in real time in the rendering range of the touch screen, namely in the range except the first shielding range on the touch screen, so that a user can view the current text selection condition through the non-shielded visual content.
It should be noted that, rendering the content corresponding to the intersection of the picture contour range and the highlight contour range in real time is to render only the first text content and the attribute information thereof in the first shielding range and the highlight contour corresponding to the first text content in the rendering range.
Alternatively, the visual content may include pictures, rectangles, lines, and the like.
In the visual text selection method provided by the embodiment of the invention, compared with the problem that the display content is distorted or the display content contains other shielding content so that the selected text is invisible because the display content is obtained in a screenshot mode in the related art, the first text content shielded in the currently displayed format document and the attribute information thereof are directly obtained, the real-time rendering is carried out in a picture outline range, the highlight outline corresponding to the second text content selected by a user in combination with text selection is carried out, the highlight outline is real-time rendered in the highlight outline range, and the content corresponding to the intersection of the picture outline range and the highlight outline range is real-time rendered into visual content for display in the non-shielding rendering range of the touch screen, so that the first text content and the highlight outline corresponding to the first text content are rendered into visual content; the visualized content rendered does not have the problem of distortion of the displayed content caused by operations such as screenshot and the like, and even if the displayed content contains other shielding content, the rendered visualized content is not influenced by the other shielding content, so that clearer and more accurate text selection experience can be provided for a user, and the comfort and fluency of reading experience are improved.
Optionally, the implementation manner of rendering the first text content and the attribute information thereof in real time within the picture outline range may include:
amplifying the first text content and the attribute information thereof according to a preset proportional parameter constant, and then rendering the first text content and the attribute information thereof in the picture outline range in real time;
wherein the proportionality parameter constant is used for representing the magnification factor in rendering.
Specifically, a scale parameter constant (scale) may be defined first for describing the magnification when rendering the occlusion content;
when the first text content and the attribute information thereof are rendered, the scale can be used for rendering the first text content and the attribute information thereof in the first shielding range in the picture outline range in real time, so that the display proportion of the finally obtained visualized content is more suitable, and the finally obtained visualized content is conveniently and clearly displayed to a user for text selection.
Optionally, the implementation of rendering the highlight contour in real time within the highlight contour range may include:
and amplifying the highlight contour according to the proportional parameter constant, and then rendering in real time within the highlight contour range.
Specifically, when the first text content and the attribute information thereof in the first shielding range are rendered in the picture outline range in real time according to scale, the highlight outline can be synchronously enlarged according to scale and then rendered in the highlight outline range in real time, so that the content in the picture outline range and the content in the highlight outline range have the same magnification factor, and the content in the highlight outline range are further adapted.
Optionally, an embodiment of the present invention provides a specific implementation of determining the rendering range.
Before rendering the corresponding content in the intersection of the picture outline range and the highlight outline range into the visual content in real time in the rendering range on the touch screen, the following steps can be executed:
determining the rendering range based on a preset offset constant and the contact point coordinates;
wherein the offset constant is used to characterize the degree of offset of the coordinates of the rendering range relative to the coordinates of the contact point.
Specifically, an offset constant may be defined for describing the degree of offset of the rendering position of the content to be rendered with respect to the coordinates of the contact point O (contact point coordinates);
alternatively, the degree of offset may be considered in two ways, namely, the distance of offset and the direction of offset;
1) The offset distance can be expressed by constant delta, and the definition of the constant delta can be realized by using the distance from the central point of the clipping region Q to the upper boundary and adding a certain control quantity to ensure that the re-rendering position and region of the clipping region Q are not blocked;
2) The direction of the offset may be represented by an angle between a line between the rendering position P of the content to be rendered and the center point of the clipping region Q and a horizontal line, and may be an upper side, a lower side, a left side, or a right side with respect to the center point Q, or an offset of any angle.
It should be noted that, the clipping region Q may be obtained by preprocessing the content to be rendered through a clipping algorithm, and the content to be rendered may be processed into a contour matching with the first shielding range Q', for example, the clipping region Q may be defined as a circular contour, and then the content to be rendered is correspondingly processed into a circular picture.
Before the visual content is rendered, the rendering range of the content to be rendered can be calculated according to the offset constant and the coordinates of the contact point O, and the rendering range can be characterized by the coordinates of the rendering position P, and meanwhile, the relation between the size (width and height) of the content to be rendered and the rendering position is considered, so that the content to be rendered can be rendered in the screen of the touch screen.
Optionally, the implementation of determining the rendering range based on a preset offset constant and the coordinates of the contact point may include;
determining a first candidate range based on the offset constant and the contact point coordinates;
when the first candidate range is included in the display range of the touch screen, the first candidate range is used as the rendering range;
in a case where the first candidate range is not included in the display range of the touch screen, a second candidate range included in the display range is selected as the rendering range based on the offset constant and the contact point coordinates.
Specifically, the first candidate range may be determined based on the offset constant and the coordinates of the contact point, and then whether the rendering is performed according to the first candidate range may exceed the display range of the touch screen may be determined, which may be specifically classified into the following two cases:
1) In the case where the first candidate range is included in the display range of the touch screen, it may be understood that the first candidate range may be used as a rendering range to render the visual content in the case where rendering according to the first candidate range does not exceed the display range of the touch screen;
2) In the case where the first candidate range is not included in the display range of the touch screen, it is understood that, in the case where rendering according to the first candidate range would exceed the display range of the touch screen, it is necessary to select a second candidate range that can be included in the display range as a rendering range based on the offset constant and the coordinates of the contact point again, to render the visual contents.
For example, the rendering position P of the content to be rendered may be dynamically calculated according to the offset constant and the coordinates of the contact point O while considering the relationship between the size (width and height) of the content to be rendered and the rendering position P to ensure that the content can be rendered within the screen of the touch screen. Taking as an example the upper side of the center point rendered to the clipping region Q:
Dynamically acquiring coordinates of a contact point O on a screen of a touch screen, subtracting constant delta in an offset constant from y coordinates (ordinate) of the O point to obtain y coordinates of a new rendering position, wherein x coordinates (abscissa) can be consistent with x coordinates of the O point to obtain coordinates of a rendering position P for rendering, at the moment, whether the rendering of the P point exceeds the upper side of the screen or not needs to be calculated, particularly, from the aspects of width, height and the like of contents to be rendered or not, if the content exceeds the upper side of the screen, the fact that the space of the central point of a clipping region Q is insufficient at the moment is explained, the coordinates of the point P of the rendering position need to be recalculated, and particularly, the coordinates of the point P of the rendering position can be adjusted to be on the lower side or the left side and the right side of the central point of the clipping region Q; and if the rendering position P is not exceeded, rendering is carried out at the rendering position P.
Optionally, in the process of updating the coordinates of the contact point, the following steps may be performed:
determining a third candidate range based on the offset constant and the updated contact point coordinates;
and when the third candidate range is not included in the display range of the touch screen, rendering the visual content corresponding to the updated touch point coordinate in the rendering range corresponding to the touch point coordinate before updating.
Specifically, in the process of updating (moving) the coordinates of the contact point O, it can be understood that, in the process of selecting the text, the user continuously updates the coordinates of the rendering position P, and the rendered visual content is updated in real time along with the movement of the finger or the touch pen; meanwhile, in the moving process, whether the rendering exceeds the screen at the rendering position P point can be dynamically calculated, for example, the rendering exceeds the left side or the right side of the screen, and specifically, the following judgment can be performed, for example:
1) If the width of the content to be rendered subtracted from the x coordinate of the P point is smaller than 0, the left side space of the screen is insufficient, at the moment, the x coordinate of the P point can be not updated any more, and only the content of the visual content corresponding to the coordinates of different contact points can be updated; 2) If the width of the x coordinate of the P point plus the content to be rendered is larger than the width of the screen, the right side space of the screen is insufficient, at the moment, the x coordinate of the P point can be not updated any more, and only the content of the visual content corresponding to the coordinates of different contact points can be updated; in summary, it can be ensured that the rendered content does not exceed the left and right sides of the screen.
Optionally, the implementation manner of determining the first shielding range corresponding to the target object on the touch screen based on the contact point coordinates of the target object on the preset touch screen may include:
And determining a first shielding range corresponding to the target object on the touch screen based on the coordinates of the contact point and at least one preset constant.
Specifically, after determining the contact point coordinates, one or more constants may be used to limit the first occlusion range and generate a profile to determine the size of the first occlusion range.
For example, a constant T may be defined, and a circular contour may be generated with the coordinates of the contact point O as the center and the constant T as the radius, where the range within the circular contour may be considered as the size of the first occlusion range Q';
for another example, two constants W and H may be defined, where the constant W represents the width of the rectangle, the constant H represents the height of the rectangle, and the rectangular outline may be generated with the coordinates of the contact point O as the center, that is, the diagonal intersection of the rectangle, W being the width and H being the height, and the rectangular outline may be the size of the first shielding range Q'.
The following illustrates a visual text selection method provided by an embodiment of the present invention.
1. Implementation mode one of visual text selection method
FIG. 3 is a second flow chart of the visual text selection method according to the present invention, as shown in FIG. 3, the method includes steps 301 to 307; wherein:
alternatively, the first occlusion range may be determined by the center point coordinates and the contour of the occlusion region;
specifically, the coordinates of a point (contact point) O of a finger or a stylus touching the screen on the touch screen may be dynamically obtained, and when the finger moves on the screen, for example, the coordinates of the position of the finger moving may be obtained in real time through the system function interface, and may be used as the center point of the first shielding range, so as to determine the position of the first shielding range.
One or more constants may be used to limit the first occlusion range and a contour is generated to determine the size of the first occlusion range. For example, a constant T is defined, a circular outline can be generated by taking the coordinate of the contact point O as the circle center and the constant T as the radius, and the range in the circular outline is the size of the first shielding range Q'; two constants W and H may be defined, where W represents the width of the rectangle, H represents the height of the rectangle, and the coordinate of the contact point O is taken as the center, that is, the intersection point of the diagonal lines of the rectangle, W is the width, and H is the height, so as to generate a rectangular outline, which is taken as the size of the first shielding range Q'.
Specifically, the acquired coordinates of the first shielding range can be used as screen coordinates, and the screen coordinates are converted into document coordinates in the layout document by combining the screen size;
specifically, a proportionality parameter constant can be defined, and the first text content and attribute information thereof which are blocked are rendered in a picture outline range in real time, so that the problem that distortion is caused by obtaining display content in a screenshot mode or the like is solved, or the problem that other content exists in the blocking range to cause blocking is solved.
It should be noted that, text content and some attribute information can be obtained from the layout document through the document coordinates of the layout document corresponding to the first shielding range, and the text content and some attribute information are used as the first text content and the attribute information thereof; wherein the attribute information is such as font, font size, word spacing, etc. The extracted text content can be only document content information, and does not contain other contents such as notes, pictures, signatures, software interfaces and the like, so that the purity of the content is ensured;
it should be noted that, a scale parameter constant (scale) is defined, which may be used to describe the magnification when rendering the occlusion content. Since the original information rendered into the visual contents is text contents and attribute information thereof, the visual contents of the scale of magnification and retaining the original information can be generated without distortion.
Optionally, the content to be rendered may be preprocessed by a clipping algorithm, for example, the content to be rendered is processed into a contour matching the first shielding range Q', for example, a clipping area Q may be defined as a circular contour, and the corresponding content to be rendered is processed into a circular content;
alternatively, the relationship between the size (width and height) of the content to be rendered and the rendering position P may be considered simultaneously according to the rendering position P to ensure that the content to be rendered can be rendered within the screen;
alternatively, the highlighting profile may be one or more;
it should be noted that, in the text selection process, the selected text range is generally identified by rendering the highlight contours, which can be rendered in real time in the rendered content, and only the highlight contours in the first shielding range can be rendered;
Alternatively, a highlighting contour of the same scale as the enlargement of the first text content and the attribute information thereof may be calculated in combination with the proportionality parameter constant;
alternatively, a highlighting contour corresponding to the translated first text content and attribute information thereof may be calculated in combination with the offset constant.
Specifically, the content corresponding to the A1 is rendered on a screen as visual content, so that the range and the position of text selection are displayed through the rendered visual content in real time, and the visual effect of the first shielding range is realized.
2. Implementation mode II of visual text selection method
The visual text selection method specifically comprises the following steps:
s1, defining a range of shielding by a finger or a touch pen, wherein the range is determined by the central point coordinates and the outline of a first shielding range;
optionally, one or more constants may be used to limit the first occlusion range and generate a profile to determine the size of the first occlusion range;
S2, acquiring coordinates of a contact point O of a finger or a touch pen contacting a screen, and taking the coordinates as a center point of a first shielding range to determine the position of the first shielding range;
s3, converting screen coordinates of the first shielding range into document coordinates in the layout document;
s4, acquiring first text content and attribute information of the first text content in a second shielding range corresponding to the first shielding range in the format document from the format document;
s5, defining a proportional parameter constant for describing the magnification factor when the shielding content is rendered;
s6, rendering the first text content and attribute information thereof in the second shielding range in a picture outline range in real time by using a proportional parameter constant so as to solve the problem that the obtained content is possibly distorted or shielded by other content through screenshot;
s7, defining an offset constant for describing the offset degree of the rendering position relative to the coordinate of the contact point O;
s8, calculating the rendering position of the content to be rendered according to the offset constant and the coordinates of the contact point O, and simultaneously considering the relation between the size (width and height) of the content to be rendered and the rendering position so as to ensure that the content to be rendered can be rendered in a screen;
S9, combining the proportional parameter constant and the offset constant, calculating the position and the size of a highlighting contour (possibly one or more) corresponding to text selection, and rendering the highlighting contour in real time in the highlighting contour range;
s10, calculating an intersection A1 of a picture contour range and a highlight contour range;
and S11, rendering the content corresponding to the A1 on a screen so as to display the text selection position in real time, and realizing the amplification and visualization effects of the text content in the first shielding range.
The visual text selection method provided by the embodiment of the invention enables the user to select the text more conveniently and rapidly, ensures the accuracy and the visual effect of the selected text, provides clear and accurate text selection experience for the user on the mobile device, and enables the user to copy, paste, annotate or share the text content more conveniently. The comfort and fluency of the reading experience are improved.
The visual text selection device provided by the invention is described below, and the visual text selection device described below and the visual text selection method described above can be correspondingly referred to each other.
Fig. 4 is a schematic structural diagram of a visual text selection device provided by the present invention, and as shown in fig. 4, a visual text selection device 400 includes:
A determining module 401, configured to determine a first shielding range corresponding to a target object on a touch screen based on coordinates of a contact point of the target object on the touch screen;
the conversion module 402 is configured to convert screen coordinates corresponding to the first shielding range into document coordinates corresponding to a second shielding range in a layout document currently displayed on the touch screen;
a first obtaining module 403, configured to obtain, based on the document coordinates, first text content and attribute information thereof in the second occlusion range from the layout document, and render the first text content and attribute information thereof in a picture outline range in real time;
a second obtaining module 404, configured to obtain a highlight contour corresponding to the second text content selected by the text selection operation performed on the layout document by the target object, and render the highlight contour in real time within a highlight contour range;
a rendering module 405, configured to render, in real time, content corresponding to an intersection of the picture contour range and the highlight contour range into visual content within a rendering range on the touch screen; the rendering range is a range of the touch screen except the first shielding range.
In the visual text selection device provided by the embodiment of the invention, compared with the problem that the display content is distorted or the display content contains other shielding content so that the selected text is invisible because the display content is obtained in a screenshot mode in the related art, the embodiment of the invention directly obtains the first text content shielded in the currently displayed format document and the attribute information thereof, renders the first text content in a picture outline range in real time, combines the highlighting outline corresponding to the second text content selected by a user when the user selects the text, renders the highlighting outline in the highlighting outline range in real time, renders the content corresponding to the intersection of the picture outline range and the highlighting outline range in real time in the non-shielding rendering range of the touch screen to be displayed, and can be understood as rendering the first text content and the highlighting outline corresponding to the first text content into the visual content; the visualized content rendered does not have the problem of distortion of the displayed content caused by operations such as screenshot and the like, and even if the displayed content contains other shielding content, the rendered visualized content is not influenced by the other shielding content, so that clearer and more accurate text selection experience can be provided for a user, and the comfort and fluency of reading experience are improved.
Optionally, the first obtaining module 403 is specifically configured to:
amplifying the first text content and the attribute information thereof according to a preset proportional parameter constant, and then rendering the first text content and the attribute information thereof in the picture outline range in real time;
wherein the proportionality parameter constant is used for representing the magnification factor in rendering.
Optionally, the second obtaining module 404 is specifically configured to:
and amplifying the highlight contour according to the proportional parameter constant, and then rendering in real time within the highlight contour range.
Optionally, the visual text selection apparatus 400 further includes:
a processing module for:
determining the rendering range based on a preset offset constant and the contact point coordinates;
wherein the offset constant is used to characterize the degree of offset of the coordinates of the rendering range relative to the coordinates of the contact point.
Optionally, the processing module is specifically configured to:
determining a first candidate range based on the offset constant and the contact point coordinates;
when the first candidate range is included in the display range of the touch screen, the first candidate range is used as the rendering range;
in a case where the first candidate range is not included in the display range of the touch screen, a second candidate range included in the display range is selected as the rendering range based on the offset constant and the contact point coordinates.
Optionally, in the process of updating the coordinates of the contact point, the processing module is further specifically configured to:
determining a third candidate range based on the offset constant and the updated contact point coordinates;
and when the third candidate range is not included in the display range of the touch screen, rendering the visual content corresponding to the updated touch point coordinate in the rendering range corresponding to the touch point coordinate before updating.
Optionally, the determining module 401 is specifically configured to:
and determining a first shielding range corresponding to the target object on the touch screen based on the coordinates of the contact point and at least one preset constant.
Fig. 5 is a schematic structural diagram of an electronic device according to the present invention, and as shown in fig. 5, the electronic device may include: processor 510, communication interface (Communications Interface) 520, memory 530, and communication bus 540, wherein processor 510, communication interface 520, memory 530 complete communication with each other through communication bus 540. Processor 510 may invoke logic instructions in memory 530 to perform a visual text selection method comprising:
determining a first shielding range corresponding to a target object on a touch screen based on a contact point coordinate of the target object on the preset touch screen;
Converting screen coordinates corresponding to the first shielding range into document coordinates corresponding to a second shielding range in the format document currently displayed by the touch screen;
based on the document coordinates, acquiring first text content and attribute information thereof in the second shielding range from the format document, and rendering the first text content and the attribute information thereof in a picture outline range in real time;
acquiring a highlight outline corresponding to the second text content selected by the text selection operation of the target object on the format document, and rendering the highlight outline in real time within a highlight outline range;
in a rendering range on the touch screen, rendering the corresponding content in the intersection of the picture outline range and the highlight outline range into visual content in real time; the rendering range is a range of the touch screen except the first shielding range.
Further, the logic instructions in the memory 530 described above may be implemented in the form of software functional units and may be stored in a computer-readable storage medium when sold or used as a stand-alone product. Based on this understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art or in a part of the technical solution, in the form of a software product stored in a storage medium, comprising several instructions for causing a computer device (which may be a personal computer, a server, a network device, etc.) to perform all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
In another aspect, the present invention also provides a computer program product comprising a computer program storable on a non-transitory computer readable storage medium, the computer program, when executed by a processor, being capable of performing the method of text selection for visualizations provided by the methods described above, the method comprising:
determining a first shielding range corresponding to a target object on a touch screen based on a contact point coordinate of the target object on the preset touch screen;
converting screen coordinates corresponding to the first shielding range into document coordinates corresponding to a second shielding range in the format document currently displayed by the touch screen;
based on the document coordinates, acquiring first text content and attribute information thereof in the second shielding range from the format document, and rendering the first text content and the attribute information thereof in a picture outline range in real time;
acquiring a highlight outline corresponding to the second text content selected by the text selection operation of the target object on the format document, and rendering the highlight outline in real time within a highlight outline range;
in a rendering range on the touch screen, rendering the corresponding content in the intersection of the picture outline range and the highlight outline range into visual content in real time; the rendering range is a range of the touch screen except the first shielding range.
In yet another aspect, the present invention also provides a non-transitory computer readable storage medium having stored thereon a computer program which, when executed by a processor, is implemented to perform a method of text selection for visualizations provided by the methods described above, the method comprising:
determining a first shielding range corresponding to a target object on a touch screen based on a contact point coordinate of the target object on the preset touch screen;
converting screen coordinates corresponding to the first shielding range into document coordinates corresponding to a second shielding range in the format document currently displayed by the touch screen;
based on the document coordinates, acquiring first text content and attribute information thereof in the second shielding range from the format document, and rendering the first text content and the attribute information thereof in a picture outline range in real time;
acquiring a highlight outline corresponding to the second text content selected by the text selection operation of the target object on the format document, and rendering the highlight outline in real time within a highlight outline range;
in a rendering range on the touch screen, rendering the corresponding content in the intersection of the picture outline range and the highlight outline range into visual content in real time; the rendering range is a range of the touch screen except the first shielding range.
The apparatus embodiments described above are merely illustrative, wherein the elements illustrated as separate elements may or may not be physically separate, and the elements shown as elements may or may not be physical elements, may be located in one place, or may be distributed over a plurality of network elements. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment. Those of ordinary skill in the art will understand and implement the present invention without undue burden.
From the above description of the embodiments, it will be apparent to those skilled in the art that the embodiments may be implemented by means of software plus necessary general hardware platforms, or of course may be implemented by means of hardware. Based on this understanding, the foregoing technical solution may be embodied essentially or in a part contributing to the prior art in the form of a software product, which may be stored in a computer readable storage medium, such as ROM/RAM, a magnetic disk, an optical disk, etc., including several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the method described in the respective embodiments or some parts of the embodiments.
Finally, it should be noted that: the above embodiments are only for illustrating the technical solution of the present invention, and are not limiting; although the invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims (10)
1. A method of visual text selection, comprising:
determining a first shielding range corresponding to a target object on a touch screen based on a contact point coordinate of the target object on the preset touch screen;
converting screen coordinates corresponding to the first shielding range into document coordinates corresponding to a second shielding range in the format document currently displayed by the touch screen;
based on the document coordinates, acquiring first text content and attribute information thereof in the second shielding range from the format document, and rendering the first text content and the attribute information thereof in a picture outline range in real time;
Acquiring a highlight outline corresponding to the second text content selected by the text selection operation of the target object on the format document, and rendering the highlight outline in real time within a highlight outline range;
in a rendering range on the touch screen, rendering the corresponding content in the intersection of the picture outline range and the highlight outline range into visual content in real time; the rendering range is a range of the touch screen except the first shielding range.
2. The visual text selection method according to claim 1, wherein the rendering the first text content and the attribute information thereof in real time within a picture outline range includes:
amplifying the first text content and the attribute information thereof according to a preset proportional parameter constant, and then rendering the first text content and the attribute information thereof in the picture outline range in real time;
wherein the proportionality parameter constant is used for representing the magnification factor in rendering.
3. The visual text selection method of claim 2, wherein said rendering the highlighting contour in real time within the highlighting contour range comprises:
and amplifying the highlight contour according to the proportional parameter constant, and then rendering in real time within the highlight contour range.
4. A method of visual text selection according to any one of claims 1 to 3, wherein prior to rendering corresponding content within the intersection of the picture outline range and the highlight outline range into visual content in real time within a rendering range on the touch screen, the method further comprises:
determining the rendering range based on a preset offset constant and the contact point coordinates;
wherein the offset constant is used to characterize the degree of offset of the coordinates of the rendering range relative to the coordinates of the contact point.
5. The visual text selection method according to claim 4, wherein the determining the rendering range based on a preset offset constant and the contact point coordinates includes;
determining a first candidate range based on the offset constant and the contact point coordinates;
when the first candidate range is included in the display range of the touch screen, the first candidate range is used as the rendering range;
in a case where the first candidate range is not included in the display range of the touch screen, a second candidate range included in the display range is selected as the rendering range based on the offset constant and the contact point coordinates.
6. The visual text selection method of claim 4, wherein during the updating of the contact point coordinates, the method further comprises:
determining a third candidate range based on the offset constant and the updated contact point coordinates;
and when the third candidate range is not included in the display range of the touch screen, rendering the visual content corresponding to the updated touch point coordinate in the rendering range corresponding to the touch point coordinate before updating.
7. A visual text selection method according to any one of claims 1 to 3, wherein the determining, based on coordinates of a contact point of a target object on a preset touch screen, a corresponding first occlusion range of the target object on the touch screen includes:
and determining a first shielding range corresponding to the target object on the touch screen based on the coordinates of the contact point and at least one preset constant.
8. A visual text selection device, comprising:
the determining module is used for determining a first shielding range corresponding to a target object on a touch screen based on the coordinates of the contact point of the target object on the preset touch screen;
The conversion module is used for converting the screen coordinates corresponding to the first shielding range into document coordinates corresponding to a second shielding range in the format document currently displayed by the touch screen;
the first acquisition module is used for acquiring first text content and attribute information thereof in the second shielding range from the format document based on the document coordinates, and rendering the first text content and the attribute information thereof in a picture outline range in real time;
the second acquisition module is used for acquiring a highlight outline corresponding to the second text content selected by the text selection operation of the target object on the layout document, and rendering the highlight outline in a highlight outline range in real time;
the rendering module is used for rendering the corresponding content in the intersection of the picture outline range and the highlight outline range into visual content in real time in the rendering range on the touch screen; the rendering range is a range of the touch screen except the first shielding range.
9. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the visual text selection method of any of claims 1 to 7 when the program is executed.
10. A non-transitory computer readable storage medium having stored thereon a computer program, wherein the computer program when executed by a processor implements the visual text selection method of any of claims 1 to 7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310452675.9A CN116166165B (en) | 2023-04-25 | 2023-04-25 | Visual text selection method, visual text selection device and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310452675.9A CN116166165B (en) | 2023-04-25 | 2023-04-25 | Visual text selection method, visual text selection device and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN116166165A CN116166165A (en) | 2023-05-26 |
CN116166165B true CN116166165B (en) | 2023-06-27 |
Family
ID=86420440
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202310452675.9A Active CN116166165B (en) | 2023-04-25 | 2023-04-25 | Visual text selection method, visual text selection device and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN116166165B (en) |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101553775A (en) * | 2006-12-07 | 2009-10-07 | 微软公司 | Operating touch screen interfaces |
CN106155540A (en) * | 2015-04-03 | 2016-11-23 | 北大方正集团有限公司 | Electronic brush pen form of a stroke or a combination of strokes treating method and apparatus |
CN107908338A (en) * | 2017-11-13 | 2018-04-13 | 掌阅科技股份有限公司 | Hide word rearrangement method, terminal and the medium of finger pressing position |
CN111078072A (en) * | 2019-12-13 | 2020-04-28 | 努比亚技术有限公司 | Display control method, device and computer readable storage medium |
CN111460764A (en) * | 2020-03-30 | 2020-07-28 | 掌阅科技股份有限公司 | Electronic book labeling method, electronic equipment and storage medium |
US11074397B1 (en) * | 2014-07-01 | 2021-07-27 | Amazon Technologies, Inc. | Adaptive annotations |
CN115167718A (en) * | 2022-06-14 | 2022-10-11 | 百望股份有限公司 | OFD document local amplification display method, device, equipment and storage medium |
-
2023
- 2023-04-25 CN CN202310452675.9A patent/CN116166165B/en active Active
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101553775A (en) * | 2006-12-07 | 2009-10-07 | 微软公司 | Operating touch screen interfaces |
US11074397B1 (en) * | 2014-07-01 | 2021-07-27 | Amazon Technologies, Inc. | Adaptive annotations |
CN106155540A (en) * | 2015-04-03 | 2016-11-23 | 北大方正集团有限公司 | Electronic brush pen form of a stroke or a combination of strokes treating method and apparatus |
CN107908338A (en) * | 2017-11-13 | 2018-04-13 | 掌阅科技股份有限公司 | Hide word rearrangement method, terminal and the medium of finger pressing position |
CN111078072A (en) * | 2019-12-13 | 2020-04-28 | 努比亚技术有限公司 | Display control method, device and computer readable storage medium |
CN111460764A (en) * | 2020-03-30 | 2020-07-28 | 掌阅科技股份有限公司 | Electronic book labeling method, electronic equipment and storage medium |
CN115167718A (en) * | 2022-06-14 | 2022-10-11 | 百望股份有限公司 | OFD document local amplification display method, device, equipment and storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN116166165A (en) | 2023-05-26 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US9501853B2 (en) | Providing in-line previews of a source image for aid in correcting OCR errors | |
JP6869249B2 (en) | Methods and systems for generating and selectively outputting two types of ink vector data | |
US7697001B2 (en) | Personalized ink font | |
US20120324332A1 (en) | Using Gestures to Generate Code, Including for Text Flow | |
JP2012203458A (en) | Image processor and program | |
CN109697414B (en) | Text positioning method and device | |
CN110853488B (en) | POI (Point of interest) label display method, device and equipment | |
JP2022066321A (en) | Information processing device and program | |
CN113487473A (en) | Method and device for adding image watermark, electronic equipment and storage medium | |
CN113538623B (en) | Method, device, electronic equipment and storage medium for determining target image | |
JP2016200860A (en) | Information processing apparatus, control method thereof, and program | |
US20160357395A1 (en) | Information processing device, non-transitory computer-readable recording medium storing an information processing program, and information processing method | |
EP2410487B1 (en) | Method for automatically modifying a graphics feature to comply with a resolution limit | |
CN109934058B (en) | Face image processing method, face image processing device, electronic apparatus, storage medium, and program | |
JP5597441B2 (en) | Handwritten character input device | |
CN116166165B (en) | Visual text selection method, visual text selection device and storage medium | |
CN115019324A (en) | Interactive method and device for text scanning, computer equipment and storage medium | |
CN106354381B (en) | Image file processing method and device | |
JP2009193308A (en) | Information display device and program | |
US20220019830A1 (en) | Systems and methods for generating typographical images or videos | |
JP4552685B2 (en) | Coordinate detection apparatus and coordinate detection method | |
CN112269467A (en) | Translation method based on AR and AR equipment | |
JP5612975B2 (en) | Serif data generation apparatus, serif data generation method, and program | |
US20130104014A1 (en) | Viewer unit, server unit, display control method, digital comic editing method and non-transitory computer-readable medium | |
US11233920B1 (en) | Transforming document elements for modified document layouts |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |