CN115494999A - Multi-layer drawing method and device, electronic equipment and storage medium - Google Patents

Multi-layer drawing method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN115494999A
CN115494999A CN202210989187.7A CN202210989187A CN115494999A CN 115494999 A CN115494999 A CN 115494999A CN 202210989187 A CN202210989187 A CN 202210989187A CN 115494999 A CN115494999 A CN 115494999A
Authority
CN
China
Prior art keywords
layer
dynamic
data
instruction
pixel point
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210989187.7A
Other languages
Chinese (zh)
Inventor
余朝亮
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Divoom Technology Co ltd
Original Assignee
Shenzhen Divoom Technology 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 Shenzhen Divoom Technology Co ltd filed Critical Shenzhen Divoom Technology Co ltd
Priority to CN202210989187.7A priority Critical patent/CN115494999A/en
Publication of CN115494999A publication Critical patent/CN115494999A/en
Pending legal-status Critical Current

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/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0484Interaction techniques based on graphical user interfaces [GUI] for the control of specific functions or operations, e.g. selecting or manipulating an object, an image or a displayed text element, setting a parameter value or selecting a range
    • G06F3/04845Interaction techniques based on graphical user interfaces [GUI] for the control of specific functions or operations, e.g. selecting or manipulating an object, an image or a displayed text element, setting a parameter value or selecting a range for image manipulation, e.g. dragging, rotation, expansion or change of colour
    • 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/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5027Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T11/002D [Two Dimensional] image generation
    • G06T11/001Texturing; Colouring; Generation of texture or colour

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Human Computer Interaction (AREA)
  • Processing Or Creating Images (AREA)

Abstract

The application relates to a multi-layer drawing method and device, electronic equipment and a storage medium. The pixel map drawing software can receive a drawing start instruction to enter a drawing period; receiving a drawing instruction, and adding the coordinate data and the color data selected in the drawing instruction into the dynamic brush layer for dynamic drawing; receiving a drawing stop instruction to end the current drawing period; sending the data corresponding to the drawing period to a data array of the currently selected drawing layer, and integrally displaying the data in the currently selected drawing layer; and clearing the data in the dynamic list of the dynamic brush layer after the display is successful so as to clear the image displayed by the dynamic brush layer.

Description

