Disclosure of Invention
The first purpose of the invention is to provide a driving method for realizing two-color printing on the two-color thermal paper.
A second object of the present invention is to provide a thermal printer that realizes the above-described two-color printing driving method.
A third object of the present invention is to provide a computer-readable storage medium storing a two-color print driving method.
In order to achieve the first object of the present invention, the present invention provides a two-color printing driving method including: receiving print data; converting the printing data to obtain image data; obtaining multi-frame driving pulse data of each pixel point in the current printing line according to the concentration value of each pixel point of the current printing line of the image data and the driving pulse sequence corresponding to the concentration value; the same-frame driving pulse data of each pixel point in the current printing line form a frame-by-frame heating signal, and the frame-by-frame heating signals are sequentially sent to the corresponding line heating elements according to the sequence.
Further, the concentration value is divided into 10 grades, and the concentration value comprises a concentration 1, a concentration 2 … and a concentration 10 from shallow to deep; the driving pulse sequence corresponding to the concentration value is as follows: concentration 1: 1000000000; degree 2: 1100000000; concentration 3: 1110000000, respectively; concentration 4: 1111000000, respectively; concentration 5: 1111100000, respectively; concentration 6: 1111110000, respectively; concentration 7: 1111111000, respectively; concentration 8: 1111111100, respectively; concentration 9: 1111111110, respectively; concentration 10: 1111111111.
further, the print data includes color information including red information and black information.
In order to achieve the second object of the present invention, the present invention provides a thermal printer including a processor, the thermal printer being configured to implement the steps of the two-color print driving method as described above when executing a computer program stored in a memory.
In order to achieve the third object of the present invention, the present invention provides a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements the steps of the two-color print driving method as in the above-described aspect.
The invention has the advantages that when the heating element is driven to generate heat according to the image data of red and black, 10 density levels from light red to black need to be distinguished when each point of the current line is printed, the heating element is driven through the multi-frame heating signal of the current line, the multi-section heating time of the heating element is effectively controlled, the printing effect is gradually changed from light red to black along with the increasing of the heating time of each point, and therefore, images of a plurality of density levels from light red to black are printed, and effective two-color printing control is realized.
Detailed Description
Referring to fig. 1 to 5, the two-color printing driving method of the present disclosure is applied to a thermal printer, and mainly performs two-color printing on additive thermal paper, where the color is a first color when the applied heat is low, and the color is a second color when the applied heat is high, and for example, red and black thermal paper is used.
When the two-color print driving method is executed, step S11 is first executed to receive print data including font information, pattern information, and color information, for which color information includes red information, black information, gradation information, and the like. In the editing stage, the color of the font or the pattern can be set, namely black, red and the shade degree thereof can be set.
Subsequently, step S12 is executed, image data is obtained by converting the print data, the image data is a dot diagram obtained by converting the print data, each line has 11 pixels as an example, the present application is described as follows, according to a density value of each pixel of a current print line of the image data and a driving pulse sequence (as shown in fig. 3) corresponding to the density value, that is, the density value is divided into 10 levels, which include, from light to deep, density 1, density 2 … to density 10, the corresponding density value is heated and driven by a 10-frame heating signal, and the driving pulse sequence corresponding to the density value is as follows:
concentration 1: 1000000000;
concentration 2: 1100000000;
concentration 3: 1110000000, respectively;
concentration 4: 1111000000, respectively;
concentration 5: 1111100000, respectively;
concentration 6: 1111110000, respectively;
concentration 7: 1111111000, respectively;
concentration 8: 1111111100, respectively;
concentration 9: 1111111110, respectively;
concentration 10: 1111111111.
and then obtaining multi-frame driving pulse data of each pixel point in the current printing line.
Then step S13 is executed, the same-frame driving pulse data of each pixel point in the current printing line forms a frame-by-frame heating signal, taking fig. 2 as an example of a target printing pattern, the pattern has 11 pixel points, starting from left to right, the first and second pixel points are black with the density of 10, the hexadecimal color code thereof is #231915, the tenth pixel point is light red with the density of 2, the hexadecimal color code thereof is # ef8575, the eleventh pixel point is light red with the density of 1, the hexadecimal color code thereof is # f3bbb2, the frame-by-frame heating signal is heated by a 10-frame heating on-off signal, so that when a row of heating elements are driven, the 10-frame-by-frame heating signals are respectively the 1-frame data1 "11111111111111111", the 2-frame data2 "11111111110", the 3-frame 3 "11111111111111111111111111100", the 4-frame data4 "11111111000", the 5-frame data5 "11111110000", the 6-frame data6 "11100000000", the 7378 "11100000000",23 ", the 10 th frame data10 "11000000000" takes the drive of the 5 th frame data5 "11111110000" as an example, and from left to right, the 1 st to 7 th heat generating elements generate heat by being driven by "1", and the 8 th to 11 th heat generating elements do not generate heat by being driven by "0".
And finally, executing a step 14, and sequentially sending frame-by-frame heating signals to the heating elements in the corresponding row according to the sequence, referring to fig. 4 and 5, wherein EN is a thermal printing head enabling signal, CLK is fully called CLOCK input signal, DAT is fully called DATA image DATA input signal, LAT is fully called LATCH register LATCH signal, and STB is fully called STROBE frame-by-frame heating signal. The printer main control chip sends an EN enabling signal to enable the thermal printing head, then each CLK clock signal sends one bit of DAT image data until one frame of image data of the current line is sent, the LAT register latches the image data at a low level, and finally, a heating signal of the STB heating body is sent to the thermal printing head, and the low level is effective.
Finally, as shown in fig. 2, the leftmost two dots are heated 10 times, the density is 10 levels, and the dots are black, and the rightmost one dot is heated only once, the density is 1 level, and the dots are light red. Of course, in addition to the embodiment, other additive color type thermal paper may be adopted, and the driving method of the present embodiment may be adopted for both blue-black and yellow-black printing. And in the actual application of the thermal sheet, the 58-type thermal sheet is generally used, the width of a printing line is 48MM, and 8 heating elements are generally arranged in 1MM, so that a plurality of heating points are arranged in one line during actual printing, and the heating elements in the same line are driven simultaneously during driving. And the driving pulse sequence corresponding to the concentration can be various, or different frame numbers are adopted for driving and heating.
The thermal printer includes a processor for implementing the steps of the two-color print driving method according to the above-described aspect when executing a computer program stored in a memory.
A computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements the steps of the two-color print driving method according to the above-described aspect.