CN111552410A - Writing trace processing method, device, equipment and computer readable storage medium - Google Patents

Writing trace processing method, device, equipment and computer readable storage medium Download PDF

Info

Publication number
CN111552410A
CN111552410A CN202010403073.0A CN202010403073A CN111552410A CN 111552410 A CN111552410 A CN 111552410A CN 202010403073 A CN202010403073 A CN 202010403073A CN 111552410 A CN111552410 A CN 111552410A
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.)
Granted
Application number
CN202010403073.0A
Other languages
Chinese (zh)
Other versions
CN111552410B (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

Images

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

Abstract

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

Description

Writing trace processing method, device, equipment and computer readable storage medium
Technical Field
The present disclosure relates to computer technologies, and in particular, to a method, an apparatus, a device, and a computer-readable storage medium for processing a writing trace.
Background
At present, many electronic devices are provided with a function of handwriting drawing, and a user can operate the electronic devices to form traces, which form characters or pictures.
In the existing scheme, after a user draws a graph on a drawing board, the last drawn content can be cancelled through a cancel key. For example, the user may click the cancel key if the user is not satisfied with the newly written trace.
In this case, the electronic device refreshes the entire screen at the time of revocation, which results in a large amount of computing power being required for the revocation operation.
Disclosure of Invention
The present disclosure provides a writing trace processing method, apparatus, device and computer readable storage medium, so as to solve the problem that the undo operation in the prior art needs to consume a large amount of computing power of an electronic device.
A first aspect of the present disclosure is to provide a writing trace processing method, including:
storing a first dirty region bitmap before writing traces are drawn in a cancel cache layer; wherein, the dirty region is the region covered by the writing trace;
and responding to a revocation operation, acquiring the first dirty region bitmap from the revocation cache layer, and updating the dirty regions 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 writing trace drawing in a revocation cache layer; wherein, the dirty region is the region 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 regions 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 including:
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 handling writing traces as described in the first aspect above.
Yet another aspect of the present disclosure is to provide a computer-readable storage medium having stored thereon a computer program to be executed by a processor to implement the method of processing a written trace as described in the first aspect above.
The writing trace processing method, the writing trace processing device, the writing trace processing equipment and the computer readable storage medium have the technical effects that:
the writing trace processing method, device, equipment and computer readable storage medium provided by the application comprise the following steps: storing a first dirty region bitmap before writing traces are drawn in a cancel cache layer; wherein, the dirty area is an area covered by the writing trace; and responding to the revocation operation, acquiring a first dirty region bitmap from the revocation cache layer, and updating the dirty regions in the picture by adopting the first dirty region bitmap. The method, the device, the equipment and the computer readable storage medium provided by the application store the first dirty region bitmap covered by the writing trace before the writing trace is drawn, and when the electronic equipment responds to the cancel operation, the electronic equipment can directly utilize the stored first dirty region bitmap to update the dirty region in the picture, so that the effect of canceling the drawn writing trace can be achieved only by local updating, and the calculation power consumed by the cancel operation is greatly reduced.
Drawings
Fig. 1 is a schematic diagram of an application scenario shown in an exemplary embodiment of the present application;
FIG. 2 is a flow chart illustrating a method of written trace processing according to an exemplary embodiment of the present application;
FIG. 3 is a schematic illustration of a first exemplary embodiment of the present application showing a written trace;
FIG. 4 is a schematic illustration of a writing trace shown in a second exemplary embodiment of the present application;
FIG. 5 is a first dirty region bitmap illustration according to 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 flow chart of a method of handling writing traces according to a second exemplary embodiment of the present application;
fig. 8 is a diagram illustrating a determination of a first dirty region bitmap in a first picture bitmap according to an exemplary embodiment of the present application;
FIG. 9 is a diagram illustrating updating a current screen according to an exemplary embodiment of the present application;
FIG. 10 is a schematic illustration of a written trace shown in an exemplary embodiment of the present application;
FIG. 11 is a diagram illustrating the effect of recovering a written trace according to an exemplary embodiment of the present application;
FIG. 12 is a block diagram of a writing trace processing apparatus according to an exemplary embodiment of the present application;
fig. 13 is a block diagram illustrating a writing trace processing apparatus according to another exemplary embodiment of the present application;
fig. 14 is a block diagram illustrating a writing trace processing apparatus according to an exemplary embodiment of the present application.
Detailed Description
At present, when a user uses a hand-drawing function in an electronic device, the user often uses a cancel function therein.
Fig. 1 is a schematic view of an application scenario shown in 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 part is 11 parts drawn, and if the user performs a cancel operation, the picture can be updated to the right style.
When the electronic equipment responds to the undo operation, the last drawn part of the user can be cleared, the drawing is carried out again in the cleared area, and the whole picture is refreshed according to the content drawn in the area. However, if the content drawn on the screen is large, it is necessary to refresh the entire screen, which is very laborious.
In the scheme provided by the application, the area covered by the writing trace of the user is used as a dirty area, a first dirty area bitmap before the writing trace is drawn in a storage mode, when the user performs the canceling operation, the stored first dirty area bitmap is directly acquired, the first dirty area in the picture is updated by using the bitmap, the whole picture does not need to be updated, only the first dirty area needs to be updated, and therefore the calculation power consumed by the canceling operation is reduced.
Fig. 2 is a flowchart illustrating a method for handling writing traces according to an exemplary embodiment of the present application.
As shown in fig. 2, the method for processing a writing trace provided by this embodiment includes:
step 201, storing a first dirty region bitmap before writing trace drawing in a revocation cache layer; wherein the dirty region is a region covered by the writing trace.
The method provided by the application can be executed by an electronic device with computing capability. The electronic device may further include software such as a drawing and a writing pad, and a user may perform a drawing operation in the electronic device by operating the software. The drawing operation may be an operation of writing characters or an operation of drawing patterns, which is specifically determined by the behavior of the user, and the application is not limited thereto.
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 diagram of a writing trace according to the first exemplary embodiment of the present application.
Fig. 4 is a diagram illustrating a writing trace according to a second exemplary embodiment of the present application.
As shown in fig. 3 and 4, the user can draw a stroke 41 on the basis of the screen shown in fig. 3 by operation to form the screen shown in fig. 4.
The stroke 41 is the final writing trace.
Further, in the method provided by the present application, an area covered by the writing trace is taken as a dirty area, and in fig. 3, an area 31 covered by the stroke 41 is a first dirty area.
In practical application, the first dirty region bitmap before the writing trace is drawn can be stored in the withdrawal cache layer. The revocation cache layer may be set in advance, for example, the revocation cache layer may be generated when a file having a drawing function is created. For example, when a user creates a drawing file or creates a tablet file, the electronic device may create the revocation cache layer. For another example, when the user draws an element, the revocation cache layer may be created, for example, when the user selects a brush, it may be considered that the user is about to perform a drawing operation, and at this time, the electronic device may create the revocation cache layer.
In the picture formed before a writing trace is drawn, the picture of the area 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 writing trace. And after the user finishes drawing the writing trace, intercepting a first dirty region bitmap from the stored historical picture screenshot according to the region covered by the writing trace, and storing the first dirty region bitmap in the revocation cache layer. For another example, a frame before the user draws the writing trace may be stored, so that the first dirty region bitmap may be determined in the saved frame according to the writing trace newly drawn by the user.
Fig. 5 is a first dirty region bitmap diagram according to an exemplary embodiment of the present application.
As shown in fig. 5, when the drawn screen is as shown in fig. 3 and the drawn screen is as shown in fig. 4 by the user operation, the stored first dirty region map is as shown in fig. 5.
Step 202, responding to the undo operation, obtaining a first dirty region bitmap from the undo cache layer, and updating the first dirty region in the picture by using the first dirty region bitmap.
Specifically, in the drawing process, if the currently drawn writing trace is not satisfactory, the user may perform a cancel operation. For example, after the user finishes drawing, the user may click a cancel button.
FIG. 6 is a user interface diagram illustrating an exemplary embodiment of the present application.
As shown in fig. 6, the user can perform a drawing operation in the interface. A plurality of operable keys, such as store, undo, resume, close, etc., may also be included in the interface. Wherein the user can click the cancel key 61 to cause the electronic device to cancel the last written trace drawn by the user.
Further, if the electronic device receives a revocation operation, in the method provided by the application, the electronic device may obtain a first dirty region bitmap from the revocation cache layer, and update the dirty region in the picture by using the first dirty region bitmap.
In practical application, the revocation cache layer stores a first dirty region bitmap corresponding to a coverage area of a writing trace before the writing trace is drawn, when the writing trace is revoked, the stored first dirty region bitmap before the writing trace is drawn can be used for updating a dirty region in a current picture, for example, the acquired first dirty region bitmap is pasted in the dirty region in the picture, so that the picture is in a state before the writing trace is drawn, and the revocation effect is achieved.
In this way, the whole picture does not need to be updated, and only local dirty regions need to be updated.
The method provided by the embodiment is used for processing the written trace, and is executed by the device provided with the method provided by the embodiment, and the device is generally realized in a hardware and/or software mode.
The writing trace processing method provided by the application comprises the following steps: storing a first dirty region bitmap before writing traces are drawn in a cancel cache layer; wherein, the dirty area is an area covered by the writing trace; and responding to the revocation operation, acquiring a first dirty region bitmap from the revocation cache layer, and updating the dirty regions in the picture by adopting the first dirty region bitmap. According to the method, the first dirty region bitmap covered by the writing trace before the writing trace is drawn is stored, and when the electronic equipment responds to the canceling operation, the dirty region in the picture can be updated by directly using the stored first dirty region bitmap, so that the effect of canceling the drawn writing trace can be achieved only by local updating, and the calculation power consumed by the canceling operation is greatly reduced.
Fig. 7 is a flowchart illustrating a method for processing a written trace according to a second exemplary embodiment of the present application.
As shown in fig. 7, the method for processing a writing trace provided by the present application includes:
step 701, obtaining a first picture bitmap without drawn writing traces.
The method provided by the application can be executed by an electronic device with computing capability. The electronic device may further include software such as a drawing and a writing pad, and a user may perform a drawing operation in the electronic device by operating the software. The drawing operation may be an operation of writing characters or an operation of drawing patterns, which is specifically determined by the behavior of the user, and the application is not limited thereto.
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 also updated along with the user's operation.
According to the method, before a user draws a writing trace, a first picture bitmap without the writing trace is obtained. The specific drawn writing trace is not limited.
For example, if a user newly creates a file and is about to perform a drawing operation therein, the electronic device may obtain a first screen bitmap corresponding to the blank file. For another example, if the user draws N strokes, the electronic device may obtain a first frame bitmap corresponding to a frame including the N strokes before the user draws N +1 strokes.
In this way, the electronic device can record the picture state of the user before drawing a written trace.
Step 702, determining a dirty region corresponding to the writing trace in response to the drawing operation.
Step 703, acquiring a first dirty region bitmap from the first image 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, and the like. The electronic device may determine a dirty region in response to the rendering operation, the dirty region being an area covered by the written trace.
Obtaining 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 acquired, and then the dirty area is determined according to the position information. Such as coordinates of written traces, relative position information, etc.
For example, if the writing trace is a rectangular frame, the dirty region may be determined according to coordinates of four corner points of the rectangular frame.
The first dirty region bitmap can be obtained from the first image bitmap according to the determined dirty region. For example, if the dirty region is located in the middle of the screen, the first dirty region bitmap may be obtained in the middle of the first screen bitmap. For another example, the corresponding first dirty region bitmap may be acquired from the first image bitmap according to the position information of the dirty region in the current image.
Fig. 8 is a diagram illustrating determining a first dirty region bitmap in a first picture bitmap according to an exemplary embodiment of the present application.
As shown in fig. 8, shown on the left is a first screen bitmap, and shown on the right is a current screen obtained by the electronic apparatus 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 screen bitmap may be directly used as the first dirty area bitmap.
After the first dirty region bitmap is obtained, the first image bitmap to which the dirty region bitmap belongs can be deleted, so that the first image bitmap is prevented from occupying a larger memory space.
Step 704, storing the acquired first dirty region bitmap in a 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 similar manner to step 201.
Further, the first dirty region bitmap may have an operation identification. For example, the operation identifier commitId may be provided, the picture identifier of the first dirty region bitmap may be undoo, and the identifier of the current first dirty region bitmap, commitiddundo, may be obtained by concatenation.
In practical application, for each drawing operation, the first dirty region bitmap corresponding to the drawing operation may be stored. These bitmaps may specifically be distinguished by the identification commimitidudo of the first dirty region bitmap. For example, if the user draws 5 strokes in total, 5 first dirty region bitmaps may be correspondingly obtained, where the identifiers of the dirty region bitmaps may be commit1undo, commit2undo, commit3undo, commit4undo, and commit5undo, respectively.
Optionally, in the method provided in this embodiment, before storing the first dirty region bitmap, it may further be determined whether there is enough memory space to store the first dirty region bitmap. And if the buffer space is enough, directly storing the first dirty region bitmap in the revocation buffer layer.
And if the first dirty region bitmap is not stored in enough memory space, continuously judging whether the first dirty region bitmap is stored in the revocation cache layer or not. For example, before this drawing operation, the electronic device responds to the first dirty region bitmap stored in the other drawing operations.
And 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. Specifically, the first dirty region bitmap with the earliest storage time may be deleted, and if the storage space is still insufficient after deletion of one first dirty region bitmap, the first dirty region bitmap with the earliest storage time in the remaining bitmaps may be continuously deleted.
And if the first dirty region bitmap is not stored in the revocation cache layer, storing the currently acquired first dirty region bitmap in an external storage medium.
Step 705, in response to the undo operation, obtaining a first dirty region bitmap from the undo cache layer according to the operation identifier corresponding to the undo operation.
And if the current drawn writing trace is not satisfied in the drawing process, the user can perform undo operation.
In particular, the undo operation may have a corresponding operation identifier, which may, for example, correspond to the operation identifier included in the first dirty region bitmap. For example, the operation identifier of the first undo operation may be the same as the operation identifier of the first dirty region bitmap stored last, and when undo operations are performed continuously, the operation identifier of the second undo operation may be the same as the operation identifier of the first dirty region bitmap stored last but one.
For example, 5 first dirty region bitmaps are co-stored, and have operation identifications commit1, commit2, commit3, commit4, commit5, respectively, according to the storage order thereof. When the user carries out the first revocation operation, the operation identifier corresponding to the revocation operation is commit5, and if the user continuously carries out the revocation operation, the operation identifier corresponding to the second revocation operation is commit 4.
Furthermore, the electronic device may splice the operation identifier corresponding to the revocation operation with the picture identifier undoo of the first dirty region bitmap, so as to obtain the identifier of the first dirty region bitmap. For example, if the revocation operation identifier is commit5, the obtained first dirty region bitmap is commit5undo, and the electronic device may obtain the first dirty region bitmap identified as commit5undo from the revocation cache layer.
In an embodiment, the operation identifier may also be used as an identifier corresponding to the first dirty region bitmap, and the first dirty region bitmap may be obtained from the revocation cache layer by directly using the operation identifier corresponding to the revocation operation. For example, if the last stored first dirty region bitmap is identified as commit5, and the operation identifier corresponding to the undo operation is commit5, commit5 may be directly obtained from the undo cache layer.
In another embodiment, the first dirty region bitmap may be obtained from the revocation cache layer in a reverse order of the storage order according to the number of times of consecutive revocation operations. 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 revocation operations twice consecutively, the last stored first dirty region bitmap and the first dirty region bitmap stored last but one second may be obtained from the revocation cache layer, respectively.
Step 706, paste 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 acquired first dirty region bitmap can be pasted in a dirty region of the current picture, so that the picture is restored to a state before the writing trace is drawn.
Fig. 9 is a diagram illustrating updating a current screen according to an exemplary embodiment of the present application.
As shown in fig. 9, the left side is the state of the current picture in which a dirty region is determined to be 91. The first dirty region bitmap obtained is 92. The first dirty region bitmap can be pasted at the position of the dirty region 91, so that the picture is restored to the state before the writing trace is drawn, and the canceling effect is achieved.
Optionally, the method provided by the present application may further include the following steps.
And step 707, storing the second dirty region bitmap after the writing trace is drawn in the cache 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 the writing trace currently drawn by the user.
Further, step 707 may be performed after step 702.
FIG. 10 is a schematic diagram of a writing trace shown in an exemplary embodiment of the present application.
As shown in fig. 10, after the user completes the drawing operation, the screen is as shown in 101, and the dirty area corresponding to the writing trace determined by the drawing operation is 102, and then the portion corresponding to the dirty area 102 may be stored as the second dirty area bitmap.
In actual application, the second dirty region bitmap after the writing trace is drawn can be stored in the cache layer. The cache layer may be set in advance, and may be generated, for example, when a file having a drawing function is created. For example, when a user creates a drawing file or creates a tablet file, the electronic device may create the cache layer. For another example, when the user draws an element, the cache layer may be created, for example, when the user selects a brush, the user may be considered to be about to perform a drawing operation, and at this time, 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 include new writing traces and corresponds to a dirty region in the picture, and the second dirty region bitmap is a bitmap which includes new writing traces and corresponds to a 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 in the second image bitmap according to the dirty region. The dirty region is the dirty region determined in step 702, i.e., the dirty region corresponding to the writing trace determined in response to the drawing operation.
Specifically, a dirty region portion may be truncated in the second screen bitmap, thereby forming a second dirty region bitmap.
Step 708, responding to the recovery operation, obtaining a second dirty region bitmap from the cache layer, and updating the picture by using the second dirty region bitmap.
In the drawing process, a user often wants to restore a drawn writing trace after the writing trace is withdrawn. At this time, the user may click a resume button in the user interface, and then send a resume instruction to the electronic device. In this case, the electronic device may 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. Namely, the electronic device can respond to the recovery operation on the basis that the electronic device has performed the revocation operation.
Further, the electronic device may respond to the recovery operation, obtain a second dirty region bitmap from the cache layer, and update the current picture with the second dirty region bitmap. Because the second dirty region bitmap comprises the writing trace, the current picture can be updated by adopting the second dirty region, so that the effect of recovering operation is achieved.
In actual application, the second dirty region bitmap after the writing trace is drawn and the first dirty region bitmap before the same writing trace is drawn have the same operation identifier. For example, the operation identification commit id may be used as an identification of the second dirty region bitmap when storing the second dirty region bitmap.
When the second dirty region bitmap is obtained, the second dirty region bitmap can be obtained from the cache layer according to the operation identifier corresponding to the recovery operation. The operation identifier of the recovery operation may correspond to the operation identifier of the undo operation. Specifically, the operation identifier of the recovery operation may be the reverse order of the operation identifiers of the undo operations.
For example, when the user performs a single undo operation, the operation identifier of the undo operation is commit2, and when the user performs a single undo operation, the operation identifier corresponding to the undo operation is commit 2. Assuming that a user draws two writing traces together in the drawing process, wherein a first dirty region bitmap corresponding to the first writing trace is identified as commit1undo, and a second dirty region bitmap is identified as commit 1; the second dirty region bitmap corresponding to the second trace is identified as commit2 ando, and the second dirty region bitmap is identified as commit 2. If the user performs a revocation operation once, the screen may be updated using the first dirty region bitmap commit2 undo. If the user has performed a recovery operation again, the electronic device may update the screen using a second dirty region bitmap identified as commit 2.
For example, the user has performed two successive undo operations, the operation identifiers of the two undo operations are commit2 and commit1, respectively, and if the user has performed two successive undo operations, the operation identifiers corresponding to the undo operations are commit1 and commit2, respectively. Assuming that a user draws two writing traces together in the drawing process, wherein a first dirty region bitmap corresponding to the first writing trace is identified as commit1undo, and a second dirty region bitmap is identified as commit 1; the second dirty region bitmap corresponding to the second trace is identified as commit2 ando, and the second dirty region bitmap is identified as commit 2. If the user performs the undo operation once, the screen can be updated by using the first dirty region bitmap commit2undo, and if the user performs the undo operation again, the screen can be continuously updated by using commit1 undo. If the user has performed the restore operation again, the electronic device may update the screen using the second dirty region bitmap identified as commit1, and if the user has performed the restore operation again, the electronic device may update the screen using the second dirty region bitmap identified as commit 2.
When the undo operation or the undo operation is continuously performed, the corresponding dirty area in the screen may be changed due to different writing traces for different operations.
Fig. 11 is a diagram illustrating an effect of recovering a writing trace according to an exemplary embodiment of the present application.
As shown in fig. 11, 111 is the screen after the undo operation, and 112 is the second dirty region bitmap obtained in response to the restore operation, and 112 may be used to update 111, resulting in a screen as shown at 113.
Specifically, the acquired second dirty region bitmap can be pasted in the dirty region of the picture, so that the effect of picture recovery is achieved. According to the method, when the electronic equipment executes the recovery operation, only dirty areas in the picture need to be updated, and the whole picture does not need to be refreshed, so that the computational power consumption of the electronic equipment can be reduced.
Optionally, in an embodiment, in response to the drawing operation, a writing trace generated by the drawing operation is displayed in real time in the screen. In this embodiment, the writing trace drawn by the user can be displayed in real time along with the drawing operation of the user, so that the user can see the drawing effect in real time. In the process of drawing, the picture is changed in real time along with the operation of the user, namely, the picture can display corresponding traces every time the picture is drawn a little.
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 device for processing writing trace according to the present embodiment includes:
the first storage module 121 is configured to store a first dirty region bitmap before writing trace drawing in a revocation cache layer; wherein, the dirty region is the region covered by the writing trace;
a revocation module 122, configured to, in response to a revocation operation, obtain the first dirty region bitmap from the revocation cache layer, and update the dirty region in the picture by using the first dirty region bitmap.
The writing trace processing device provided by the embodiment comprises: the first storage module is used for storing a first dirty region bitmap before writing trace drawing in a 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 the first dirty region bitmap from the revocation cache layer, and updating the dirty regions 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 when the electronic equipment responds to the canceling operation, the dirty region in the picture can be updated by directly utilizing the stored first dirty region bitmap, so that the effect of canceling the drawn writing trace can be achieved only by local updating, and the calculation power consumed by the canceling operation is greatly reduced.
The specific principle and implementation of the device for processing writing traces provided by this embodiment are similar to those of the embodiment shown in fig. 2, and are not described here again.
Fig. 13 is a block diagram illustrating a writing trace processing apparatus according to another exemplary embodiment of the present application.
As shown in fig. 13, in addition to the above-mentioned embodiments, the device for processing writing traces according to the present embodiment further includes:
the obtaining module 123 is configured to obtain a first picture bitmap without drawn writing traces;
a determining module 124, configured to determine a dirty region corresponding to the writing trace in response to a drawing operation, and obtain the first dirty region bitmap in the first picture bitmap according to the dirty region.
Optionally, the method further includes:
the second storage module 125 stores the second dirty region bitmap after the writing trace is drawn in the cache layer;
a restoring module 126, configured to respond to a restoring operation, obtain the second dirty region bitmap from the cache layer, and update the dirty region of the picture with the second dirty region bitmap.
Optionally, the obtaining module 123 is further configured to obtain a second picture bitmap after the writing trace is drawn;
the determining module 124 is further configured to determine a dirty region corresponding to the writing trace in response to the drawing operation, and obtain the second dirty region bitmap in the second picture 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 coordinates of corner points of the writing trace.
Optionally, the first dirty region bitmap before the writing trace is drawn 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 the writing trace is drawn and the first dirty region bitmap before the writing trace are drawn have the same operation identifier;
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, configured to:
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 for storing 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 apparatus provided in this embodiment are similar to those of the embodiment shown in fig. 7, and are not described herein again.
Fig. 14 is a block diagram illustrating a writing trace processing apparatus according to an exemplary embodiment of the present application.
As shown in fig. 14, the present embodiment provides a written trace processing apparatus including:
a memory 141;
a processor 142; and
a computer program;
wherein the computer program is stored in the memory 141 and configured to be executed by the processor 142 to implement any of the writing trace processing methods as described above.
The present embodiments also provide a computer-readable storage medium, having stored thereon a computer program,
the computer program is executed by a processor to implement any of the methods of handling writing traces as described above.
The present embodiment also provides a computer program including a program code that executes any of the methods for handling a written trace as described above when the computer program is run by a computer.
Those of ordinary skill in the art will understand that: all or a portion of the steps of implementing the above-described method embodiments may be performed by hardware associated with program instructions. The program may be stored in a computer-readable storage medium. When executed, the program performs steps comprising the method embodiments described above; and the aforementioned storage medium includes: various media that can store program codes, such as ROM, RAM, magnetic or optical disks.
Finally, it should be noted that: the above embodiments are only used to illustrate the technical solution of the present invention, and not to limit the same; while the invention has been described in detail and with reference to the foregoing embodiments, it will be understood by those skilled in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some or all of the technical features may be equivalently replaced; and the modifications or the substitutions do not make the essence of the corresponding technical solutions depart from the scope of the technical solutions of the embodiments of the present invention.

Claims (15)

1. A method of handling a written trace, comprising:
storing a first dirty region bitmap before writing traces are drawn in a cancel cache layer; wherein, the dirty region is the region covered by the writing trace;
and responding to a revocation operation, acquiring the first dirty region bitmap from the revocation cache layer, and updating the dirty regions in the picture by adopting the first dirty region bitmap.
2. The method of claim 1, further comprising:
acquiring a first picture bitmap without drawn writing traces;
and responding to drawing operation to determine a dirty region corresponding to the writing trace, and acquiring the first dirty region bitmap in the first picture bitmap according to the dirty region.
3. The method of claim 1, further comprising:
storing a second dirty region bitmap after the writing trace is drawn in a cache layer;
and responding to 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.
4. The method of claim 3, further comprising:
acquiring a second picture bitmap after the writing trace is drawn;
and responding to drawing operation to determine a dirty region corresponding to the writing trace, and acquiring the second dirty region bitmap in the second picture bitmap according to the dirty region.
5. The method of claim 2 or 4, wherein determining a dirty region corresponding to the written trace in response to the rendering operation comprises:
and acquiring the position information of the writing trace in the picture, and determining the dirty area according to the position information.
6. The method of claim 5, wherein the position information comprises corner coordinates of the writing trace.
7. The method of claim 3, wherein a first dirty region bitmap before the writing trace is drawn has an operation identifier;
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.
8. The method according to claim 7, wherein the second dirty region bitmap after the writing trace is drawn has the same operation identifier as the first dirty region bitmap before the writing trace is drawn;
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.
9. The method according to any of claims 1-4 and 6-8, wherein said updating the dirty region in the picture using the first dirty region bitmap comprises:
and pasting the first dirty region bitmap in the dirty region of the current picture.
10. The method of claim 3 or 4, wherein updating the dirty region of the picture using the second dirty region bitmap comprises:
and pasting the second dirty region bitmap in the dirty region of the current picture.
11. The method of claim 2 or 4, further comprising:
and responding to the drawing operation, and displaying the writing trace generated by the drawing operation in the picture in real time.
12. The method of any one of claims 1-4, 6-8, further comprising:
if the revocation cache layer does not have enough memory for storing 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.
13. A written trace processing apparatus, comprising:
the first storage module is used for storing a first dirty region bitmap before writing trace drawing in a revocation cache layer; wherein, the dirty region is the region 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 regions in the picture by adopting the first dirty region bitmap.
14. A written 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 of claims 1-12.
15. A computer-readable storage medium, having stored thereon a computer program,
the computer program is executed by a processor to implement the method of any one of claims 1-12.
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 true CN111552410A (en) 2020-08-18
CN111552410B 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)