Multi-layer drawing method and device, electronic equipment and storage medium
Technical Field
The present application relates to the field of data processing technologies, and in particular, to a method and an apparatus for drawing a multi-layer image, an electronic device, and a storage medium.
Background
The pixel picture belongs to a dot-matrix image, and the pixel points are displayed in a size visible to naked eyes, so that the pixel picture is an image with an icon style, and clear outlines and bright colors are emphasized. The resolution of a pixel drawing is generally not high, and each drawing stroke corresponds to a limited number of pixels.
In the related art, a pixel drawing may be drawn using a drawing tool such as a pixel drawing board. Such drawing tools comprise a plurality of drawing layers. When drawing, a corresponding drawing layer can be selected for drawing. In the drawing process, each drawing stroke is equivalent to that corresponding pixel points are sequentially added on the corresponding drawing layer. Every time a pixel point is added, the CPU needs to reprocess all the plotted pixel point data of the corresponding plotted layer, so as to update the image displayed in the plotted layer. That is, each drawing stroke needs to process the pixel point data of the corresponding drawing layer for many times, so that the consumption of the CPU in the drawing process is large. Particularly, for a terminal of a low-end CPU, a pause condition may occur during drawing, which affects a drawing speed, resulting in a low efficiency of a drawing process and poor user experience.
Disclosure of Invention
The application provides a multi-layer drawing method, a multi-layer drawing device, an electronic device and a storage medium, wherein a dynamic painting brush layer is added, CPU consumption in the drawing process of a user is reduced, smooth drawing is efficiently realized, and user experience is improved.
In a first aspect, the application provides a multi-layer drawing method, which is applied to pixel map drawing software, wherein the pixel map drawing software comprises a dynamic brush layer and at least one drawing layer; the method comprises the following steps:
entering a drawing period after receiving a drawing starting instruction;
receiving a drawing instruction aiming at each drawing period, wherein the drawing instruction comprises coordinate data of a selected pixel point and selected color data;
adding the coordinate data and the selected color data of the selected pixel points in the drawing instruction into a dynamic list of a dynamic brush layer one by one so as to dynamically display an image corresponding to the drawing instruction on the dynamic brush layer;
after receiving a drawing stop instruction, finishing a drawing period;
sending data in the dynamic list in a corresponding drawing period to a data array of a currently selected drawing layer so as to display the corresponding image in the currently selected drawing layer;
and clearing the data in the dynamic list so as to clear the image displayed on the dynamic brush layer.
Optionally, the adding the coordinate data of the selected pixel point and the selected color data in the drawing instruction into the dynamic list of the dynamic brush layer one by one, so that the image corresponding to the drawing instruction is dynamically displayed on the dynamic brush layer, includes:
judging whether each selected pixel point in the drawing instruction is added into the dynamic list of the dynamic brush layer one by one according to a selected sequence aiming at each selected pixel point in the drawing instruction;
if each selected pixel point in the drawing instruction is not added into the dynamic list of the dynamic brush layer, adding the coordinate data and the selected color data of each selected pixel point in the drawing instruction into the dynamic list of the dynamic brush layer, so that each selected pixel point in the drawing instruction is displayed on the dynamic brush layer.
Optionally, the method further includes:
determining a currently selected drawing layer according to a received drawing layer selection instruction;
and setting the dynamic brush layer as an adjacent layer above the currently selected drawing layer.
Optionally, the method further includes:
and keeping the dynamic brush layer above all drawing layers all the time.
Optionally, the method further includes:
determining selected color data according to the received color selection instruction;
determining coordinate data of the selected pixel points according to the received pixel point selection instruction;
and generating a drawing instruction according to the coordinate data of the selected pixel point and the selected color data.
Optionally, the determining the coordinate data of the selected pixel point according to the received pixel point selecting instruction includes:
determining a pixel point selection mode according to the received pen shape selection instruction;
and selecting the pixel point corresponding to the touch position of the user according to the pixel point selection mode, and determining the coordinate data of the selected pixel point.
Optionally, the clearing data in the dynamic list includes:
judging whether the data in the dynamic list of the dynamic brush layer exists in the data array of the currently selected drawing layer;
and if the data in the dynamic list of the dynamic brush layer exist in the data array of the currently selected drawing layer, clearing the data in the dynamic list.
In a second aspect, the present application provides a drawing device with multiple drawing layers, including:
the drawing starting module is used for entering a drawing period after receiving a drawing starting instruction;
the drawing instruction receiving module is used for receiving a drawing instruction aiming at each drawing cycle, and each item of data of the drawing instruction comprises coordinate data of pixel points and color data selected by a user;
the dynamic drawing module is used for adding the coordinate data and the selected color data of the selected pixel points in the drawing instruction into a dynamic list of a dynamic brush layer one by one so as to dynamically display an image corresponding to the drawing instruction on the dynamic brush layer;
the drawing ending module is used for receiving a drawing stopping instruction and ending a drawing period;
the image display module is used for sending the data in the dynamic list in the corresponding drawing period to a data array of a currently selected drawing layer so as to display an image corresponding to the data in the data array in the currently selected drawing layer;
and the clearing module is used for clearing the data in the dynamic list so as to clear the image displayed on the dynamic brush layer.
Optionally, the dynamic rendering module is specifically configured to:
judging whether each selected pixel point in the drawing instruction is added into the dynamic list of the dynamic brush layer one by one according to a selected sequence aiming at each selected pixel point in the drawing instruction;
and if each selected pixel point in the drawing instruction is not added into the dynamic list of the dynamic brush layer, adding the coordinate data and the selected color data of each selected pixel point in the drawing instruction into the dynamic list of the dynamic brush layer, so that each selected pixel point in the drawing instruction is displayed on the dynamic brush layer.
Optionally, the apparatus further includes a mobile layer module, configured to:
determining a currently selected drawing layer according to a received drawing layer selection instruction;
and setting the dynamic brush layer as an adjacent layer above the currently selected drawing layer.
Optionally, the apparatus further includes a fixed layer module, configured to:
and keeping the dynamic brush layer above all drawing layers all the time.
Optionally, the apparatus further includes a drawing instruction generating module, configured to:
determining selected color data according to the received color selection instruction;
determining coordinate data of the selected pixel points according to the received pixel point selection instruction;
and generating a drawing instruction according to the coordinate data of the selected pixel point and the selected color data.
Optionally, the drawing instruction generating module is specifically configured to:
determining a pixel point selection mode according to the received pen shape selection instruction;
and selecting the pixel point corresponding to the touch position of the user according to the pixel point selection mode, and determining the coordinate data of the selected pixel point.
Optionally, the clearing module is specifically configured to:
judging whether the data in the dynamic list of the dynamic brush layer exists in the data array of the currently selected drawing layer or not;
and if the data in the dynamic list of the dynamic brush layer exist in the data array of the currently selected drawing layer, clearing the data in the dynamic list.
In a third aspect, the present application provides an electronic device, comprising: a memory and a processor, the memory having stored thereon a computer program which is loadable by the processor and which is capable of performing the method of the first aspect.
In a fourth aspect, the present application provides a computer readable storage medium storing a computer program capable of being loaded by a processor and performing the method of the first aspect.
The application provides a multi-layer drawing method and device, electronic equipment and a storage medium. And in the drawing process, newly added image content can be realized on the dynamic painting brush layer at first, then mapped to the drawing layer, and the dynamic painting brush layer is emptied. In each drawing period, a plurality of drawn pixel points are selected one by one according to the drawing instruction, and the coordinate data and the selected color data of the pixel points are added into the dynamic list of the dynamic painting brush layer one by one. In the process, corresponding to the updating of the dynamic list for a plurality of times, the CPU only needs to process a small amount of data of a small amount of pixel points corresponding to the updating processes one by one. And after one drawing period is finished, simultaneously adding the coordinate data and the selected color data of the selected pixel points into the data array of the selected drawing layer. In the process, the CPU only needs to process the data in the data array once corresponding to one time of updating of the data array. Compared with the mode of directly drawing on the drawing layer in the prior art, the processing times of the data of the corresponding data array are reduced by processing a small amount of data in the dynamic list for many times. The data volume of CPU processing has been reduced on the whole, has reduced the consumption of treater resource, and the card condition that appears when reducing even having avoided drawing promotes user's drawing speed, improves drawing efficiency, promotes user experience and feels. With the progress of the drawing, the image content is increased, the data in the data array is increased, and the effect of the scheme is more remarkable.
In addition, whether the selected pixel points are added into the dynamic list or not is judged, if yes, the pixel points are not added repeatedly, refreshing times of the CPU on the image are reduced, consumption of the CPU is reduced, and meanwhile drawing efficiency is improved.
In addition, the dynamic brush layer is adjusted to be a layer adjacent to the upper side of the selected drawing layer, the dynamic brush layer is dynamically displayed and then falls on the selected drawing layer, and the drawing effect of the dynamic brush layer on the drawing layer is the same as that of the dynamic brush layer which is not added and is directly on the selected drawing layer in the drawing visual angle of the user.
In addition, when the user selects different layers as the current layer, the dynamic brush layer can be kept to be always positioned on all drawing layers. The adjustment can lead the user to see whether the drawn content accords with the assumption of the user or not, and the drawn content cannot be shielded by the non-transparent part of the upper drawing layer, thereby improving the experience of the user.
In addition, whether the image of the current drawing period is correctly displayed on the drawing layer or not is judged according to the data in the dynamic list of the dynamic brush layer, if the image is not drawn on the drawing layer, the data in the dynamic list is sent to the drawing layer and the data array, and if the drawing is finished, the data in the dynamic list is cleared. The method and the device can ensure that the image which the user wants to draw is displayed on the drawing layer, avoid the consumption of a CPU (central processing unit) caused by redrawing the image in the drawing period, and also avoid the reduction of the user experience.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings used in the embodiments or the description of the prior art will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present application, and those skilled in the art can obtain other drawings without inventive labor.
Fig. 1 is a schematic view of an application scenario provided in an embodiment of the present application;
fig. 2 is a flowchart of a multi-layer drawing method according to an embodiment of the present application;
fig. 3 is a flowchart illustrating a dynamic brush layer adjustment method according to an embodiment of the present disclosure;
FIG. 4 is a flowchart illustrating a user drawing process according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of a drawing apparatus with multiple image layers according to an embodiment of the present disclosure;
fig. 6 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. It should be apparent that the embodiments described are some, but not all embodiments of the present application. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
In addition, the term "and/or" herein is only one kind of association relationship describing an associated object, and means that there may be three kinds of relationships, for example, a and/or B, which may mean: a exists alone, A and B exist simultaneously, and B exists alone. In addition, the character "/" herein generally indicates that the former and latter related objects are in an "or" relationship, unless otherwise specified.
The embodiments of the present application will be described in further detail with reference to the drawings attached hereto.
At present, drawing tools such as pixel drawing boards can be used for drawing pixel drawings, the drawing tools comprise a plurality of drawing layers, each pen of a user comprises a plurality of pixel points in the drawing process, one point is added on each drawing layer, and a CPU is required to redraw all the pixel points on the drawing layers, so that the images displayed on the drawing layers can be updated, and the CPU is greatly consumed when the drawing amount is large.
Based on the method, the device, the electronic equipment and the storage medium, the dynamic painting brush layer is added, CPU consumption in the painting process of a user is reduced, smooth painting is efficiently realized, and user experience is improved.
Fig. 1 is a schematic view of an application scenario provided by the present application, where when a certain user performs pixel image rendering, the method of the present application is used for rendering. Specifically, pixel map drawing software is installed on the drawing device, and the pixel map drawing software includes a dynamic brush layer and at least one drawing layer. In the drawing scene of fig. 1, the drawing device is a smart phone, and in other scenes, the drawing device may be a smart device such as a tablet computer. The user can send the instruction to the pixel map drawing software through the mode that the touch pen touched drawing equipment, and the multi-layer drawing method based on the pixel map drawing software realizes the drawing process, reaches to reduce CPU consumption, and high-efficient drawing promotes the purpose that user experience feels. Specific implementations can be found in the following examples.
Fig. 2 is a flowchart of a multi-layer drawing method according to an embodiment of the present application, where the method of the present embodiment may be applied to a drawing device in the above scenario. The pixel map drawing software comprises a dynamic brush layer, at least one drawing layer and a grid layer. The drawing layers, the dynamic painting brush layers and the grid layers are arranged from bottom to top in sequence. The grid layer separates each pixel and can initialize the grid size according to the drawing requirements of the user. In the drawing process, the grid layer cannot be changed and cannot be redrawn. The dynamic brush layer is provided with a corresponding dynamic list for recording the data of the selected pixel points and dynamically displaying the change of each drawing of the user. And the area on the drawing layer is divided into a drawing area and a toolbar. The drawing layer comprises 1-N layers, and the drawing layer 1, the drawing layer 2, the drawing layer 3 \ 8230, the drawing layer 8230and the drawing layer N are sequentially arranged from bottom to top. The nontransparent part of the upper drawing layer can block the lower drawing layer, and each layer of toolbar comprises keys with different colors, pen shapes, optional drawing layers and the like which can be selected by a user. As shown in fig. 2, the method includes:
s201, entering a drawing period after receiving a drawing starting command.
In some embodiments, the user selects a certain drawing layer on the toolbar as the currently selected drawing layer, and touches a first position in the drawing area after selecting the color and the pen shape, and this touch information may be used as a drawing start instruction.
In other embodiments, the user can touch the first position in the drawing area to stop at the color, pen shape, etc. of the previous drawing cycle in the drawing cycle without re-selection, and the touch information of the stopping can be used as the drawing start instruction.
S202, receiving a drawing instruction aiming at each drawing period, wherein the drawing instruction comprises coordinate data of the selected pixel point and selected color data.
Specifically, each drawing cycle corresponds to one drawing of the user and corresponds to one drawing instruction. Each stroke of drawing comprises a plurality of selected pixel points, and in order to display the selected pixel points on the drawing layer according to a stroke selected sequence of a user, the coordinate data and the color data of each pixel point need to be determined.
In some embodiments, the user may select different color data at different drawing cycles, and generate new drawing instructions according to the user's different selections.
In other embodiments, the user selects the same color data in different drawing cycles, and the user does not need to click the corresponding color again before the new drawing cycle begins, and the user calls the color data of the previous drawing cycle by default to generate a new drawing instruction.
And S203, adding the coordinate data of the selected pixel points and the selected color data in the drawing instruction into a dynamic list of a dynamic brush layer one by one so as to dynamically display the image corresponding to the drawing instruction on the dynamic brush layer.
Specifically, the pixel points included in each drawing cycle are in sequence, the data of the pixel points are added into the dynamic list of the dynamic painting brush layer one by one according to the sequence selected by the user and then displayed, and the displayed image needs to be refreshed every time one pixel point is added.
In some embodiments, it is assumed that a drawing cycle includes five pixel points, and the five pixel points are added to the dynamic list of the dynamic brush layer one by one according to an order selected by a user and then displayed on the dynamic brush layer. After the first selected pixel point is displayed, adding the second selected pixel point data into the dynamic list, processing the first selected pixel point and the second selected pixel point, and displaying the processed first selected pixel point and the second selected pixel point on the dynamic brush layer; and (3) adding the data of the third selected pixel point into a dynamic list, processing the first selected pixel point, the second selected pixel point and the third selected pixel point, and then displaying the processed data on a dynamic painting brush layer of (8230) (\8230), and carrying out the cyclic processing so as to dynamically display the image in a painting period on the dynamic painting brush layer.
S204, after receiving the drawing stop instruction, finishing a drawing period.
Specifically, the user can operate on the drawing area or the toolbar to trigger the drawing stop instruction,
in some embodiments, the drawing stop instruction may be a hand-up information instruction. And one drawing period comprises one-stroke drawing, the drawing is performed one by one according to the selected sequence from the touch to the first pixel point, and the hand is lifted after the drawing of the last pixel point is completed.
In other embodiments, the drawing stop instruction may be an information instruction for the user to click a save button on the toolbar. The user wants to stop drawing after several drawing cycles, and the additional touch information generated for the drawing area causes an additional image to be displayed on the drawing layer. In order to avoid the situation of false touch, the user can click the save button on the toolbar to completely empty the selected pen shape and color data, and the user needs to click again to start the drawing of the next period.
S205, sending the data in the dynamic list in the corresponding drawing period to a data array of a currently selected drawing layer, so that the corresponding image is displayed in the currently selected drawing layer.
Specifically, each time a selected pixel point is added to the drawing layer, the existing image data on the drawing layer is processed once. And sending the selected pixel point data which is dynamically displayed in the dynamic list of the dynamic brush layer to a data array of a currently selected drawing layer together, processing the image data existing on the drawing layer and the data corresponding to the drawing period, and displaying the image on the drawing layer at one time.
And S206, clearing the data in the dynamic list so as to clear the image displayed on the dynamic brush layer.
And after each drawing period is finished, clearing the data in the dynamic list, and clearing the corresponding image on the dynamic brush layer. And the dynamic brush layer is ensured to only process and display the selected pixel points in one drawing period each time.
In the multi-layer drawing method provided by this embodiment, in the drawing process, newly added image content is first implemented on the dynamic brush layer, and then mapped onto the drawing layer, and the dynamic brush layer is emptied. In each drawing period, a plurality of drawn pixel points are selected one by one according to the drawing instruction, and the coordinate data and the selected color data of the pixel points are added into the dynamic list of the dynamic painting brush layer one by one. In the process, corresponding to a plurality of times of updating of the dynamic list, the CPU only needs to process a small amount of data of a small amount of pixel points corresponding to the plurality of times of updating processes one by one. And after one drawing period is finished, simultaneously adding the coordinate data and the selected color data of the selected pixel points into the data array of the selected drawing layer. In the process, the CPU only needs to process the data in the data array once, corresponding to one update of the data array. Compared with the mode of directly drawing on the drawing layer in the prior art, the processing times of the data of the corresponding data array are reduced by processing a small amount of data in the dynamic list for many times. The data volume of CPU processing has been reduced on the whole, has reduced the consumption of treater resource, and the card condition that appears when reducing even having avoided drawing promotes user's drawing speed, improves drawing efficiency, promotes user experience and feels. With the progress of the drawing progress, the image content is increased, the data in the data array is increased, and the effect of the scheme is more obvious.
In some embodiments, the adding the coordinate data of the selected pixel point and the selected color data in the drawing instruction one by one into the dynamic list of the dynamic brush layer so that the image corresponding to the drawing instruction is dynamically displayed on the dynamic brush layer specifically includes: judging whether each selected pixel point in the drawing instruction is added into the dynamic list of the dynamic brush layer one by one according to a selected sequence aiming at each selected pixel point in the drawing instruction; if each selected pixel point in the drawing instruction is not added into the dynamic list of the dynamic brush layer, adding the coordinate data and the selected color data of each selected pixel point in the drawing instruction into the dynamic list of the dynamic brush layer, so that each selected pixel point in the drawing instruction is displayed on the dynamic brush layer.
There may be overlapping portions of a stroke drawn by the user. Judging whether each selected pixel point is added into the dynamic list or not, if not, adding the selected pixel points into the dynamic list, and displaying the selected pixel points on the dynamic painting brush layer; if the dynamic list is added, namely the overlapped pixel points appear, repeated processing is not needed to be added again, and the selected drawing layer is displayed after the drawing cycle is finished.
The embodiment judges whether the selected pixel points are added into the dynamic list, if so, the selected pixel points are not added repeatedly, the refreshing times of the CPU on the image are reduced, the consumption of the CPU is reduced, and meanwhile, the drawing efficiency is improved.
In some embodiments, the position of the dynamic brush layer may be adjusted for drawing, and the adjustment manner of the dynamic brush layer includes: determining a currently selected drawing layer according to a received drawing layer selection instruction; and setting the dynamic brush layer as an adjacent layer above the currently selected drawing layer.
The arrangement mode of the drawing layers can be described by referring to the corresponding embodiment of fig. 2, and the drawing layer 1, the drawing layer 2, the drawing layer 3, \8230, the drawing layer N-1 and the drawing layer N are sequentially arranged from bottom to top. And selecting a certain drawing layer by the user as the drawing layer corresponding to the current drawing period. The dynamic-brush layer is moved over the currently selected drawing layer as shown in fig. 3. And assuming that the drawing layer selected in the previous drawing period is a top drawing layer N, and the dynamic brush layer is positioned above and adjacent to the drawing layer N. When the drawing period selects the second top drawing layer N-1, the arrangement sequence of the drawing layers is unchanged, and the dynamic brush layer is moved to the position above the currently selected second top drawing layer N-1 and the position below the top drawing layer N. The content of the drawing image contained in the drawing period is firstly displayed on the dynamic brush layer and then mapped to the selected drawing layer, and the drawing process is shielded by the non-transparent part of the upper drawing layer.
In this embodiment, the dynamic brush layer is adjusted to be an adjacent layer above the selected drawing layer, and after being dynamically displayed on the dynamic brush layer, the dynamic brush layer falls on the selected drawing layer, and the drawing effect in the drawing view angle of the user is the same as the drawing effect in the selected drawing layer directly without adding the dynamic brush layer.
In some embodiments, the adjusting manner of the dynamic brush layer further includes: and keeping the dynamic brush layer above all drawing layers all the time.
And selecting different layers as the current drawing layer by the user, always arranging the dynamic painting brush layer below the grid layer and on all the drawing layers, and keeping the positions of the dynamic painting brush layer unchanged for drawing.
In this embodiment, when a user selects a different layer as a current layer, the dynamic brush layer is kept to be always located on all drawing layers. The adjustment can enable the user to see whether the content drawn by the user accords with the assumption of the user or not, the content cannot be shielded by the non-transparent part of the upper drawing layer, and the user experience is improved.
In some embodiments, generating the drawing instruction specifically includes: determining selected color data according to the received color selection instruction; determining coordinate data of the selected pixel points according to the received pixel point selection instruction; and generating a drawing instruction according to the coordinate data of the selected pixel point and the selected color data.
To implement the receiving of the drawing instruction in step S202 described above, the color data and the coordinate data selected by the user may be determined. The color selection instruction can be that a user clicks a color key to be selected on the toolbar, and corresponding color data is added to the drawing instruction according to the color selected by the user corresponding to the set color position list; the color selection instruction may also be that when the user does not need to change the color in multiple drawing cycles, the color data of the drawing cycle is determined according to the color selected by the user clicking the toolbar last time, and the color data is added to the drawing instruction. The pixel point selection instruction can be touch information of a user touch drawing area, pixel points contained in the position are selected according to the touch position of the user in sequence, coordinate data of the selected pixel points are determined, and the corresponding coordinate data are added into the drawing instruction.
According to the embodiment, the user can select the required color on the toolbar to generate the corresponding color, the pixel points are selected according to the drawing idea of the user, and the drawing instruction is generated according to the selected color data and the coordinate data of the selected pixel points to draw.
In some embodiments, the determining the coordinate data of the selected pixel point according to the received pixel point selecting instruction specifically includes: determining a pixel point selection mode according to the received pen shape selection instruction; and selecting the pixel point corresponding to the touch position of the user according to the pixel point selection mode, and determining the coordinate data of the selected pixel point.
The user selects different pen shapes in the drawing cycle, which contain different ranges of pixel points. The pen shape may include: thick pen shape and thin pen shape. The two types of pen shapes have different selection modes, the number of the selected pixel points of the thick pen shape in the same pen drawing is large, and the number of the selected pixel points of the thin pen shape in the same pen drawing is small. For example, the touch position of the user in the drawing area may only be half the size of a pixel point, and after selecting a thick stroke shape, two pixel points that are closest to the touch point of the user in the drawing area may be selected. The user starts a drawing period, finishes drawing according to the sequence, and determines the coordinate data of the pixel points selected by the drawing period according to the pen shape selected by the user and the selected sequence.
According to the embodiment, a user can select a required pen shape on the toolbar to determine the selection mode of the pixel points, further determine the coordinate data of the pixel points and the pixel points contained in the corresponding drawing period, and display the coordinate data and the color data on the layer, so that the user can select the pen shape to control the range of the selected pixel points according to the requirement.
In some embodiments, the clearing of the data in the dynamic list may specifically include: judging whether the data in the dynamic list of the dynamic brush layer exists in the data array of the currently selected drawing layer; and if the data in the dynamic list of the dynamic brush layer exist in the data array of the currently selected drawing layer, clearing the data in the dynamic list.
And dynamically displaying the selected pixel points in the drawing period on the dynamic brush layer and then mapping the pixel points to the selected drawing layer. And judging whether the data of the drawing period in the dynamic list of the dynamic brush layer exists in the data array of the currently selected drawing layer, if so, indicating that the image content of the drawing period is successfully mapped to the currently selected drawing layer, and then directly clearing the data corresponding to the drawing period in the dynamic list. If no external factors exist, which may be external factors, so that the mapping is not successful, the data needs to be sent to the data array of the currently selected drawing layer again for mapping.
The embodiment can judge whether the image of the current drawing period is correctly displayed on the drawing layer, if not, the data in the dynamic list is sent to the drawing layer and the data array, and if the drawing is finished, the data in the dynamic list is cleared. The method and the device can ensure that the image which the user wants to draw is displayed on the drawing layer, avoid the consumption of a CPU (central processing unit) caused by redrawing the image in the drawing period, and also avoid the reduction of the user experience.
In other embodiments, the application designs an efficient multi-layer drawing board (pixel drawing software) specially aiming at pixel drawing. Even in a terminal with a weak CPU and a weak memory, the multi-layer drawing board for the pixel map can still be efficiently realized. The user can draw smoothly without being stuck in the drawing process.
In order to pursue a form that a drawing board is divided into a plurality of view controls (drawing layers) from top to bottom in a combined and superposed mode in the drawing process of a user, in the view angle of the user, a nontransparent part of an upper layer view can block a lower layer view. The main purpose is to ensure that the user dynamically presents efficiently and dynamically changing the points drawn by the user during the drawing process. The grid layer is in the pixel drawing board, the pixel resolution is not high generally, and a plurality of grids which are intersected in a longitudinal and transverse mode are arranged to separate each pixel, so that the grids can be initialized according to the resolution of the pixel drawing board during initialization of the drawing board. The grid layer can not be changed or redrawn in the drawing process of a user, and the CPU can not be wasted by the grid layer. The dynamic painting brush layer is used for dynamically displaying the change of each drawing of a user, the period is from the time when the user presses a screen by a finger to the time when the finger is lifted, when the user selects different layers as the current layer, the layers of the painting brush layer need to be dynamically adjusted, and the painting brush layer is ensured to be arranged above the current layer M (the current drawing layer) and below the layer M + 1. The whole process does not consume too much CPU, and does not need to regenerate or destroy the image layer. The layers 1-M (drawing layers) are used for displaying the picture of each layer in a multi-layer drawing board (pixel map drawing software), and the non-transparent part of the upper layer can block the lower layer. Each layer has a "data array" to record the color of each point of the current layer. Each layer redraw generates an image from this "data array" into the layer.
The drawing process of the user is as shown in fig. 4, and a period is counted from the time when the user's finger presses down the screen to the time when the finger lifts up.
And recording the data of the drawing period by using a data structure of a dynamic List List (dynamic List of a dynamic painting brush layer), judging whether the List List is added or not when a user touches a 'drawing board point' (pixel point), if not, adding the coordinate information into the dynamic List and informing the dynamic painting brush layer of real-time refreshing.
And after receiving the real-time refreshing notification, the dynamic brush layer acquires coordinate data of all the points from the dynamic list and draws corresponding points at corresponding coordinates.
When the finger of the user lifts up, the user is informed of the currently selected layer M (the currently drawn layer), the layer M acquires the coordinate data of the current period from the dynamic list, modifies the 'data array' of the layer, redraws the layer view, cleans the data of the dynamic list and redraws the dynamic brush layer (equivalent to cleaning the points of the dynamic brush layer). This process is equivalent to mapping the points of the dynamic brush layer into layer M.
The efficient part in the drawing process is illustrated as follows: 1. the grid layer does not need to be redrawn in the whole process, and the CPU is not wasted. 2. Because the resolution of the pixel drawing board is not high, each stroke of a user only modifies the data of a plurality of points, the dynamic drawing layer only needs to draw the data of the plurality of points every time, and the data of the whole drawing layer does not need to be redrawn. 3. The layer is only required to be redrawn after the last user raises his hands, so that the CPU expense is saved.
Through the layered framework, the dynamic painting brush layer is added, the CPU consumption in the painting process of a user is greatly reduced, the user experience is improved, the function of the multilayer pixel painting board can be realized by the low-end CPU terminal, and the product experience is enhanced.
Fig. 5 is a schematic structural diagram of a multi-layer drawing apparatus according to an embodiment of the present application, and as shown in fig. 5, the multi-layer drawing apparatus 500 of the present embodiment includes a drawing cycle starting module 501, a drawing instruction receiving module 502, a dynamic drawing module 503, a drawing ending module 504, an image display module 505, and an erasing module 506.
A drawing start module 501, configured to enter a drawing cycle after receiving a drawing start instruction;
a drawing instruction receiving module 502, configured to receive, for each drawing cycle, a drawing instruction, where each item of data of the drawing instruction includes coordinate data of a pixel point and color data selected by a user;
a dynamic drawing module 503, configured to add the coordinate data of the selected pixel point and the selected color data in the drawing instruction to a dynamic list of a dynamic brush layer one by one, so that an image corresponding to the drawing instruction is dynamically displayed on the dynamic brush layer;
a drawing end module 504, configured to receive a drawing stop instruction and end a drawing cycle;
an image display module 505, configured to send data in the dynamic list in a corresponding drawing period to a data array of a currently selected drawing layer, so that an image corresponding to the data in the data array is displayed in the currently selected drawing layer;
a clearing module 506, configured to clear data in the dynamic list to clear the image displayed on the dynamic brush layer.
Optionally, the dynamic rendering module 503 is specifically configured to:
judging whether each selected pixel point in the drawing instruction is added into the dynamic list of the dynamic brush layer one by one according to a selected sequence aiming at each selected pixel point in the drawing instruction;
and if each selected pixel point in the drawing instruction is not added into the dynamic list of the dynamic brush layer, adding the coordinate data and the selected color data of each selected pixel point in the drawing instruction into the dynamic list of the dynamic brush layer, so that each selected pixel point in the drawing instruction is displayed on the dynamic brush layer.
Optionally, the apparatus 500 further includes a moving layer module 507, configured to:
determining a currently selected drawing layer according to a received drawing layer selection instruction;
and setting the dynamic brush layer as an adjacent layer above the currently selected drawing layer.
Optionally, the apparatus 500 further includes a fixed layer module 508, configured to:
and keeping the dynamic brush layer above all drawing layers all the time.
Optionally, the apparatus 500 further includes a drawing instruction generating module 509, configured to:
determining selected color data according to the received color selection instruction;
determining coordinate data of the selected pixel points according to the received pixel point selection instruction;
and generating a drawing instruction according to the coordinate data of the selected pixel point and the selected color data.
Optionally, the drawing instruction generating module 509 is specifically configured to:
determining a pixel point selection mode according to the received stroke shape selection instruction;
and selecting the pixel point corresponding to the touch position of the user according to the pixel point selection mode, and determining the coordinate data of the selected pixel point.
Optionally, the clearing module 506 is specifically configured to:
judging whether the data in the dynamic list of the dynamic brush layer exists in the data array of the currently selected drawing layer or not;
and if the data in the dynamic list of the dynamic brush layer exist in the data array of the currently selected drawing layer, clearing the data in the dynamic list.
The apparatus of this embodiment may be configured to perform the method of any of the above embodiments, and the implementation principle and the technical effect are similar, which are not described herein again.
Fig. 6 is a schematic structural diagram of an electronic device according to an embodiment of the present application, and as shown in fig. 6, an electronic device 600 according to the embodiment may include: a memory 601 and a processor 602.
The memory 601 has stored thereon a computer program that can be loaded by the processor 602 and executed to perform the method in the above-described embodiments.
The processor 602 is coupled to the memory 601, such as via a bus.
Optionally, the electronic device 600 may also include a transceiver. It should be noted that the transceiver in practical application is not limited to one, and the structure of the electronic device 600 is not limited to the embodiment of the present application.
The Processor 602 may be a CPU (Central Processing Unit), a general-purpose Processor, a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array), or other Programmable logic device, transistor logic device, hardware component, or any combination thereof. Which may implement or perform the various illustrative logical blocks, modules, and circuits described in connection with the disclosure. The processor 602 may also be a combination of computing functions, e.g., comprising one or more microprocessors, a combination of a DSP and a microprocessor, or the like.
A bus may include a path that transfers information between the above components. The bus may be a PCI (Peripheral Component Interconnect) bus, an EISA (Extended Industry Standard Architecture) bus, or the like. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown, but this is not intended to represent only one bus or type of bus.
The Memory 601 may be a ROM (Read Only Memory) or other type of static storage device that can store static information and instructions, a RAM (Random Access Memory) or other type of dynamic storage device that can store information and instructions, an EEPROM (Electrically Erasable Programmable Read Only Memory), a CD-ROM (Compact Disc Read Only Memory) or other optical Disc storage, optical Disc storage (including Compact Disc, laser Disc, optical Disc, digital versatile Disc, blu-ray Disc, etc.), a magnetic Disc storage medium or other magnetic storage device, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer, but is not limited to these.
The memory 601 is used for storing application program codes for executing the scheme of the application, and the processor 602 controls the execution. Processor 602 is configured to execute application program code stored in memory 601 to implement the teachings of the foregoing method embodiments.
Wherein, the electronic device includes but is not limited to: mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), in-vehicle terminals (e.g., in-vehicle navigation terminals), and the like, and fixed terminals such as digital TVs, desktop computers, and the like. But also a server, etc. The electronic device shown in fig. 6 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present application.
The electronic device of this embodiment may be configured to perform the method of any of the above embodiments, and the implementation principle and the technical effect are similar, which are not described herein again.
The present application also provides a computer readable storage medium storing a computer program that can be loaded by a processor and executed to perform the method as in the above embodiments.
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.

