CN111552410B - Method, device, equipment and computer readable storage medium for processing writing trace - Google Patents

Method, device, equipment and computer readable storage medium for processing writing trace Download PDF

Info

Publication number
CN111552410B
CN111552410B CN202010403073.0A CN202010403073A CN111552410B CN 111552410 B CN111552410 B CN 111552410B CN 202010403073 A CN202010403073 A CN 202010403073A CN 111552410 B CN111552410 B CN 111552410B
Authority
CN
China
Prior art keywords
dirty region
bitmap
dirty
revocation
picture
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
Application number
CN202010403073.0A
Other languages
Chinese (zh)
Other versions
CN111552410A (en
Inventor
张汉江
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangzhou Shiyuan Electronics Thecnology Co Ltd
Guangzhou Shirui Electronics Co Ltd
Original Assignee
Guangzhou Shiyuan Electronics Thecnology Co Ltd
Guangzhou Shirui Electronics 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 Guangzhou Shiyuan Electronics Thecnology Co Ltd, Guangzhou Shirui Electronics Co Ltd filed Critical Guangzhou Shiyuan Electronics Thecnology Co Ltd
Priority to CN202010403073.0A priority Critical patent/CN111552410B/en
Publication of CN111552410A publication Critical patent/CN111552410A/en
Application granted granted Critical
Publication of CN111552410B publication Critical patent/CN111552410B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input 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/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/03Arrangements for converting the position or the displacement of a member into a coded form
    • G06F3/041Digitisers, e.g. for touch screens or touch pads, characterised by the transducing means
    • G06F3/0416Control or interface arrangements specially adapted for digitisers
    • 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

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Controls And Circuits For Display Device (AREA)

Abstract

The application provides a method, a device, equipment and a computer readable storage medium for processing writing trace, which comprise the following steps: storing a first dirty region bitmap before drawing the writing trace in a revocation cache layer; wherein the dirty area is an area covered by the writing trace; and responding to the withdrawal operation, acquiring a first dirty region bitmap from the withdrawal cache layer, and updating the dirty region in the picture by adopting the first dirty region bitmap. In the method, the device, the equipment and the computer readable storage medium provided by the application, before a writing trace is drawn, the first dirty region bitmap covered by the writing trace is stored, and when the electronic equipment responds to the withdrawal operation, the stored first dirty region bitmap can be directly used for updating the dirty region in the picture, so that the effect of withdrawing the drawn writing trace can be achieved only by local updating, and the calculation power consumed by the withdrawal operation is greatly reduced.

Description

Method, device, equipment and computer readable storage medium for processing writing trace
Technical Field
The present disclosure relates to computer technology, and more particularly, to a method, apparatus, device, and computer readable storage medium for processing a written trace.
Background
Currently, many electronic devices are provided with handwriting drawing functions, and a user can operate the electronic device to form marks, which form letters or pictures.
In the existing scheme, after a user draws a graph on a drawing board, the last drawn content can be withdrawn by withdrawing a key. For example, the user may click the dismiss key if he is not satisfied with the newly written trace.
Wherein the electronic device refreshes the whole picture when undoing, resulting in a need to consume a large amount of computing power in the undoing operation.
Disclosure of Invention
The present disclosure provides a method, apparatus, device, and computer-readable storage medium for processing writing traces to solve the problem in the prior art that canceling an operation requires a large computing power of an electronic device.
A first aspect of the present disclosure provides a method of processing a written trace, including:
storing a first dirty region bitmap before drawing the writing trace in a revocation cache layer; wherein the dirty area is an area covered by the writing trace;
and responding to the undoing operation, acquiring the first dirty region bitmap from the undoing cache layer, and updating the dirty region in the picture by adopting the first dirty region bitmap.
Another aspect of the present disclosure is to provide a writing trace-processing apparatus including:
the first storage module is used for storing a first dirty region bitmap before drawing the writing trace in the revocation cache layer; wherein the dirty area is an area covered by the writing trace;
and the revocation module is used for responding to revocation operation, acquiring the first dirty region bitmap from the revocation cache layer, and updating the dirty region in the picture by adopting the first dirty region bitmap.
Yet another aspect of the present disclosure is to provide a writing trace-processing apparatus, comprising:
a memory;
a processor; and
a computer program;
wherein the computer program is stored in the memory and configured to be executed by the processor to implement the method of writing trace processing as described in the first aspect above.
It is yet another aspect of the present disclosure to provide a computer readable storage medium having stored thereon a computer program which is executed by a processor to implement the method of processing a written trace as described in the first aspect above.
The technical effects of the method, the device, the equipment and the computer readable storage medium for processing the writing trace provided by the disclosure are as follows:
the application provides a method, a device, equipment and a computer readable storage medium for processing writing trace, which comprise the following steps: storing a first dirty region bitmap before drawing the writing trace in a revocation cache layer; wherein the dirty area is an area covered by the writing trace; and responding to the withdrawal operation, acquiring a first dirty region bitmap from the withdrawal cache layer, and updating the dirty region in the picture by adopting the first dirty region bitmap. In the method, the device, the equipment and the computer readable storage medium provided by the application, before a writing trace is drawn, the first dirty region bitmap covered by the writing trace is stored, and when the electronic equipment responds to the withdrawal operation, the stored first dirty region bitmap can be directly used for updating the dirty region in the picture, so that the effect of withdrawing the drawn writing trace can be achieved only by local updating, and the calculation power consumed by the withdrawal operation is greatly reduced.
Drawings
FIG. 1 is a schematic diagram of an application scenario according to an exemplary embodiment of the present application;
FIG. 2 is a flow chart of a method of processing a written trace, according to an exemplary embodiment of the application;
FIG. 3 is a schematic drawing of a written trace shown in a first exemplary embodiment of the application;
FIG. 4 is a schematic drawing of a written trace shown in a second exemplary embodiment of the application;
FIG. 5 is a first dirty region map illustration in accordance with an exemplary embodiment of the present application;
FIG. 6 is a user interface diagram illustrating an exemplary embodiment of the present application;
FIG. 7 is a flowchart of a method of processing a written trace shown in a second exemplary embodiment of the application;
FIG. 8 is a schematic diagram illustrating determining a first dirty region bitmap in a first screen bitmap according to an exemplary embodiment of the present application;
FIG. 9 is a diagram illustrating updating a current frame according to an exemplary embodiment of the present application;
FIG. 10 is a schematic drawing of a written trace shown in an exemplary embodiment of the application;
FIG. 11 is a schematic diagram showing the effect of restoring a written trace according to an exemplary embodiment of the present application;
FIG. 12 is a block diagram of a written trace processing device according to an exemplary embodiment of the application;
FIG. 13 is a block diagram of a writing trace processing apparatus according to another exemplary embodiment of the present application;
fig. 14 is a block diagram of a writing trace-processing apparatus according to an exemplary embodiment of the present application.
Detailed Description
Currently, when a user uses a hand-drawing function in an electronic device, a cancel function is often used.
Fig. 1 is a schematic view of an application scenario according to an exemplary embodiment of the present application.
For example, in fig. 1, the left side is a picture drawn by the user, and the last drawn is 11 parts, and if the user performs the cancel operation, the picture may be updated to the right side style.
When the electronic device responds to the cancel operation, the last drawn part of the user can be emptied, the drawing is carried out again in the clear area, and then the whole picture is refreshed according to the drawn content in the area. However, if the content drawn in the screen is large, it is needless to say that a large amount of effort is required to refresh the entire screen.
In the scheme provided by the application, the area covered by the writing trace of the user is used as the dirty area, the first dirty area bitmap before drawing the writing trace is stored, when the user performs the withdrawal operation, the stored first dirty area bitmap is directly obtained, and the first dirty area in the picture is updated by using the bitmap, so that the whole picture is not required to be updated, and only the first dirty area is required to be updated, thereby reducing the calculation power consumed by the withdrawal operation.
Fig. 2 is a flowchart illustrating a method of processing a writing trace according to an exemplary embodiment of the present application.
As shown in fig. 2, the method for processing writing traces provided in this embodiment includes:
step 201, storing a first dirty region bitmap before drawing a writing trace in a revocation cache layer; wherein the dirty area is an area covered by the writing trace.
The method provided by the application can be executed by the electronic equipment with the computing capability. The electronic device may be further provided with software such as drawing and handwriting board, and a user may perform drawing operation in the electronic device by operating the electronic device. The drawing operation may be an operation of writing a character or an operation of drawing a pattern, and is specifically determined by the behavior of the user, which is not limited by the present application.
Specifically, the user may perform a drawing operation in the electronic device, and the electronic device may generate a corresponding screen based on the user operation.
Fig. 3 is a schematic drawing of a written trace shown in a first exemplary embodiment of the application.
Fig. 4 is a schematic drawing of a written trace shown in a second exemplary embodiment of the application.
As shown in fig. 3 and 4, the user can draw the strokes 41 on the basis of the screen shown in fig. 3 through the operation, so as to form the screen shown in fig. 4.
The stroke 41 is the last written trace.
Further, in the method provided by the present application, the area covered by the writing trace is used as the dirty area, and in fig. 3, the area 31 covered by the stroke 41 is the first dirty area.
In practical application, the first dirty region bitmap before drawing the writing trace can be stored in the revocation cache layer. The revocation cache layer may be preset, for example, may be generated when a file having a drawing function is created. For example, the electronic device may create the revocation cache layer when a user creates a drawing file, or creates a tablet file. For another example, the revocation cache layer may be created when the user draws an element, such as when the user selects a brush, the user may be considered to be about to draw, at which point the electronic device may create the revocation cache layer.
In the picture formed before drawing a writing trace, the region picture covered by the writing trace can be stored in the revocation cache layer.
For example, a history screen shot may be saved before the user draws the current written trace. After the user draws the writing trace, the first dirty region bitmap is intercepted from the stored historical picture screenshot according to the area covered by the writing trace, and is stored in the revocation cache layer. For another example, a picture before the user draws the written trace may be stored, so that the first dirty region bitmap may be determined in the stored picture from the written trace newly drawn by the user.
FIG. 5 is a schematic representation of a first dirty region bit in accordance with an exemplary embodiment of the present application.
As shown in fig. 5, if the drawn picture is shown in fig. 3 and the drawn picture is shown in fig. 4 by a user operation, the stored first dirty region map is shown in fig. 5.
Step 202, in response to the undo operation, acquiring a first dirty region bitmap from the undo cache layer, and updating the first dirty region in the frame by using the first dirty region bitmap.
Specifically, in the drawing process, if the current drawn writing trace is not satisfied, the user can perform the withdrawal operation. For example, after the user finishes drawing, the user may click the cancel button.
Fig. 6 is a diagram of a user interface shown in an exemplary embodiment of the present application.
As shown in fig. 6, the user can perform a drawing operation in the interface. Multiple operable keys may also be included in the interface, such as store, undo, restore, shut down, etc. Wherein the user may click on the undo key 61 causing the electronic device to undo the last written trace drawn by the user.
Further, if the electronic device receives the revocation operation, the electronic device may obtain a first dirty region bitmap from the revocation cache layer, and update the dirty region in the picture using the first dirty region bitmap.
When the method is actually applied, before a writing trace is drawn, the first dirty region bitmap corresponding to the coverage area of the cache layer is stored in the cache layer, and when the writing trace is withdrawn, the stored first dirty region bitmap before the writing trace is drawn can be used for updating the dirty region in the current picture, for example, the acquired first dirty region bitmap is stuck to the dirty region in the picture, so that the picture is in a state before the writing trace is drawn, and the withdrawal effect is achieved.
This approach does not require updating the entire picture, only local dirty regions.
The method provided by the present embodiment is for processing written marks, which is performed by a device provided with the method provided by the present embodiment, which is typically implemented in hardware and/or software.
The writing trace processing method provided by the application comprises the following steps: storing a first dirty region bitmap before drawing the writing trace in a revocation cache layer; wherein the dirty area is an area covered by the writing trace; and responding to the withdrawal operation, acquiring a first dirty region bitmap from the withdrawal cache layer, and updating the dirty region in the picture by adopting the first dirty region bitmap. In the method provided by the application, before the written trace is drawn, the first dirty region bitmap covered by the written trace is stored, and when the electronic equipment responds to the withdrawal operation, the stored first dirty region bitmap can be directly used for updating the dirty region in the picture, so that the effect of withdrawing the drawn written trace can be achieved only by local updating, and the calculation power consumed by the withdrawal operation is greatly reduced.
Fig. 7 is a flowchart of a writing trace processing method according to a second exemplary embodiment of the present application.
As shown in fig. 7, the method for processing writing trace provided by the application comprises the following steps:
step 701, a first picture bitmap of a non-drawn writing trace is obtained.
The method provided by the application can be executed by the electronic equipment with the computing capability. The electronic device may be further provided with software such as drawing and handwriting board, and a user may perform drawing operation in the electronic device by operating the electronic device. The drawing operation may be an operation of writing a character or an operation of drawing a pattern, and is specifically determined by the behavior of the user, which is not limited by the present application.
Specifically, the user may perform a drawing operation in the electronic device, and the electronic device may generate a corresponding screen based on the user operation. The screen is updated as the user operates.
In the method provided by the application, before a user draws a writing trace, a first picture bitmap which does not draw the writing trace is acquired. The writing trace specifically drawn is not limited.
For example, when the user newly creates a file and performs a drawing operation in the file, the electronic device may acquire a first picture bitmap corresponding to the blank file. For another example, during a drawing process, such as drawing N strokes, the electronic device may obtain a first visual bitmap corresponding to a visual including n+1 strokes before the user draws the N strokes.
In this way, the electronic device can record the state of the user's picture before drawing a written trace.
Step 702, determining a dirty area corresponding to the writing trace in response to the drawing operation.
Step 703, obtaining a first dirty region bitmap from the first frame bitmap according to the dirty region; wherein the first dirty region bitmap has an operation identifier.
Further, on the basis of the current picture, the user can perform drawing operation. Such as drawing horizontal lines, curves, rectangular boxes, etc. The electronic device may determine a dirty region, i.e., an area covered by the written trace, in response to the drawing operation.
Acquiring the position information of the writing trace in the picture, and determining the dirty area according to the position information
In practical application, the position information of the writing trace in the picture can be obtained, and then the dirty area is determined according to the position information. Such as coordinates of the written trace, relative position information, etc.
For example, if the writing trace is a rectangular frame, the dirty region can be determined according to the coordinates of four corner points of the rectangular frame.
Wherein the first dirty region bitmap may be obtained from the determined dirty region in the first picture bitmap. For example, if the dirty region is in the middle of the frame, the first dirty region bitmap may be acquired in the middle of the first frame bitmap. For another example, a corresponding first dirty region bitmap may be obtained from the first picture bitmap according to the position information of the dirty region in the current picture.
FIG. 8 is a diagram illustrating determining a first dirty region bitmap in a first frame bitmap according to an exemplary embodiment of the present application.
As shown in fig. 8, the left side shows a first screen bitmap, and the right side shows a current screen obtained by the electronic device in response to a drawing operation. If the dirty area determined according to the writing trace is 81, the area 82 corresponding to the dirty area in the first picture bitmap may be directly used as the first dirty area bitmap.
After the first dirty region bitmap is obtained, the first picture bitmap to which the first dirty region bitmap belongs can be deleted, so that the first picture bitmap does not occupy a larger memory space.
Step 704, storing the acquired first dirty region bitmap in the revocation cache layer; wherein the first dirty region bitmap has an operation identifier.
Specifically, after the first dirty region bitmap is obtained, it may be stored in the revocation cache layer, in a manner similar to step 201.
Further, the first dirty region bitmap may have an operation identification. For example, the operation identifier comitid may be provided, the picture identifier of the first dirty region bitmap may be undo, and the current first dirty region bitmap may be obtained through stitching and identified as comitidundo.
In practical application, for each drawing operation, a first dirty region bitmap corresponding to the drawing operation may be stored. These bitmaps may be distinguished in particular by the identity of the first dirty region bitmap commitIdundo. For example, if the user draws 5 strokes in total, 5 first dirty region bitmaps may be acquired correspondingly, and the identifiers may be respectively commit1undo, commit2undo, commit3undo, commit4undo, and commit5undo.
Optionally, before storing the first dirty region bitmap, the method provided in this embodiment may further include determining whether there is enough memory space to store the first dirty region bitmap. If there is enough cache space, the first dirty region bitmap is directly stored in the revocation cache layer.
If there is not enough memory space to store the first dirty region bitmap, then continuing to determine whether the first dirty region bitmap is already stored in the revocation cache layer. Such as a first dirty region bitmap stored by the electronic device in response to other rendering operations prior to the rendering operation.
And if the first dirty region bitmap is stored in the revocation cache layer, deleting the first dirty region bitmap existing in the revocation cache layer according to the storage time. Specifically, the first dirty region bitmap with the earliest storage time can be deleted, if the storage space is still insufficient after deleting one first dirty region bitmap, the first dirty region bitmap with the earliest storage time can be continuously deleted in the rest bitmaps.
And if the first dirty region bitmap is not stored in the revocation cache layer, storing the first dirty region bitmap acquired currently in an external storage medium.
Step 705, responding to the undo operation, and obtaining the first dirty region bitmap from the undo cache layer according to the operation identifier corresponding to the undo operation.
In the drawing process, if the current drawn writing trace is unsatisfactory, the user can perform the withdrawal operation.
In particular, the undo operation may have a corresponding operation identification, which may for example correspond to the operation identification included in the first dirty region bitmap. For example, the operation identifier of the first revocation operation may be the same as the operation identifier of the first dirty bitmap stored last, and when the revocation operation is continuously performed, the operation identifier of the second revocation operation may be the same as the operation identifier of the first dirty bitmap stored last.
For example, 5 first dirty region bitmaps are stored together, and the operation identifiers of the first dirty region bitmaps are respectively commit1, commit2, commit3, commit4, and commit5 according to the storage order. When the user performs the first revocation operation, the operation identifier corresponding to the revocation operation is the comment 5, and if the user continuously performs the revocation operation, the operation identifier corresponding to the second revocation operation is the comment 4.
Further, the electronic device may splice the operation identifier corresponding to the undo operation with the picture identifier undo of the first dirty region bitmap, so as to obtain the identifier of the first dirty region bitmap. For example, the revocation operation is identified as commit5, and then the obtained first dirty region bitmap is identified as commit5undo, and the electronic device may obtain the first dirty region bitmap identified as commit5undo from the revocation cache layer.
In one embodiment, the operation identifier may be further used as an identifier corresponding to the first dirty region bitmap, and further the operation identifier corresponding to the undo operation may be directly utilized to obtain the first dirty region bitmap from the undo cache layer. For example, the last stored first dirty region bitmap is marked as commit5, and the operation corresponding to the undo operation is marked as commit5, then commit5 may be directly obtained from the undo cache layer.
In another embodiment, the first dirty region bitmap may be further obtained from the revocation cache layer according to the number of times of consecutively performing the revocation operation in reverse order of the storage order. For example, if the user performs a revocation operation once, the last stored first dirty region bitmap may be obtained from the revocation cache layer, and if the user performs the revocation operation twice consecutively, the last stored first dirty region bitmap and the second last stored first dirty region bitmap are obtained from the revocation cache layer respectively.
Step 706, pasting the first dirty region bitmap in the dirty region of the current frame.
After the first dirty region bitmap is acquired, the current picture can be updated by using the first dirty region bitmap. Specifically, the obtained first dirty region bitmap can be pasted in the dirty region of the current picture, so that the picture is restored to a state before the written trace is drawn.
Fig. 9 is a schematic diagram illustrating updating a current picture according to an exemplary embodiment of the present application.
As shown in fig. 9, the left side is the state of the current screen, and the dirty region determined therein is 91. The acquired first dirty region bitmap is 92. The first dirty region bitmap may be stuck to the dirty region 91, so that the picture is restored to the state before the written trace is drawn, and the undoing effect is achieved.
Optionally, the method provided by the application can further comprise the following steps.
Step 707, storing the second dirty region bitmap after drawing the writing trace in the buffer layer.
Specifically, after the user draws the writing trace in the picture, the electronic device may further obtain a second dirty region bitmap corresponding to the dirty region. In this case, the second dirty region bitmap includes a written trace currently drawn by the user.
Further, step 707 may be performed after step 702.
Fig. 10 is a schematic diagram of a written trace shown in an exemplary embodiment of the application.
As shown in fig. 10, after the user finishes the drawing operation, if the dirty area corresponding to the writing trace determined by the drawing operation is 102, the portion corresponding to the dirty area 102 may be stored as a second dirty area bitmap as shown in a screen 101.
In practical application, the second dirty region bitmap after drawing the writing trace can be stored in the cache layer. The buffer layer may be set in advance, for example, may be generated when a file having a drawing function is created. For example, the electronic device may create the cache layer when the user creates a drawing file, or creates a tablet file. For another example, the cache layer may be created when the user draws an element, such as when the user selects a brush, the user may be considered to be about to perform a drawing operation, at which point the electronic device may create the cache layer.
In the method provided by the application, the first dirty region bitmap is a bitmap which does not comprise new writing marks and corresponds to the dirty region in the picture, and the second dirty region bitmap is a bitmap which comprises new writing marks and corresponds to the dirty region in the picture.
After the user draws the writing trace, the electronic device may obtain a second picture bitmap corresponding to the current picture. And acquiring a second dirty region bitmap from the second picture bitmap according to the dirty region. The dirty region is the dirty region determined in step 702, that is, the dirty region corresponding to the written trace is determined in response to the drawing operation.
Specifically, the dirty region portion may be truncated in the second picture bitmap, thereby forming a second dirty region bitmap.
Step 708, in response to the restore operation, obtaining a second dirty region bitmap from the cache layer, and updating the frame with the second dirty region bitmap.
In the drawing process, the user often has the condition that after the drawn writing trace is withdrawn, the writing trace is expected to be recovered. At this time, the user may click a resume button in the user interface, and further send a resume instruction to the electronic device. In this case, the electronic device can update the screen according to the pre-stored second dirty region bitmap, thereby achieving the recovery effect.
Specifically, step 708 may follow steps 705, 707. That is, the electronic device may respond to the resume operation on the basis of performing the revoked operation.
Further, the electronic device may obtain a second dirty region bitmap from the cache layer in response to the recovery operation, and update the current frame using the second dirty region bitmap. Since the second dirty region bitmap includes the writing trace, the current picture can be updated by using the second dirty region to achieve the effect of recovering the operation.
In practical application, the second dirty region bitmap after drawing the writing trace has the same operation identifier as the first dirty region bitmap before drawing the same writing trace. For example, in storing the second dirty region bitmap, the operation identification comittID may be used as an identification of the second dirty region bitmap.
When the second dirty region bitmap is acquired, the second dirty region bitmap may be acquired from the cache layer according to an operation identifier corresponding to the recovery operation. The operation identifier of the recovery operation may correspond to the operation identifier of the revocation operation. Specifically, the operation identifier of the recovery operation may be the reverse order of the operation identifier of the revocation operation.
For example, if the user performs a cancel operation, the operation identifier of the cancel operation is commit2, and if the user performs a restore operation again, the operation identifier corresponding to the restore operation is commit2. Assuming that a user draws two writing marks in the drawing process, wherein a first dirty region bitmap corresponding to the first writing mark is marked as a commit1und, and a second dirty region bitmap is marked as a commit1; the second dirty region bitmap corresponding to the second writing trace is identified as commit2undo, and the second dirty region bitmap is identified as commit2. If the user performs a undo operation once, the screen may be updated using the first dirty bitmap commit2 undo. If the user has performed a restore operation again, the electronic device can update the screen with the second dirty bitmap identified as commit2.
For example, the user continuously performs the revocation operation twice, the operation identifiers of the revocation operation twice are respectively the commit2 and commit1, and if the user continuously performs the recovery operation twice again, the operation identifiers corresponding to the recovery operation are respectively the commit1 and commit2. Assuming that a user draws two writing marks in the drawing process, wherein a first dirty region bitmap corresponding to the first writing mark is marked as a commit1und, and a second dirty region bitmap is marked as a commit1; the second dirty region bitmap corresponding to the second writing trace is identified as commit2undo, and the second dirty region bitmap is identified as commit2. If the user performs the undo operation once, the screen may be updated using the first dirty bitmap commit2und, and if the user performs the undo operation again, the screen may be continuously updated using commit1 undo. If the user performs the restore operation again, the electronic device can update the screen using the second dirty map identified as commit1, and if the user performs the restore operation again, the electronic device can update the screen using the second dirty map identified as commit2.
When the undoing operation or the restoring operation is continuously performed, the corresponding dirty area in the picture is also changed because the writing traces aimed at by different operations are different.
Fig. 11 is a schematic diagram showing an effect of restoring a written trace according to an exemplary embodiment of the present application.
As shown in fig. 11, 111 is a screen after the undo operation, 112 is a second dirty region bitmap acquired in response to the resume operation, and the 111 may be updated using 112 to obtain a screen as shown by 113.
Specifically, the obtained second dirty region bitmap can be stuck in the dirty region of the picture, so as to achieve the effect of recovering the picture. In the method provided by the application, when the electronic equipment executes the recovery operation, only the dirty region in the picture is required to be updated, and the whole picture is not required to be refreshed, so that the computational power consumption of the electronic equipment can be reduced.
Alternatively, in one embodiment, in response to a drawing operation, a written trace generated by the drawing operation is displayed in real time in a screen. In this embodiment, along with the drawing operation of the user, the writing trace drawn by the user can be displayed in real time, so that the user can see the drawing effect in real time. In the drawing process, the picture changes in real time along with the operation of the user, namely, each drawing point picture displays a corresponding trace.
Fig. 12 is a block diagram of a writing trace processing apparatus according to an exemplary embodiment of the present application.
As shown in fig. 12, the writing trace processing apparatus provided in this embodiment includes:
a first storage module 121, configured to store a first dirty region bitmap before drawing a writing trace in a revocation cache layer; wherein the dirty area is an area covered by the writing trace;
and a revocation module 122, configured to obtain the first dirty region bitmap from the revocation cache layer in response to a revocation operation, and update the dirty region in the picture with the first dirty region bitmap.
The writing trace processing apparatus provided in this embodiment includes: the first storage module is used for storing a first dirty region bitmap before drawing the writing trace in the revocation cache layer; wherein the dirty area is an area covered by the writing trace; and the revocation module is used for responding to the revocation operation, acquiring a first dirty region bitmap from the revocation cache layer, and updating the dirty region in the picture by adopting the first dirty region bitmap. In the device provided by the application, the first dirty region bitmap covered by the writing trace is stored before the writing trace is drawn, and the electronic equipment can directly update the dirty region in the picture by using the stored first dirty region bitmap when responding to the withdrawal operation, so that the effect of withdrawing the drawn writing trace can be achieved only by local updating, and the calculation power consumed by the withdrawal operation is greatly reduced.
The specific principle and implementation manner of the writing trace processing apparatus provided in this embodiment are similar to those of the embodiment shown in fig. 2, and will not be described herein again.
Fig. 13 is a block diagram of a writing trace processing apparatus according to another exemplary embodiment of the present application.
As shown in fig. 13, on the basis of the above embodiment, the writing trace processing apparatus provided in this embodiment further includes:
the obtaining module 123 is configured to obtain a first frame bitmap of an un-drawn writing trace;
and the determining module 124 is configured to determine a dirty region corresponding to the writing trace in response to a drawing operation, and obtain the first dirty region bitmap from the first picture bitmap according to the dirty region.
Optionally, the method further comprises:
the second storage module 125 stores a second dirty region bitmap after drawing the written trace in the buffer layer;
and a restoration module 126, configured to obtain the second dirty region bitmap from the cache layer in response to a restoration operation, and update the dirty region of the frame with the second dirty region bitmap.
Optionally, the obtaining module 123 is further configured to obtain a second frame bitmap after the drawing of the writing trace;
the determining module 124 is further configured to determine a dirty region corresponding to the writing trace in response to a drawing operation, and obtain the second dirty region bitmap from the second frame bitmap according to the dirty region.
Optionally, the determining module 124 is specifically configured to:
and acquiring the position information of the writing trace in the picture, and determining the dirty area according to the position information.
Optionally, the position information includes corner coordinates of the writing trace.
Optionally, the first dirty region bitmap before drawing the writing trace has an operation identifier;
the revocation module 122 is specifically configured to:
and acquiring the first dirty region bitmap from the revocation cache layer according to the operation identifier corresponding to the revocation operation.
Optionally, the second dirty region bitmap after drawing the writing trace has the same operation identifier as the first dirty region bitmap before drawing the writing trace;
the recovery module 126 is specifically configured to:
and acquiring the second dirty region bitmap from the cache layer according to the operation identifier corresponding to the recovery operation.
Optionally, the revocation module 122 is specifically configured to:
and pasting the first dirty region bitmap in the dirty region of the current picture.
Optionally, the recovery module 126 is specifically configured to:
and pasting the second dirty region bitmap in the dirty region of the current picture.
Optionally, the apparatus further includes a drawing module 127 for:
and responding to the drawing operation, and displaying the writing trace generated by the drawing operation in the picture in real time.
Optionally, the first storage module 121 is further configured to:
if the revocation cache layer does not have enough memory to store the first dirty region bitmap, judging whether the revocation cache layer stores the first dirty region bitmap or not;
if the first dirty region bitmap is stored in the revocation cache layer, deleting the first dirty region bitmap stored in the revocation cache layer according to the storage time;
and if the first dirty region bitmap is not stored in the revocation cache layer, storing the first dirty region bitmap in an external storage medium.
The specific principle and implementation of the device provided in this embodiment are similar to those of the embodiment shown in fig. 7, and will not be described here again.
Fig. 14 is a block diagram of a writing trace-processing apparatus according to an exemplary embodiment of the present application.
As shown in fig. 14, the writing trace processing apparatus provided in this embodiment includes:
a memory 141;
a processor 142; and
a computer program;
wherein the computer program is stored in the memory 141 and is configured to be executed by the processor 142 to implement any of the methods of writing trace processing as described above.
The present embodiment also provides a computer-readable storage medium, having stored thereon a computer program,
the computer program is executed by a processor to implement any of the written trace processing methods described above.
The present embodiment also provides a computer program comprising program code which, when run by a computer, performs any of the written trace processing methods described above.
Those of ordinary skill in the art will appreciate that: all or part of the steps for implementing the method embodiments described above may be performed by hardware associated with program instructions. The foregoing program may be stored in a computer readable storage medium. The program, when executed, performs steps including the method embodiments described above; and the aforementioned storage medium includes: various media that can store program code, such as ROM, RAM, magnetic or optical disks.
Finally, it should be noted that: the above embodiments are only for illustrating the technical solution of the present application, and not for limiting the same; although the application 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 or all of the technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit of the application.

Claims (13)

1. A method of processing a writing trace, comprising:
storing a first dirty region bitmap before drawing the writing trace in a revocation cache layer; wherein the dirty area is an area covered by the writing trace; wherein, at least one first dirty region bitmap is stored in the revocation cache layer;
responding to the withdrawal operation, acquiring the first dirty region bitmap from the withdrawal cache layer, and updating the dirty region in the picture by adopting the first dirty region bitmap;
acquiring a first picture bitmap of an undrawn writing trace;
determining a dirty region corresponding to the writing trace in response to drawing operation, and acquiring a first dirty region bitmap from the first picture bitmap according to the dirty region;
the first dirty area bitmap before drawing the writing trace has an operation mark;
the obtaining the first dirty region bitmap from the revocation cache layer includes:
and acquiring the first dirty region bitmap from the revocation cache layer according to the operation identifier corresponding to the revocation operation.
2. The method according to claim 1, characterized in that the method further comprises:
storing a second dirty region bitmap after drawing the writing trace in a cache layer;
and responding to a recovery operation, acquiring the second dirty region bitmap from the cache layer, and updating the dirty region of the picture by adopting the second dirty region bitmap.
3. The method according to claim 2, characterized in that the method further comprises:
acquiring a second picture bitmap after drawing the writing trace;
and responding to the drawing operation, determining a dirty region corresponding to the writing trace, and acquiring a second dirty region bitmap from the second picture bitmap according to the dirty region.
4. A method according to claim 1 or 3, wherein said determining a dirty region corresponding to said written trace in response to a drawing operation comprises:
and acquiring the position information of the writing trace in the picture, and determining the dirty area according to the position information.
5. The method of claim 4, wherein the location information comprises corner coordinates of the written trace.
6. The method of claim 2, wherein the second dirty region bitmap after drawing the written trace has the same operational identity as the first dirty region bitmap before drawing the written trace;
the obtaining the second dirty region bitmap from the cache layer includes:
and acquiring the second dirty region bitmap from the cache layer according to the operation identifier corresponding to the recovery operation.
7. The method of any of claims 1-3, 5-6, wherein updating the dirty region in the picture with the first dirty region bitmap comprises:
and pasting the first dirty region bitmap in the dirty region of the current picture.
8. A method according to claim 2 or 3, wherein updating the dirty region of the picture with the second dirty region bitmap comprises:
and pasting the second dirty region bitmap in the dirty region of the current picture.
9. A method according to claim 1 or 3, characterized in that the method further comprises:
and responding to the drawing operation, and displaying the writing trace generated by the drawing operation in the picture in real time.
10. The method of any one of claims 1-3, 5-6, further comprising:
if the revocation cache layer does not have enough memory to store the first dirty region bitmap, judging whether the revocation cache layer stores the first dirty region bitmap or not;
if the first dirty region bitmap is stored in the revocation cache layer, deleting the first dirty region bitmap stored in the revocation cache layer according to the storage time;
and if the first dirty region bitmap is not stored in the revocation cache layer, storing the first dirty region bitmap in an external storage medium.
11. A writing trace-processing apparatus, comprising:
the first storage module is used for storing a first dirty region bitmap before drawing the writing trace in the revocation cache layer; wherein the dirty area is an area covered by the writing trace; wherein, at least one first dirty region bitmap is stored in the revocation cache layer;
the revocation module is used for responding to revocation operation, acquiring the first dirty region bitmap from the revocation cache layer, and updating the dirty region in the picture by adopting the first dirty region bitmap;
the acquisition module is used for acquiring a first picture bitmap of the non-drawn writing trace;
the determining module is used for determining a dirty region corresponding to the writing trace in response to drawing operation and acquiring a first dirty region bitmap from the first picture bitmap according to the dirty region;
the first dirty area bitmap before drawing the writing trace has an operation mark;
the revocation module is specifically configured to: and acquiring the first dirty region bitmap from the revocation cache layer according to the operation identifier corresponding to the revocation operation.
12. A writing trace-processing apparatus, comprising:
a memory;
a processor; and
a computer program;
wherein the computer program is stored in the memory and configured to be executed by the processor to implement the method of any one of claims 1-10.
13. A computer-readable storage medium, having a computer program stored thereon,
the computer program being executed by a processor to implement the method of any of claims 1-10.
CN202010403073.0A 2020-05-13 2020-05-13 Method, device, equipment and computer readable storage medium for processing writing trace Active CN111552410B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010403073.0A CN111552410B (en) 2020-05-13 2020-05-13 Method, device, equipment and computer readable storage medium for processing writing trace

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010403073.0A CN111552410B (en) 2020-05-13 2020-05-13 Method, device, equipment and computer readable storage medium for processing writing trace

Publications (2)

Publication Number Publication Date
CN111552410A CN111552410A (en) 2020-08-18
CN111552410B true CN111552410B (en) 2023-09-12

Family

ID=72001140

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010403073.0A Active CN111552410B (en) 2020-05-13 2020-05-13 Method, device, equipment and computer readable storage medium for processing writing trace

Country Status (1)

Country Link
CN (1) CN111552410B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114419193B (en) * 2022-01-24 2023-03-10 北京思明启创科技有限公司 Image drawing method, image drawing device, electronic equipment and computer-readable storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
DE19837232A1 (en) * 1997-08-20 1999-02-25 Heckmann Klaus Prof Dr Writing surface giving permanent record but easily erasable
CN108491145A (en) * 2018-03-26 2018-09-04 广州视源电子科技股份有限公司 Write the revocation person's handwriting method and device applied, storage medium, terminal device
CN109165626A (en) * 2018-09-11 2019-01-08 广州视源电子科技股份有限公司 Stroke writing processing method, device, equipment and the storage medium of electronic whiteboard
CN110231909A (en) * 2019-05-15 2019-09-13 广州视源电子科技股份有限公司 Write the treating method and apparatus of operation
CN111045580A (en) * 2018-10-15 2020-04-21 鸿合科技股份有限公司 Handwriting processing method and device and electronic equipment

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9129416B2 (en) * 2012-11-14 2015-09-08 Microsoft Technology Licensing, Llc Digital art undo and redo

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
DE19837232A1 (en) * 1997-08-20 1999-02-25 Heckmann Klaus Prof Dr Writing surface giving permanent record but easily erasable
CN108491145A (en) * 2018-03-26 2018-09-04 广州视源电子科技股份有限公司 Write the revocation person's handwriting method and device applied, storage medium, terminal device
CN109165626A (en) * 2018-09-11 2019-01-08 广州视源电子科技股份有限公司 Stroke writing processing method, device, equipment and the storage medium of electronic whiteboard
CN111045580A (en) * 2018-10-15 2020-04-21 鸿合科技股份有限公司 Handwriting processing method and device and electronic equipment
CN110231909A (en) * 2019-05-15 2019-09-13 广州视源电子科技股份有限公司 Write the treating method and apparatus of operation

Also Published As

Publication number Publication date
CN111552410A (en) 2020-08-18

Similar Documents

Publication Publication Date Title
CN110096277B (en) Dynamic page display method and device, electronic equipment and storage medium
US8775923B1 (en) Web page restoration
CN110221889B (en) Page display method and device, electronic equipment and storage medium
KR930001926B1 (en) Display control method and apparatus
CN113190166B (en) Handwriting display method and device based on ink screen
CN114020233B (en) Meeting whiteboard window mode writing adaptation method, system, device and medium
CN108958630B (en) Writing content display method and device and electronic equipment
CN111949156B (en) Chinese character writing test method and system of writing device and writing device
CN103336787B (en) A kind of method and apparatus for scaling webpage
CN111552410B (en) Method, device, equipment and computer readable storage medium for processing writing trace
JP2015125509A (en) Image processing apparatus, image processing method, and program
CN110866378B (en) Method and system for annotating on display screen
CN109062491A (en) The handwriting processing method and device of interactive intelligence equipment
CN103345389B (en) The operational approach of a kind of vector graphics being applied to webpage and device
CN115878935B (en) Method, system, device, equipment and medium for partial refreshing of chart
TW201520872A (en) Frame drawing method, frame updating method, and mobile electronic device thereof
CN109800039B (en) User interface display method and device, electronic equipment and storage medium
CN113672143B (en) Image labeling method, system, device and storage medium
CN105378645A (en) Virtualizing applications for multi-monitor environments
CN113096217A (en) Picture generation method and device, electronic equipment and storage medium
CN103927770A (en) Method and system for drawing waveforms under grid background
CN114153417B (en) Screen updating method and device, storage medium and computer equipment
CN109101143A (en) Focus top set method, storage medium, equipment and system suitable for page scroll
JP6264951B2 (en) Drawing apparatus, program, and drawing method
CN117153118B (en) Picture updating method, device and equipment of ink screen and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant