[go: up one dir, main page]

CN117556856A - Editing-based two-dimensional code generation method, electronic equipment and storage medium - Google Patents

Editing-based two-dimensional code generation method, electronic equipment and storage medium Download PDF

Info

Publication number
CN117556856A
CN117556856A CN202311692261.XA CN202311692261A CN117556856A CN 117556856 A CN117556856 A CN 117556856A CN 202311692261 A CN202311692261 A CN 202311692261A CN 117556856 A CN117556856 A CN 117556856A
Authority
CN
China
Prior art keywords
target
dimensional code
text
width
display area
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
CN202311692261.XA
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 Pushi Technology Co ltd
Original Assignee
Shenzhen Pushi 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 Pushi Technology Co ltd filed Critical Shenzhen Pushi Technology Co ltd
Priority to CN202311692261.XA priority Critical patent/CN117556856A/en
Publication of CN117556856A publication Critical patent/CN117556856A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06KGRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
    • G06K19/00Record carriers for use with machines and with at least a part designed to carry digital markings
    • G06K19/06Record carriers for use with machines and with at least a part designed to carry digital markings characterised by the kind of the digital marking, e.g. shape, nature, code
    • G06K19/06009Record carriers for use with machines and with at least a part designed to carry digital markings characterised by the kind of the digital marking, e.g. shape, nature, code with optically detectable marking
    • G06K19/06037Record carriers for use with machines and with at least a part designed to carry digital markings characterised by the kind of the digital marking, e.g. shape, nature, code with optically detectable marking multi-dimensional coding
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06KGRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
    • G06K7/00Methods or arrangements for sensing record carriers, e.g. for reading patterns
    • G06K7/10Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation
    • G06K7/14Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation using light without selection of wavelength, e.g. sensing reflected white light
    • G06K7/1404Methods for optical code recognition
    • G06K7/1408Methods for optical code recognition the method being specifically adapted for the type of code
    • G06K7/14172D bar codes
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V30/00Character recognition; Recognising digital ink; Document-oriented image-based pattern recognition
    • G06V30/10Character recognition
    • G06V30/14Image acquisition
    • G06V30/148Segmentation of character regions
    • G06V30/153Segmentation of character regions using recognition of characters or words

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Multimedia (AREA)
  • Health & Medical Sciences (AREA)
  • Electromagnetism (AREA)
  • General Health & Medical Sciences (AREA)
  • Toxicology (AREA)
  • Artificial Intelligence (AREA)
  • User Interface Of Digital Computer (AREA)

Abstract

The application relates to the technical field of two-dimension codes, and provides a two-dimension code generation method based on editing, electronic equipment and a storage medium. According to the method, the target two-dimensional code element control selected by the user is displayed in the preset canvas area, after the user edits the preset text displayed in the target two-dimensional code element control, whether a first display area corresponding to the edited target text is matched with a second display area corresponding to the target two-dimensional code element control is judged, and when the first display area is matched with the second display area, the display of the target text is adjusted according to the second display area, so that a target two-dimensional code is generated according to the adjusted and displayed target text and the target two-dimensional code element control. According to the method and the device, text editing is carried out on the two-dimensional code element control with the preset text, the user definition capability of a user is increased, the user can edit the text according to the need, and therefore the two-dimensional code which meets the requirements better is generated, and the content of the two-dimensional code can be intuitively obtained.

Description

Editing-based two-dimensional code generation method, electronic equipment and storage medium
Technical Field
The application relates to the technical field of two-dimensional codes, in particular to a two-dimensional code generation method based on editing, electronic equipment and a storage medium.
Background
Two-dimensional codes are also called two-dimensional bar codes, can store more information than traditional bar codes, and can also represent more data types. The two-dimensional code is a graph which is distributed in a two-dimensional direction according to a certain rule by using a certain specific geometric figure, is black-white and records data symbol information. The concept of "0" and "1" bit stream forming the logic foundation in computer is skillfully utilized in code formation, several geometric shapes corresponding to binary system are used to represent literal value information, and the information is automatically read by image input equipment or photoelectric scanning equipment so as to implement automatic information processing.
At present, two-dimensional codes on the market need to be generated by means of a two-dimensional code generator, the generated two-dimensional codes do not necessarily meet the requirements of users, the generated two-dimensional codes are patterns, and the users cannot distinguish the content of the two-dimensional codes through naked eyes.
Disclosure of Invention
In view of the above, the present application provides an editing-based two-dimensional code generation method, an electronic device, and a storage medium, which are used for simplifying the two-dimensional code generation process and intuitively obtaining the content of the two-dimensional code.
A first aspect of the present application provides an editing-based two-dimensional code generation method, the method including:
displaying a target two-dimensional code element control selected by a user in a preset canvas area, wherein preset text is displayed in the target two-dimensional code element control;
acquiring a target text obtained after the user edits based on the preset text;
judging whether a first display area corresponding to the target text is matched with a second display area corresponding to the target two-dimensional code element control;
when the first display area is not matched with the second display area, adjusting the display of the target text according to the second display area;
and generating a target two-dimensional code according to the target text after adjustment and display and the target two-dimensional code element control.
In an optional implementation manner, the determining whether the first display area corresponding to the target text matches the second display area corresponding to the target two-dimensional symbol element control includes:
acquiring a first width of a first display area corresponding to the target text;
acquiring a second width of a second display area corresponding to the target two-dimensional code element control;
judging whether the first width is larger than the second width;
when the first width is larger than the second width, determining that the first display area is not matched with the second display area;
and when the first width is smaller than or equal to the second width, determining that the first display area is matched with the second display area.
In an optional embodiment, the obtaining the first width of the first display area corresponding to the target text includes:
acquiring a character string in the target text;
acquiring the number of characters in the character string, the font size of each character and the font style;
calculating the width of each character according to the word size and the font;
and obtaining the first width according to the number of the characters, the width of each character and the width between the characters.
In an optional embodiment, the adjusting the display of the target text according to the second display area includes:
obtaining a target character number according to the second width of the second display area, the width of each character and the width between the characters;
determining a display text from the target text according to the target character number;
and displaying the display text.
In an alternative embodiment, the method further comprises:
when the scaling operation is detected to be received on the target two-dimensional code, determining a scaling area corresponding to the scaling operation;
judging whether the zoom area is larger than the preset canvas area or not;
when the zoom area is larger than the preset canvas area, displaying area content corresponding to the preset canvas area in the target two-dimensional code;
and when the zoom area is smaller than or equal to the preset canvas area, performing zoom display on the target two-dimensional code according to the zoom area.
In an alternative embodiment, the method further comprises:
displaying a two-dimensional code editing interface, wherein a two-dimensional code editing frame is displayed in the two-dimensional code editing interface;
receiving the target size and/or the target position of the target two-dimensional code element control edited in the two-dimensional code editing frame;
and adjusting the display size of the target two-dimensional code according to the center of the target two-dimensional code element control and the target size, and/or adjusting the display position of the target two-dimensional code according to the designated vertex of the target two-dimensional code element control and the target position.
In an alternative embodiment, the method further comprises:
displaying a deleting icon on the target two-dimensional code;
and deleting the target two-dimensional code when the deleting operation is detected on the deleting icon.
In an alternative embodiment, the method further comprises:
and when a printing instruction is received, the target two-dimensional code is sent to a printer corresponding to the printer model selected by the user for printing.
A second aspect of the present application provides an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor, where the processor implements the steps of the editing-based two-dimensional code generating method when the computer program is executed.
A third aspect of the present application provides a computer-readable storage medium having stored thereon a computer program which, when executed, implements the steps of the editing-based two-dimensional code generation method.
According to the method, the target two-dimensional code element control selected by the user is displayed in the preset canvas area, after the user edits the preset text displayed in the target two-dimensional code element control, whether a first display area corresponding to the edited target text is matched with a second display area corresponding to the target two-dimensional code element control is judged, and when the first display area is matched with the second display area, the display of the target text is adjusted according to the second display area, so that a target two-dimensional code is generated according to the adjusted and displayed target text and the target two-dimensional code element control. According to the method and the device, text editing is carried out on the two-dimensional code element control with the preset text, the user-defined capability of a user is improved, the user can edit the text according to the requirement, and therefore the two-dimensional code which meets requirements better is generated. The method and the device simplify the process of generating the two-dimension code, facilitate a user to more easily create the personalized and effective two-dimension code, and can intuitively acquire the content of the two-dimension code.
Drawings
Fig. 1 is a flowchart of a two-dimensional code generating method based on editing provided in an embodiment of the present application;
fig. 2 is a block diagram of an electronic device shown in an embodiment of the present application.
Detailed Description
The terminology used in the following embodiments of the application is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. As used in the specification of this application, the singular forms "a", "an", "the" and "the" are intended to include the plural forms as well, unless the context clearly indicates to the contrary. It should also be understood that the term "and/or" as used in this application is intended to encompass any or all possible combinations of one or more of the listed items.
The terms "first," "second," and the like, are used below for descriptive purposes only and are not to be construed as implying or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defining "a first" or "a second" may explicitly or implicitly include one or more such feature, and in the description of embodiments of the present application, unless otherwise indicated, the meaning of "a plurality" is two or more.
Fig. 1 is a flowchart of an editing-based two-dimensional code generating method provided in an embodiment of the present application, where the editing-based two-dimensional code generating method specifically includes the following steps.
And S11, displaying a target two-dimensional code element control selected by a user in a preset canvas area, wherein a preset text is displayed in the target two-dimensional code element control.
The electronic device may provide a display interface in advance, where the canvas area and the two-dimensional symbol element control display area are displayed on the display interface.
The canvas area is a virtual area for editing the two-dimensional code. The canvas area supports responsive design, and the size of the canvas area can be adaptively adjusted according to the size and type of the screen of the electronic device. The preset canvas area is provided with scale lines which can help a user to accurately position and align graphic elements in the canvas area.
And a plurality of two-dimensional code element controls of different types are displayed in the two-dimensional code element control display area, and each type of two-dimensional code element control has a text. The text is pre-custom set, e.g., 123456.
The user can touch or click the two-dimensional symbol element control displayed in the two-dimensional symbol element control display area by a finger, a touch pen or the like, and after the user touches or clicks a certain two-dimensional symbol element control, the touched or clicked two-dimensional symbol element control is the target two-dimensional symbol element control selected by the user, and the target two-dimensional symbol element control can be synchronously displayed in the canvas area.
In an alternative embodiment, when the target two-dimensional code element control is displayed in the canvas area, an initial display position of the target two-dimensional code element control in the canvas area may also be set, for example, displayed in the upper left corner of the canvas area or displayed in the middle of the canvas area. The initial display position of the target two-dimensional code element control in the canvas area is not limited, and self-adaptive adjustment or modification can be carried out according to actual requirements.
S12, acquiring a target text obtained after the user edits based on the preset text.
After the electronic device displays the target two-dimensional code element control in the canvas area, a text editing interface can be displayed at other positions of the same interface of the canvas area, and the text editing interface is used for editing the preset text to obtain the target text.
In some embodiments, a sweep-sweep function may be provided in the text editing interface, where the sweep-sweep function allows the user to scan the viewfinder in alignment with the barcode or the two-dimensional code, and replace the scanned text with the preset text, thereby obtaining the target text.
In some embodiments, an optical character recognition (Optical Character Recognition, OCR) function may be provided in the text editing interface, and the optical character recognition technology is used to recognize the picture or document selected by the user, and the text obtained by recognition is replaced by the preset text as the target text. The user may select a picture from a picture library and may select a document from a file store.
In some embodiments, a voice function may be provided in the text editing interface, through which a voice of a user may be obtained, and the voice may be converted into text, and the converted text may be replaced with a preset text as a target text.
And S13, judging whether the first display area corresponding to the target text is matched with the second display area corresponding to the target two-dimensional code element control.
The region corresponding to the target text is a first display region, and the region corresponding to the target two-dimensional code element control is a second display region.
And comparing the first display area with the second display area to judge whether the first display area is matched with the second display area. S16 may be performed when the first display area is matched with the second display area, and S14 may be performed when the first display area is not matched with the second display area.
In an optional implementation manner, the determining whether the first display area corresponding to the target text matches the second display area corresponding to the target two-dimensional symbol element control includes:
acquiring a first width of a first display area corresponding to the target text;
acquiring a second width of a second display area corresponding to the target two-dimensional code element control;
judging whether the first width is larger than the second width;
when the first width is larger than the second width, determining that the first display area is not matched with the second display area;
and when the first width is smaller than or equal to the second width, determining that the first display area is matched with the second display area.
The target text is a character string comprising a plurality of text characters, the first width of the first display area is the width of the character string of the target text, and the width of the target text can be obtained through a text measurement function or method, so that the first width is obtained.
The second width of the second display area is the width of the target two-dimensional symbol element control, and the width of the target two-dimensional symbol element control can be obtained through an element measurement function or method, so that the second width is obtained.
And comparing the first width with the second width to judge whether the first display area is matched with the second display area. When the first width is larger than the second width, the first display area corresponding to the target text is larger than the second display area corresponding to the target two-dimensional code element control, the target text is not matched with the target two-dimensional code element control, and the first display area is not matched with the second display area. When the first width is smaller than or equal to the second width, the first display area corresponding to the target text is smaller than or equal to the second display area corresponding to the target two-dimensional code element control, the target text is matched with the target two-dimensional code element control, and the first display area is matched with the second display area.
In an optional embodiment, the obtaining the first width of the first display area corresponding to the target text includes:
acquiring a character string in the target text;
acquiring the number of characters in the character string, the font size of each character and the font style;
calculating the width of each character according to the word size and the font;
and obtaining the first width according to the number of the characters, the width of each character and the width between the characters.
In some embodiments, the user may perform an editing operation on the target text in the first display area, for example, setting a font size, a font, a text color, a text thickness, a text alignment manner, a text word spacing, a line spacing, and the like of the target text. The font height of the target text can be changed by setting the font size. The text style of the target text can be changed by setting fonts. The color of the target text may be changed by setting the text color. The font thickness of the target text can be changed by setting the text thickness. The text alignment method comprises the following steps: left alignment, right alignment and centering alignment, wherein the left alignment indicates that a first text character of the target text is aligned with the leftmost side of the two-dimensional code element control, the right alignment indicates that a last text character of the target text is aligned with the rightmost side of the two-dimensional code element control, and the centering alignment indicates that a middle text character of the target text is aligned with the region center of the two-dimensional code element control. The spacing distance between characters in the target text font can be changed by setting the text word spacing. The spacing distance between the upper line and the lower line of each line of characters in the target text content can be changed by setting the line spacing.
By way of example, assuming that the character string in the target text is "Hello World", the number of characters of the character string is 11, the font is Arial, the letter 'h' is about 9px wide in Arial font, the letter 'e' is about 6px wide in Arial font, the letter 'l' is about 10px wide in Arial font, the letter 'o' is about 6px wide in Arial font, the space "is about 4px wide, the letter 'w' is about 12px wide, the letter 'r' is about 5px wide, the letter'd' is about 7px wide, and for" Hello, world ", the width between characters is 1px wide, then the first width= (9px+6px+10px+6px+6px+6px+7px+7px+10px+7px+ 10 px) =9797 px).
In some embodiments, when the attribute of the target two-dimensional symbol element control is changed, the picture display style of the target two-dimensional symbol element control is also changed accordingly. The attributes of the target two-dimensional symbol pixel control may include, but are not limited to: the two-dimensional code element control comprises a coding format, whether mirror images, a size, a position and the like.
And the display style of the two-dimensional code element control is changed according to the font coding format. The font encoding format may include, but is not limited to: UTF-8, GBK, ISO-8859-1. For example, if the target text is "123abc", the display style of the two-dimensional code element control will not be changed no matter what type of coding format is changed. If the target text is "123 test comparisons," then when the encoding format changes, the display style of the two-dimensional symbol element control changes accordingly.
It should be noted that, when the target text in the first display area is displayed in multiple lines, the first width may be calculated according to the text content in the first line.
S14, adjusting the display of the target text according to the second display area.
When the first display area is not matched with the second display area, the first display area corresponding to the target text needs to be adjusted according to the second display area, so that the display of the target text is adjusted, and the adjusted target text can be adapted to the second display area.
In an optional embodiment, the adjusting the display of the target text according to the second display area includes:
obtaining a target character number according to the second width of the second display area, the width of each character and the width between the characters;
determining a display text from the target text according to the target character number;
and displaying the display text.
The sum of the second width and the width of the character can be calculated to obtain a first width sum; calculating the sum of the width of the characters and the width between the characters to obtain a second width sum; calculating a quotient of the first width sum and the second width sum; and rounding down the quotient to obtain the target character quantity.
The target number of characters determines the number of characters of the display text that can be displayed in the target text. And starting traversing and reading from the first character of the target text, stopping traversing the target text when the number of the read characters is the target number of characters, and displaying the read characters as a display text.
For example, assuming that the second width corresponding to the target two-dimensional symbol element control is 80px, the width of each character is 8px, and the width between the characters is 2px, the target number of characters is calculated to be 8. Assuming that the target text is "Hello World", the display text determined from the target text according to the target character number is "Hello Wo".
And S15, generating a target two-dimensional code according to the target text after adjustment and display and the target two-dimensional code element control.
And combining the target text after adjustment and display with the target two-dimensional code element control in a picture form to generate a target two-dimensional code.
S16, generating a target two-dimensional code according to the target text and the target two-dimensional code element control.
When the first display area is matched with the second display area, a target two-dimensional code can be generated directly based on the target text and the target two-dimensional code element control.
In an alternative embodiment, the method further comprises:
when the scaling operation is detected to be received on the target two-dimensional code, determining a scaling area corresponding to the scaling operation;
judging whether the zoom area is larger than the preset canvas area or not;
when the zoom area is larger than the preset canvas area, displaying area content corresponding to the preset canvas area in the target two-dimensional code;
and when the zoom area is smaller than or equal to the preset canvas area, performing zoom display on the target two-dimensional code according to the zoom area.
The user can trigger to display the zoom icon by clicking or touching the target two-dimensional code, and when dragging the zoom icon along the direction of the zoom icon, the target two-dimensional code can be reduced or enlarged. When the user stops the drag operation, the area corresponding to the target two-dimensional code when the drag operation is stopped is taken as a zoom area.
The width of the zoom area and the width of the preset canvas area are obtained, and the width of the zoom area and the width of the preset canvas area are compared to judge whether the zoom area is larger than the preset canvas area or not, so that how the target two-dimensional code after zooming is displayed is determined.
When the width of the zoom area is larger than that of the preset canvas area, the user is indicated to perform the amplifying operation on the target two-dimensional code, and the width of the amplified target two-dimensional code exceeds the boundary of the preset canvas area, therefore, the target two-dimensional code is intercepted according to the preset canvas area, the intercepted content is consistent with the size of the preset canvas area, and the intercepted content is displayed in the preset canvas area. That is, only the content of the target two-dimensional code, which is the same as the preset canvas area in size, is displayed, and the part exceeding the preset canvas area is not displayed. And when the width of the zoom area is smaller than or equal to the width of the preset canvas area, indicating that the user executes the zoom-out operation on the target two-dimensional code. After the target two-dimensional code is reduced, the width of the target two-dimensional code is reduced and does not exceed the boundary of the preset canvas area, so that the reduced target two-dimensional code can be completely displayed in the preset canvas area.
When the target two-dimensional code is scaled, scaling can be performed according to a preset scaling ratio, so that the two-dimensional code is ensured to be square all the time, and deformation phenomenon of the two-dimensional code during scaling is avoided.
In an alternative embodiment, a minimum scaling ratio and a maximum scaling ratio may be further set, where the minimum scaling ratio is used to limit the minimum scaling width of the target two-dimensional code, and the maximum scaling ratio is used to limit the maximum scaling width of the target two-dimensional code. When the scaling operation is received on the target two-dimensional code, determining a scaling ratio corresponding to the scaling operation, comparing the scaling ratio with a minimum scaling ratio and a maximum scaling ratio, prohibiting the scaling operation on the target two-dimensional code when the scaling ratio is smaller than the minimum scaling ratio, avoiding the compressed two-dimensional code from being invisible after the scaling operation is reduced, and prohibiting the scaling operation on the target two-dimensional code when the scaling ratio is larger than the maximum scaling ratio, thereby avoiding the amplified target two-dimensional code from being blurred. When the scaling ratio is between the minimum scaling ratio and the maximum scaling ratio, scaling operation can be performed on the target two-dimensional code, and a scaling area corresponding to the scaling operation is determined.
Minimum scaling width of target two-dimensional code = original width of target two-dimensional code = minimum scaling scale, maximum scaling width of target two-dimensional code = original width of target two-dimensional code = maximum scaling scale, scaling width of target two-dimensional code = original width of target two-dimensional code.
In an alternative embodiment, the method further comprises:
displaying a two-dimensional code editing interface, wherein a two-dimensional code editing frame is displayed in the two-dimensional code editing interface;
receiving the target size and/or the target position of the target two-dimensional code element control edited in the two-dimensional code editing frame;
and adjusting the display size of the target two-dimensional code according to the center of the target two-dimensional code element control and the target size, and/or adjusting the display position of the target two-dimensional code according to the designated vertex of the target two-dimensional code element control and the target position.
The text editing interface is provided with a two-dimensional code editing frame, and a user can edit the target size of the target two-dimensional code element control through the two-dimensional code editing frame, so that the display size of the target two-dimensional code in a preset canvas area is adjusted. Through the two-dimension code editing frame, a user can edit the target position of the target two-dimension code element control, so that the display position of the target two-dimension code in a preset canvas area is adjusted.
The target size is determined by two parameter values, the first parameter value representing the target width value and the second parameter value representing the target height value. The target position is determined by two parameters, wherein the first parameter represents a distance value of the upper left corner of the target two-dimensional code element control from the left boundary of the preset text region, and the second parameter represents a distance value of the upper left corner of the target two-dimensional code element control from the upper boundary of the preset text region. The display size is the display width and height of the target two-dimensional symbol element control in the preset canvas area. The display position is the position of the upper left corner coordinate of the target two-dimensional symbol element control in the preset canvas area.
Illustratively, assuming that the designated vertex of the target two-dimensional symbol element control is the vertex of the upper left corner, represented by (x 1, y 1), where x1 represents a distance value of the upper left corner of the target two-dimensional symbol element control from the left boundary of the preset text region, and y1 represents a distance value of the upper left corner of the target two-dimensional symbol element control from the upper boundary of the preset text region. The target size is represented by (w, h). Wherein w represents a width value of the target size, and h represents a height value of the target size. The four vertex coordinates of the target two-dimensional code element control are specifically expressed as an upper left corner (x 1, y 1), a lower left corner (x 1, y1+h), an upper right corner (x1+w) and a lower right corner (x1+w, y1+h) in the preset canvas area.
In an alternative embodiment, the method further comprises:
displaying a deleting icon on the target two-dimensional code;
and deleting the target two-dimensional code when the deleting operation is detected on the deleting icon.
The user can touch the target two-dimensional code for a preset time to trigger the display of the deletion icon on the target two-dimensional code. And displaying a deleting icon at the upper left corner of the target two-dimensional code. The delete icon may be a small trash can. When a user clicks or touches the delete icon, a delete operation is triggered to delete the target two-dimensional code displayed in the preset canvas area.
In an alternative embodiment, a confirmation delete dialog may be displayed to the user after the delete operation is detected to ensure that the user determines to delete the two-dimensional code, preventing accidental deletion. And if the user confirms the deletion, executing the deletion operation. After the deletion is successful, the user can be prompted to confirm the feedback information which is successfully deleted, and if the deletion is failed, the user is prompted to prompt the feedback information which is failed to delete.
In an alternative embodiment, the method further comprises:
and when a printing instruction is received, the target two-dimensional code is sent to a printer corresponding to the printer model selected by the user for printing.
And a printing operation icon is arranged on the text editing interface, and when a user clicks or touches the printing operation icon, a printing instruction is triggered, so that the printing operation of the target two-dimensional code is triggered.
After clicking or touching the print operation icon, the user may display a print setting interface, and select a printer model on the print setting interface. And receiving a printing instruction, and transmitting the target two-dimensional code to a printer corresponding to the selected printer model through a network. And the printer automatically performs printing operation after receiving the printing instruction of the target two-dimensional code.
According to the method, the target two-dimensional code element control selected by the user is displayed in the preset canvas area, after the user edits the preset text displayed in the target two-dimensional code element control, whether a first display area corresponding to the edited target text is matched with a second display area corresponding to the target two-dimensional code element control is judged, and when the first display area is matched with the second display area, the display of the target text is adjusted according to the second display area, so that a target two-dimensional code is generated according to the adjusted and displayed target text and the target two-dimensional code element control. According to the method and the device, text editing is carried out on the two-dimensional code element control with the preset text, the user-defined capability of a user is improved, the user can edit the text according to the requirement, and therefore the two-dimensional code which meets requirements better is generated. The method simplifies the process of generating the two-dimension code, and is convenient for users to more easily create personalized and effective two-dimension code. The method and the device can be widely applied, for example, in the fields of advertisements, business cards, product packages and the like, and a user can create the two-dimensional code containing personalized information without additional design or programming skills.
The embodiment of the application also provides a computer readable storage medium, on which a computer program is stored, the computer program being executed to implement all or part of the steps of the two-dimensional code generation method based on editing.
Fig. 2 is a schematic structural diagram of an electronic device according to an embodiment of the present application. In the preferred embodiment of the present application, the electronic device 2 comprises a memory 21, at least one processor 22, at least one communication bus 23.
It will be appreciated by those skilled in the art that the configuration of the electronic device shown in fig. 2 is not limiting of the embodiments of the present application, and that either a bus-type configuration or a star-type configuration may be used, and that the electronic device 2 may include more or less additional hardware or a different arrangement of components than illustrated.
In some embodiments, the electronic device 2 is a device capable of automatically performing numerical calculation and/or information processing according to preset or stored instructions, and its hardware includes, but is not limited to, a microprocessor, an application specific integrated circuit, a programmable gate array, a digital processor, an embedded device, and the like. The electronic device 2 may further include a client device, where the client device includes, but is not limited to, any electronic product that can interact with a client by way of a keyboard, a mouse, a remote control, a touch pad, or a voice-controlled device, such as a personal computer, a tablet, a smart phone, a digital camera, etc.
In some embodiments, the memory 21 stores a computer program that, when executed by the at least one processor 22, implements all or part of the steps in the editing-based two-dimensional code generation method as described. The Memory 21 includes Read-Only Memory (ROM), programmable Read-Only Memory (PROM), erasable programmable Read-Only Memory (EPROM), one-time programmable Read-Only Memory (One-time Programmable Read-Only Memory, OTPROM), electrically erasable rewritable Read-Only Memory (EEPROM), compact disc Read-Only Memory (Compact Disc Read-Only Memory, CD-ROM) or other optical disc Memory, magnetic tape Memory, or any other medium that can be used for computer-readable storage or carrying data. Further, the computer-readable storage medium mainly includes a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function, and the like.
In some embodiments, the at least one processor 22 is a Control Unit (Control Unit) of the electronic device 2, connects the various components of the entire electronic device 2 using various interfaces and lines, and performs various functions of the electronic device 2 and processes data by running or executing programs or modules stored in the memory 21, and invoking data stored in the memory 21. For example, the at least one processor 22 implements all or part of the steps of the editing-based two-dimensional code generation method described in the embodiments of the present application when executing the computer program stored in the memory; or all or part of functions of the two-dimensional code generation method based on editing are realized. The at least one processor 22 may be comprised of integrated circuits, such as a single packaged integrated circuit, or may be comprised of multiple integrated circuits packaged with the same or different functionality, including one or more central processing units (Central Processing Unit, CPU), microprocessors, digital processing chips, graphics processors, combinations of various control chips, and the like.
In some embodiments, the at least one communication bus 23 is arranged to enable connected communication between the memory 21 and the at least one processor 22 or the like. Although not shown, the electronic device 2 may further comprise a power source (such as a battery) for powering the various components, which may preferably be logically connected to the at least one processor 22 via a power management device, such that functions of managing charging, discharging, and power consumption are performed by the power management device. The power supply may also include one or more of any of a direct current or alternating current power supply, recharging device, power failure detection circuit, power converter or inverter, power status indicator, etc. The electronic device 2 may further include various sensors, bluetooth modules, wi-Fi modules, etc., which will not be described herein.
The integrated units implemented in the form of software functional modules described above may be stored in a computer readable storage medium. The software functional modules described above are stored in a storage medium that includes instructions for causing a processor (processor) to perform portions of the methods described in various embodiments of the present application.
In the several embodiments provided in this application, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the modules is merely a logical function division, and there may be other manners of division when actually implemented.
The modules described as separate components may or may not be physically separate, and components shown as modules may or may not be physical units, may be located in one place, or may be distributed over multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
The foregoing is merely specific embodiments of the present application, but the scope of the present application is not limited thereto, and any person skilled in the art can easily think about changes or substitutions within the technical scope of the present application, and the changes and substitutions are intended to be covered by the scope of the present application.