Claims (10)

1. The multi-layer drawing method is characterized by being applied to pixel map drawing software, wherein the pixel map drawing software comprises a dynamic brush layer and at least one drawing layer; the method comprises the following steps:
entering a drawing period after receiving a drawing starting command;
receiving a drawing instruction aiming at each drawing period, wherein the drawing instruction comprises coordinate data of a selected pixel point and selected color data;
adding the coordinate data of the selected pixel points and the selected color data in the drawing instruction into a dynamic list of a dynamic painting brush layer one by one so as to dynamically display the image corresponding to the drawing instruction on the dynamic painting brush layer;
after receiving a drawing stop instruction, finishing a drawing period;
sending data in the dynamic list in a corresponding drawing period to a data array of a currently selected drawing layer so as to display the corresponding image in the currently selected drawing layer;
and clearing the data in the dynamic list so as to clear the image displayed on the dynamic brush layer.
2. The method of claim 1, wherein the adding the coordinate data of the selected pixel point and the selected color data in the drawing instruction one by one into a dynamic list of a dynamic brush layer to dynamically display an image corresponding to the drawing instruction on the dynamic brush layer comprises:
judging whether each selected pixel point in the drawing instruction is added into the dynamic list of the dynamic brush layer one by one according to a selected sequence aiming at each selected pixel point in the drawing instruction;
and if each selected pixel point in the drawing instruction is not added into the dynamic list of the dynamic brush layer, adding the coordinate data and the selected color data of each selected pixel point in the drawing instruction into the dynamic list of the dynamic brush layer, so that each selected pixel point in the drawing instruction is displayed on the dynamic brush layer.
3. The method of claim 1 or 2, further comprising:
determining a currently selected drawing layer according to a received drawing layer selection instruction;
and setting the dynamic brush layer as an adjacent layer above the currently selected drawing layer.
4. The method of claim 1 or 2, further comprising:
and keeping the dynamic brush layer above all drawing layers all the time.
5. The method of claim 1 or 2, further comprising:
determining selected color data according to the received color selection instruction;
determining coordinate data of the selected pixel points according to the received pixel point selection instruction;
and generating a drawing instruction according to the coordinate data of the selected pixel point and the selected color data.
6. The method of claim 5, wherein determining coordinate data for the selected pixel point in accordance with the received pixel point selection instruction comprises:
determining a pixel point selection mode according to the received pen shape selection instruction;
and selecting the pixel point corresponding to the touch position of the user according to the pixel point selection mode, and determining the coordinate data of the selected pixel point.
7. The method of any of claims 1, 2, and 6, wherein clearing the data in the dynamic list comprises:
judging whether the data in the dynamic list of the dynamic brush layer exists in the data array of the currently selected drawing layer;
and if the data in the dynamic list of the dynamic brush layer exist in the data array of the currently selected drawing layer, clearing the data in the dynamic list.
8. A drawing device with multiple drawing layers, comprising:
the drawing starting module is used for entering a drawing period after receiving a drawing starting instruction;
the drawing instruction receiving module is used for receiving a drawing instruction aiming at each drawing cycle, and each item of data of the drawing instruction comprises coordinate data of pixel points and color data selected by a user;
the dynamic drawing module is used for adding the coordinate data and the selected color data of the selected pixel points in the drawing instruction into a dynamic list of a dynamic brush layer one by one so as to dynamically display an image corresponding to the drawing instruction on the dynamic brush layer;
the drawing ending module is used for receiving a drawing stopping instruction and ending a drawing period;
the image display module is used for sending the data in the dynamic list in the corresponding drawing period to a data array of a currently selected drawing layer so as to display an image corresponding to the data in the data array in the currently selected drawing layer;
and the clearing module is used for clearing the data in the dynamic list so as to clear the image displayed on the dynamic brush layer.
9. An electronic device, comprising: a memory and a processor;
the memory to store program instructions;
the processor, which is used to call and execute the program instructions in the memory, executes the method of any one of claims 1-7.
10. A computer-readable storage medium, characterized in that a computer program is stored in the computer-readable storage medium; the computer program, when executed by a processor, implements the method of any one of claims 1-7.
CN202210989187.7A 2022-08-17 2022-08-17 Multi-layer drawing method and device, electronic equipment and storage medium Pending CN115494999A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210989187.7A CN115494999A (en) 2022-08-17 2022-08-17 Multi-layer drawing method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210989187.7A CN115494999A (en) 2022-08-17 2022-08-17 Multi-layer drawing method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN115494999A true CN115494999A (en) 2022-12-20