Cited By (1)

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

Citations (6)

* 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
US20140132614A1 (en) * 2012-11-14 2014-05-15 Microsoft Corporation Digital art undo and redo
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

Patent Citations (6)

* 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
US20140132614A1 (en) * 2012-11-14 2014-05-15 Microsoft Corporation Digital art undo and redo
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

Cited By (2)

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

Also Published As

Publication number Publication date
CN111552410B (en) 2023-09-12

Similar Documents

Publication Publication Date Title
US8775923B1 (en) Web page restoration
CN105511792A (en) In-position hand input method and system for form
CN111949156B (en) Chinese character writing test method and system of writing device and writing device
CN114020233B (en) Meeting whiteboard window mode writing adaptation method, system, device and medium
CN103336787B (en) A kind of method and apparatus for scaling webpage
US11561637B2 (en) Method and device of drawing handwriting track, electronic apparatus, medium, and program product
JP2015125509A (en) Image processing apparatus, image processing method, and program
CN108492349B (en) Processing method, device and equipment for writing strokes and storage medium
CN111739136B (en) Rendering method, computer device, and storage medium
CN110866378B (en) Method and system for annotating on display screen
CN116051575A (en) Image segmentation method, apparatus, computer device, and storage medium program product
CN111552410A (en) Writing trace processing method, device, equipment and computer readable storage medium
CN115878935B (en) Method, system, device, equipment and medium for partial refreshing of chart
JP2016157201A (en) Information processing apparatus, operation cancelling method, computer program, and storage medium
CN105378645A (en) Virtualizing applications for multi-monitor environments
CN113096217A (en) Picture generation method and device, electronic equipment and storage medium
CN112686806A (en) Image splicing method and device, electronic equipment and storage medium
CN115035261B (en) Method, device, equipment and medium for generating collision device
CN111813303B (en) Text processing method and device, electronic equipment and readable storage medium
CN114153417B (en) Screen updating method and device, storage medium and computer equipment
CN113538623B (en) Method, device, electronic equipment and storage medium for determining target image
CN113066153B (en) Method, device and equipment for generating pipeline flow chart and storage medium
CN117539377A (en) Screen handwriting input method and device, computer equipment and storage medium
CN113538623A (en) Method and device for determining target image, electronic equipment and storage medium
CN114092607A (en) Animation display method and device of image, computer equipment 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