Claims (10)

1. The two-dimensional code generation method based on editing is characterized by comprising the following steps:
displaying a target two-dimensional code element control selected by a user in a preset canvas area, wherein preset text is displayed in the target two-dimensional code element control;
acquiring a target text obtained after the user edits based on the preset text;
judging whether a first display area corresponding to the target text is matched with a second display area corresponding to the target two-dimensional code element control;
when the first display area is not matched with the second display area, adjusting the display of the target text according to the second display area;
and generating a target two-dimensional code according to the target text after adjustment and display and the target two-dimensional code element control.
2. The method of claim 1, wherein the determining whether the first display area corresponding to the target text matches the second display area corresponding to the target two-dimensional symbol element control comprises:
acquiring a first width of a first display area corresponding to the target text;
acquiring a second width of a second display area corresponding to the target two-dimensional code element control;
judging whether the first width is larger than the second width;
when the first width is larger than the second width, determining that the first display area is not matched with the second display area;
and when the first width is smaller than or equal to the second width, determining that the first display area is matched with the second display area.
3. The method for generating two-dimensional code based on editing according to claim 2, wherein the obtaining the first width of the first display area corresponding to the target text comprises:
acquiring a character string in the target text;
acquiring the number of characters in the character string, the font size of each character and the font style;
calculating the width of each character according to the word size and the font;
and obtaining the first width according to the number of the characters, the width of each character and the width between the characters.
4. The editing-based two-dimensional code generation method according to claim 3, wherein the adjusting the display of the target text according to the second display area includes:
obtaining a target character number according to the second width of the second display area, the width of each character and the width between the characters;
determining a display text from the target text according to the target character number;
and displaying the display text.
5. The editing-based two-dimensional code generation method according to any one of claims 1 to 4, further comprising:
when the scaling operation is detected to be received on the target two-dimensional code, determining a scaling area corresponding to the scaling operation;
judging whether the zoom area is larger than the preset canvas area or not;
when the zoom area is larger than the preset canvas area, displaying area content corresponding to the preset canvas area in the target two-dimensional code;
and when the zoom area is smaller than or equal to the preset canvas area, performing zoom display on the target two-dimensional code according to the zoom area.
6. The editing-based two-dimensional code generation method according to claim 5, further comprising:
displaying a two-dimensional code editing interface, wherein a two-dimensional code editing frame is displayed in the two-dimensional code editing interface;
receiving the target size and/or the target position of the target two-dimensional code element control edited in the two-dimensional code editing frame;
and adjusting the display size of the target two-dimensional code according to the center of the target two-dimensional code element control and the target size, and/or adjusting the display position of the target two-dimensional code according to the designated vertex of the target two-dimensional code element control and the target position.
7. The editing-based two-dimensional code generation method according to claim 5, further comprising:
displaying a deleting icon on the target two-dimensional code;
and deleting the target two-dimensional code when the deleting operation is detected on the deleting icon.
8. The editing-based two-dimensional code generation method according to claim 5, further comprising:
and when a printing instruction is received, the target two-dimensional code is sent to a printer corresponding to the printer model selected by the user for printing.
9. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the steps of the edit-based two-dimensional code generation method according to any one of claims 1 to 8 when the computer program is executed.
10. A computer-readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the steps of the edit-based two-dimensional code generation method according to any one of claims 1 to 8.
CN202311692261.XA 2023-12-09 2023-12-09 Editing-based two-dimensional code generation method, electronic equipment and storage medium Pending CN117556856A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311692261.XA CN117556856A (en) 2023-12-09 2023-12-09 Editing-based two-dimensional code generation method, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311692261.XA CN117556856A (en) 2023-12-09 2023-12-09 Editing-based two-dimensional code generation method, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN117556856A true CN117556856A (en) 2024-02-13