Family

ID=84467421

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210989187.7A Pending CN115494999A (en) 2022-08-17 2022-08-17 Multi-layer drawing method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN115494999A (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140132617A1 (en) * 2012-11-14 2014-05-15 Microsoft Corporation Simulation of oil paint on a canvas
US20150378643A1 (en) * 2014-06-30 2015-12-31 Canon Kabushiki Kaisha Information processing apparatus, processing method, and storage medium
CN109784180A (en) * 2018-12-15 2019-05-21 深圳壹账通智能科技有限公司 Drawing practice, device, computer equipment and storage medium based on augmented reality
CN113093969A (en) * 2021-06-09 2021-07-09 北京易真学思教育科技有限公司 Hand-drawn track rendering method, device, electronic equipment, medium and program product

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140132617A1 (en) * 2012-11-14 2014-05-15 Microsoft Corporation Simulation of oil paint on a canvas
US20150378643A1 (en) * 2014-06-30 2015-12-31 Canon Kabushiki Kaisha Information processing apparatus, processing method, and storage medium
CN109784180A (en) * 2018-12-15 2019-05-21 深圳壹账通智能科技有限公司 Drawing practice, device, computer equipment and storage medium based on augmented reality
CN113093969A (en) * 2021-06-09 2021-07-09 北京易真学思教育科技有限公司 Hand-drawn track rendering method, device, electronic equipment, medium and program product

Similar Documents

Publication Publication Date Title
US8276101B2 (en) Touch gestures for text-entry operations
US8306330B2 (en) Game apparatus and storage medium storing a handwriting input program
US8847961B2 (en) Geometry, speed, pressure, and anti-aliasing for ink rendering
EP2756481B1 (en) System and method for layering using tile-based renderers
US20110239153A1 (en) Pointer tool with touch-enabled precise placement
EP2770422A2 (en) Method for providing a feedback in response to a user input and a terminal implementing the same
CN110347317B (en) Window switching method and device, storage medium and interactive intelligent panel
CN111831182B (en) Application icon control method and device and electronic equipment
JP2011520209A5 (en)
WO2021164460A1 (en) Touch response method and apparatus, electronic device, and storage medium
US10855481B2 (en) Live ink presence for real-time collaboration
US10643580B2 (en) Method and device for switching playing mode of a mobile terminal, storage medium and program
CN103268620A (en) Graphic processing method, graphic processing device and terminal device
US20070002014A1 (en) Pointer for a large display
JP6912995B2 (en) Programs, control methods, and information processing equipment
US20080143673A1 (en) Method and Apparatus For Moving Cursor Using Numerical Keys
CN106201407A (en) A kind of data display method and terminal
US20140019894A1 (en) Augmenting user interface elements
CN113244611A (en) Virtual article processing method, device, equipment and storage medium
CN113268182A (en) Application icon management method and electronic equipment
CN112596660A (en) Writing display processing method and electronic equipment
CN115494999A (en) Multi-layer drawing method and device, electronic equipment and storage medium
US9229608B2 (en) Character display apparatus, character display method, and computer readable medium
US9323431B2 (en) User interface for drawing with electronic devices
CN106598315B (en) Touch display device and background image replacement method thereof

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