Family

ID=89816711

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311692261.XA Pending CN117556856A (en) 2023-12-09 2023-12-09 Editing-based two-dimensional code generation method, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN117556856A (en)

Similar Documents

Publication Publication Date Title
JP4742132B2 (en) Input device, image processing program, and computer-readable recording medium
US7389475B2 (en) Method and apparatus for managing input focus and Z-order
EP1683075B1 (en) Boxed and lined input panel
CN107133615B (en) Information processing apparatus, information processing method, and computer program
US20150193387A1 (en) Cloud-based font service system
US11132122B2 (en) Handwriting input apparatus, handwriting input method, and non-transitory recording medium
JP7452155B2 (en) Handwriting input device, handwriting input method, program
JP2015158900A (en) Information processing device, information processing method and information processing program
CN112805664B (en) Input device, input method, program, and input system
CN112825022A (en) Display device, display method, and medium
CN115050038A (en) Information processing apparatus, information processing method, and storage medium
CN113655973A (en) Page segmentation method and device, electronic equipment and storage medium
CN117556856A (en) Editing-based two-dimensional code generation method, electronic equipment and storage medium
JP2005115907A (en) System, method and program for inputting handwritten information
US11430166B1 (en) Facilitating generation of number-bullet objects
US11588945B2 (en) Data input support apparatus that displays a window with an item value display area, an overview image display area, and an enlarged image display area
CN115188001A (en) Handwritten text recognition method and device, electronic equipment and storage medium
JP7543788B2 (en) Display device, input method, and program
CN115187986A (en) Text recognition method and device, electronic equipment and storage medium
CN115188003A (en) Model-based text recognition method and device, electronic equipment and storage medium
JP3085552B2 (en) Character input / cursor instruction determination method in online handwriting input device
KR101935926B1 (en) Server and method for webtoon editing
WO2020080300A1 (en) Input apparatus, input method, program, and input system
CN113378526A (en) PDF paragraph processing method, device, storage medium and equipment
JP4441966B2 (en) Handwritten character input device and recording medium recording program for realizing the same

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