[go: up one dir, main page]

CN114089931B - Picture printing method, electronic device and computer-readable storage medium - Google Patents

Picture printing method, electronic device and computer-readable storage medium Download PDF

Info

Publication number
CN114089931B
CN114089931B CN202210080529.3A CN202210080529A CN114089931B CN 114089931 B CN114089931 B CN 114089931B CN 202210080529 A CN202210080529 A CN 202210080529A CN 114089931 B CN114089931 B CN 114089931B
Authority
CN
China
Prior art keywords
picture
printed
printing
template
print
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202210080529.3A
Other languages
Chinese (zh)
Other versions
CN114089931A (en
Inventor
杨裕伟
聂旭
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Honor Device Co Ltd
Original Assignee
Honor Device 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 Honor Device Co Ltd filed Critical Honor Device Co Ltd
Priority to CN202210637023.8A priority Critical patent/CN116521101A/en
Priority to CN202210080529.3A priority patent/CN114089931B/en
Publication of CN114089931A publication Critical patent/CN114089931A/en
Application granted granted Critical
Publication of CN114089931B publication Critical patent/CN114089931B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/12Digital output to print unit, e.g. line printer, chain printer
    • G06F3/1201Dedicated interfaces to print systems
    • G06F3/1223Dedicated interfaces to print systems specifically adapted to use a particular technique
    • G06F3/1237Print job management
    • G06F3/1253Configuration of print job parameters, e.g. using UI at the client
    • G06F3/1257Configuration of print job parameters, e.g. using UI at the client by using pre-stored settings, e.g. job templates, presets, print styles
    • 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/12Digital output to print unit, e.g. line printer, chain printer
    • G06F3/1201Dedicated interfaces to print systems
    • G06F3/1223Dedicated interfaces to print systems specifically adapted to use a particular technique
    • G06F3/1237Print job management
    • G06F3/1253Configuration of print job parameters, e.g. using UI at the client

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Editing Of Facsimile Originals (AREA)

Abstract

本申请属于终端技术领域,提供一种图片打印方法、电子设备及计算机可读存储介质。图片打印方法包括:检测指示打印待打印图片的第一操作,响应于第一操作,从一个或多个打印模板中确定待打印图片对应的目标打印模板,采用目标打印模板对应的图片处理参数处理待打印图片,得到处理后的待打印图片;向打印机发送处理后的待打印图片以及目标打印模板对应的打印机参数。由于每个打印模板都对应一组打印参数,因此使用该方法打印图片时可以避免用户输入打印参数,相对于选择打印参数,选择打印模板可以降低由于参数输入错误导致的打印失败以及打印效果差的问题。

Figure 202210080529

The present application belongs to the technical field of terminals, and provides a picture printing method, an electronic device and a computer-readable storage medium. The picture printing method includes: detecting a first operation instructing to print a picture to be printed; in response to the first operation, determining a target printing template corresponding to the to-be-printed picture from one or more printing templates, and using the picture processing parameters corresponding to the target printing template to process The picture to be printed is obtained, and the processed picture to be printed is obtained; the processed picture to be printed and the printer parameters corresponding to the target printing template are sent to the printer. Since each print template corresponds to a set of print parameters, the user can avoid inputting print parameters when printing pictures using this method. Compared with selecting print parameters, selecting print templates can reduce printing failures and poor print effects caused by incorrect parameter input. question.

Figure 202210080529

Description

图片打印方法、电子设备及计算机可读存储介质Image printing method, electronic device and computer-readable storage medium

技术领域technical field

本申请涉及终端技术领域,尤其涉及一种图片打印方法、电子设备及计算机可读存储介质。The present application relates to the field of terminal technologies, and in particular, to a picture printing method, an electronic device, and a computer-readable storage medium.

背景技术Background technique

现有的手机、平板等电子设备的打印功能中,供用户设置的打印参数较少,因此打印功能简单,无法满足用户的打印需求。这种现象的主要原因是,若为用户提供配置打印参数的权限,会出现打印参数配置错误的情况,从而造成打印效果不佳,甚至打印出错的情况。例如,根据用户配置的打印参数进行打印会造成图片打印效果差、照片打印质量低、打印机异常停止等情况的发生。In the printing functions of existing electronic devices such as mobile phones and tablets, there are few printing parameters for users to set, so the printing functions are simple and cannot meet the printing needs of users. The main reason for this phenomenon is that if the user is provided with the authority to configure printing parameters, there will be a situation in which the printing parameters are configured incorrectly, resulting in poor printing results or even printing errors. For example, printing according to the printing parameters configured by the user may result in poor picture printing effect, low photo printing quality, and abnormal stop of the printer.

发明内容SUMMARY OF THE INVENTION

本申请提供一种图片打印方法、电子设备及计算机可读存储介质,解决了现有技术中由用户进行打印参数的配置所造成的打印效果差、打印出错的问题。The present application provides a picture printing method, an electronic device and a computer-readable storage medium, which solve the problems of poor printing effect and printing errors caused by the configuration of printing parameters by users in the prior art.

本申请采用如下技术方案:This application adopts the following technical solutions:

第一方面,提供一种图片打印方法,应用于电子设备,所述电子设备中具有一个或多个打印模板,一个打印模板对应一组打印参数,打印参数包括打印机参数以及图片处理参数,所述方法包括:In a first aspect, a picture printing method is provided, which is applied to an electronic device, wherein the electronic device has one or more printing templates, one printing template corresponds to a set of printing parameters, and the printing parameters include printer parameters and picture processing parameters. Methods include:

检测指示打印待打印图片的第一操作;响应于所述第一操作,从一个或多个所述打印模板中确定所述待打印图片对应的目标打印模板;采用所述目标打印模板对应的所述图片处理参数处理所述待打印图片,得到处理后的待打印图片;向所述打印机发送所述处理后的待打印图片以及所述目标打印模板对应的所述打印机参数。Detecting a first operation instructing to print a picture to be printed; in response to the first operation, determining a target printing template corresponding to the to-be-printed picture from one or more of the printing templates; using the target printing template corresponding to the target printing template The picture to be printed is processed with the picture processing parameters to obtain the processed picture to be printed; the processed picture to be printed and the printer parameters corresponding to the target printing template are sent to the printer.

上述实施例中,在检测到指示打印待打印图片的第一操作的情况下,电子设备先确定打印该待打印图片时采用的目标打印模板,基于目标打印模板对应的打印参数对待打印图片进行处理,之后打印机根据打印机参数对待打印图片进行打印。由于每个打印模板都对应一组打印参数,因此使用该方法打印图片时可以避免用户输入打印参数,相对于选择打印参数,选择打印模板可以降低由于参数选择错误导致的打印失败以及打印效果差的问题。In the above embodiment, in the case of detecting the first operation instructing to print the picture to be printed, the electronic device first determines the target printing template used when printing the picture to be printed, and processes the picture to be printed based on the printing parameters corresponding to the target printing template. , and then the printer prints the picture to be printed according to the printer parameters. Since each printing template corresponds to a set of printing parameters, the user can avoid inputting printing parameters when printing pictures by using this method. Compared with selecting printing parameters, selecting a printing template can reduce printing failures and poor printing effects caused by incorrect parameter selection. question.

在一种可能的实现方式中,所述从一个或多个所述打印模板中确定所述待打印图片对应的目标打印模板,包括:根据所述待打印图片的数量以及特征,从一个或多个所述打印模板中确定所述待打印图片对应的所述目标打印模板,所述待打印图片的特征包括所述待打印图片的尺寸、像素、内容、分辨率中的一项或多项。In a possible implementation manner, the determining a target printing template corresponding to the to-be-printed picture from one or more of the printing templates includes: according to the number and characteristics of the to-be-printed pictures, selecting one or more The target printing template corresponding to the picture to be printed is determined from the printing templates, and the characteristics of the picture to be printed include one or more of the size, pixel, content, and resolution of the picture to be printed.

根据待打印图片的数量以及特征确定目标打印模板,可以得到与待打印图片的匹配度更好的目标打印模板,也即得到与待打印图片的匹配度更好的打印参数,之后再根据目标打印模板对应的打印参数对待打印图片进行处理和打印,可以得到更好的打印效果。The target printing template is determined according to the number and characteristics of the pictures to be printed, and the target printing template with a better match with the picture to be printed can be obtained, that is, the printing parameters with a better match with the picture to be printed can be obtained, and then print according to the target The printing parameters corresponding to the template are processed and printed on the picture to be printed, and a better printing effect can be obtained.

在一种可能的实现方式中,一个或多个所述打印模板包括大图打印模板,根据所述待打印图片的数量以及特征,从一个或多个打印模板中确定所述待打印图片对应的目标打印模板,包括:若所述待打印图片的数量为1,所述待打印图片的像素大于第一预设像素,所述待打印图片的宽度和高度的比值在第一预设范围内,所述待打印图片的分辨率大于或者等于第一预设分辨率,则确定所述目标打印模板为所述大图打印模板,所述大图打印模板用于根据裁剪数量对所述待打印图片进行裁剪,得到与所述待打印图片对应的至少两张子图。在图片尺寸较大,且分辨率满足要求时,将一张图打印为多张子图,可以减少在打印过程中丢失的图片细节,提高打印效果。In a possible implementation manner, one or more of the printing templates includes a large-scale printing template, and according to the number and characteristics of the to-be-printed pictures, the one or more printing templates corresponding to the to-be-printed pictures are determined. The target printing template includes: if the number of the pictures to be printed is 1, the pixels of the pictures to be printed are larger than the first preset pixels, and the ratio of the width to the height of the pictures to be printed is within the first preset range, The resolution of the picture to be printed is greater than or equal to the first preset resolution, and the target printing template is determined to be the large-picture printing template, and the large-picture printing template is used for the picture to be printed according to the number of cuts. Cropping is performed to obtain at least two sub-pictures corresponding to the picture to be printed. When the picture size is large and the resolution meets the requirements, printing a picture as multiple sub-pictures can reduce the picture details lost during the printing process and improve the printing effect.

在一种可能的实现方式中,一个或多个所述打印模板包括长图打印模板,根据所述待打印图片的数量以及特征,从一个或多个打印模板中确定所述待打印图片对应的目标打印模板,包括:若所述待打印图片的数量为1,所述待打印图片的尺寸与所述电子设备的屏幕的尺寸满足预设关系,则确定所述目标打印模板为所述长图打印模板,所述长图打印模板用于在长度方向上对所述待打印图片进行裁剪,得到与所述待打印图片对应的至少两张子图,从而可以提高打印后的图片的清晰度,提高打印效果。In a possible implementation manner, one or more of the printing templates includes a long-image printing template, and according to the number and characteristics of the to-be-printed pictures, the corresponding to the to-be-printed picture is determined from the one or more printing templates A target printing template, comprising: if the number of the pictures to be printed is 1 and the size of the picture to be printed and the size of the screen of the electronic device satisfy a preset relationship, then determining that the target printing template is the long picture A printing template, the long picture printing template is used to cut the picture to be printed in the length direction to obtain at least two sub-pictures corresponding to the picture to be printed, so that the clarity of the printed picture can be improved, and the printing process can be improved. Effect.

在一种可能的实现方式中,一个或多个所述打印模板包括寸照打印模板,根据所述待打印图片的数量以及特征,从一个或多个打印模板中确定所述待打印图片对应的目标打印模板,包括:若所述待打印图片的数量为1,所述待打印图片的内容和背景满足预设条件,则确定目标打印模板为寸照打印模板,所述寸照打印模板用于将多张待打印图片绘制于一张图片上,从而可以在一张照片纸上打印多个寸照。In a possible implementation manner, one or more of the printing templates include an inch photo printing template, and according to the number and characteristics of the to-be-printed pictures, the corresponding to the to-be-printed picture is determined from the one or more printing templates A target printing template, comprising: if the number of the pictures to be printed is 1, and the content and background of the pictures to be printed meet preset conditions, then determining that the target printing template is an inch photo printing template, and the inch photo printing template is used for Draw multiple pictures to be printed on one picture, so that you can print multiple inch photos on one photo paper.

在一种可能的实现方式中,一个或多个所述打印模板包括拼图打印模板,根据所述待打印图片的数量以及特征,从一个或多个打印模板中确定所述待打印图片对应的目标打印模板,包括:若所述待打印图片的数量大于1,所述待打印图片的像素大于第二预设像素,所述待打印图片的宽度和高度的比值在第二预设范围内,所述待打印图片的分辨率大于或者等于第二预设分辨率,则确定目标打印模板为拼图打印模板,所述拼图打印模板用于拼接所述待打印图片,得到拼接后的图片,从而可以根据图片数量自动拼接图像,减少操作步骤,提高用户体验。In a possible implementation manner, one or more of the print templates include a puzzle print template, and according to the number and characteristics of the to-be-printed pictures, the target corresponding to the to-be-printed picture is determined from the one or more print templates The printing template includes: if the number of pictures to be printed is greater than 1, the pixels of the picture to be printed are greater than the second preset pixel, the ratio of the width to the height of the picture to be printed is within the second preset range, and the The resolution of the picture to be printed is greater than or equal to the second preset resolution, then it is determined that the target printing template is a puzzle printing template, and the puzzle printing template is used for splicing the pictures to be printed to obtain a spliced picture, which can be The number of pictures is automatically stitched into images, reducing operation steps and improving user experience.

在一种可能的实现方式中,所述图片处理参数包括纸张尺寸、色彩、填充方式、缩放比例、排布方式中的任意一项或多项,所述打印机参数包括纸张类型以及打印质量。In a possible implementation manner, the image processing parameters include any one or more of paper size, color, filling mode, scaling ratio, and arrangement mode, and the printer parameters include paper type and print quality.

在一种可能的实现方式中,在确定满足模板匹配的条件的情况下,响应于所述第一操作,从一个或多个所述打印模板中确定所述待打印图片对应的所述目标打印模板。即在满足模板匹配的条件的情况下,才进行打印模板的匹配,避免在不需要进行打印模板匹配的情况下给用户提供干扰信息。In a possible implementation manner, when it is determined that the template matching condition is satisfied, in response to the first operation, the target printing corresponding to the picture to be printed is determined from one or more of the printing templates template. That is, only when the template matching conditions are met, the printing template matching is performed, so as to avoid providing interference information to the user when the printing template matching does not need to be performed.

在一种可能的实现方式中,所述方法还包括:在不满足模板匹配的条件的情况下,显示一个或多个所述打印模板;检测针对所述一个或多个打印模板的第二操作;将所述第二操作所选择的所述打印模板作为所述目标打印模板,从而可以根据用户的选择信息确定打印模板,满足用户实际打印需求。In a possible implementation manner, the method further includes: displaying one or more of the print templates if the conditions for template matching are not satisfied; and detecting a second operation for the one or more print templates ; Use the print template selected by the second operation as the target print template, so that the print template can be determined according to the user's selection information to meet the user's actual printing needs.

在一种可能的实现方式中,所述方法还包括:若未检测到所述第二操作,则确定满足模板匹配的条件。In a possible implementation manner, the method further includes: if the second operation is not detected, determining that a template matching condition is satisfied.

在一种可能的实现方式中,在响应于所述第一操作,从一个或多个所述打印模板中确定所述待打印图片对应的所述目标打印模板之后,所述方法还包括:In a possible implementation manner, after determining the target print template corresponding to the to-be-printed picture from one or more of the print templates in response to the first operation, the method further includes:

输出所述目标打印模板对应的打印参数;检测针对所述目标打印模板对应的打印参数的修改操作;在所述修改操作指示修改所述目标打印模板对应的所述图片处理参数的情况下,所述采用所述目标打印模板对应的所述图片处理参数处理所述待打印图片,得到处理后的待打印图片,包括:采用所述目标打印模板对应的修改后的图片处理参数处理所述待打印图片,得到处理后的待打印图片;在所述修改操作指示修改所述目标打印模板对应的所述打印机参数的情况下,所述向所述打印机发送所述处理后的待打印图片以及所述目标打印模板对应的所述打印机参数,包括:向所述打印机发送所述处理后的待打印图片,以及所述目标打印模板对应的修改后的打印机参数。outputting the printing parameters corresponding to the target printing template; detecting a modification operation for the printing parameters corresponding to the target printing template; in the case that the modification operation instructs to modify the picture processing parameters corresponding to the target printing template, the The processing of the to-be-printed picture by using the picture processing parameters corresponding to the target printing template to obtain the processed to-be-printed picture includes: processing the to-be-printed picture by using the modified picture processing parameters corresponding to the target printing template pictures to obtain the processed pictures to be printed; in the case that the modification operation instructs to modify the printer parameters corresponding to the target printing template, the process of sending the processed pictures to be printed and the The printer parameters corresponding to the target printing template include: sending the processed picture to be printed to the printer, and the modified printer parameters corresponding to the target printing template.

通过修改目标打印模板的打印参数,可以为用户提供更多的图片处理方式以及打印方式,从而满足用户多种打印需求。By modifying the printing parameters of the target printing template, the user can be provided with more image processing methods and printing methods, so as to meet the various printing needs of the user.

第二方面,提供一种图片打印装置,应用于电子设备,所述电子设备中具有一个或多个打印模板,一个打印模板对应一组打印参数,打印参数包括打印机参数以及图片处理参数,所述装置包括:In a second aspect, a picture printing device is provided, which is applied to an electronic device, wherein the electronic device has one or more printing templates, one printing template corresponds to a group of printing parameters, and the printing parameters include printer parameters and picture processing parameters, and the The device includes:

检测模块,用于检测指示打印待打印图片的第一操作;a detection module for detecting a first operation instructing to print a picture to be printed;

确定模块,用于响应于所述第一操作,从一个或多个所述打印模板中确定所述待打印图片对应的目标打印模板;a determining module, configured to determine, in response to the first operation, a target print template corresponding to the to-be-printed picture from one or more of the print templates;

处理模块,用于采用所述目标打印模板对应的所述图片处理参数处理所述待打印图片,得到处理后的待打印图片;a processing module, configured to process the picture to be printed by using the picture processing parameter corresponding to the target printing template to obtain a processed picture to be printed;

发送模块,用于向所述打印机发送所述处理后的待打印图片以及所述目标打印模板对应的所述打印机参数。A sending module, configured to send the processed picture to be printed and the printer parameters corresponding to the target printing template to the printer.

在一种可能的实现方式中,确定模块具体用于:In a possible implementation, the determination module is specifically used to:

根据所述待打印图片的数量以及特征,从一个或多个所述打印模板中确定所述待打印图片对应的所述目标打印模板,所述待打印图片的特征包括所述待打印图片的尺寸、像素、内容、分辨率中的一项或多项。According to the number and characteristics of the pictures to be printed, the target printing template corresponding to the picture to be printed is determined from one or more of the printing templates, and the characteristics of the picture to be printed include the size of the picture to be printed , one or more of pixels, content, resolution.

在一种可能的实现方式中,一个或多个所述打印模板包括大图打印模板,确定模块具体用于:In a possible implementation manner, one or more of the printing templates includes a large-picture printing template, and the determining module is specifically used for:

若所述待打印图片的数量为1,所述待打印图片的像素大于第一预设像素,所述待打印图片的宽度和高度的比值在第一预设范围内,所述待打印图片的分辨率大于或者等于第一预设分辨率,则确定所述目标打印模板为所述大图打印模板,所述大图打印模板用于根据裁剪数量对所述待打印图片进行裁剪,得到与所述待打印图片对应的至少两张子图。If the number of the to-be-printed pictures is 1, the pixels of the to-be-printed picture are larger than the first preset pixel, the ratio of the width to the height of the to-be-printed picture is within the first preset range, the The resolution is greater than or equal to the first preset resolution, then the target printing template is determined to be the large-image printing template, and the large-image printing template is used to trim the to-be-printed picture according to the trimming quantity, and obtain the at least two sub-images corresponding to the picture to be printed.

在一种可能的实现方式中,一个或多个所述打印模板包括长图打印模板,确定模块具体用于:In a possible implementation, one or more of the printing templates include a long-image printing template, and the determining module is specifically used for:

若所述待打印图片的数量为1,所述待打印图片的尺寸与所述电子设备的屏幕的尺寸满足预设关系,则确定所述目标打印模板为所述长图打印模板,所述长图打印模板用于在长度方向上对所述待打印图片进行裁剪,得到与所述待打印图片对应的至少两张子图。If the number of the to-be-printed pictures is 1, and the size of the to-be-printed picture and the size of the screen of the electronic device satisfy a preset relationship, the target printing template is determined to be the long-picture printing template, and the long-picture printing template is determined. The image printing template is used for cropping the to-be-printed image in the length direction to obtain at least two sub-images corresponding to the to-be-printed image.

在一种可能的实现方式中,一个或多个所述打印模板包括寸照打印模板,确定模块具体用于:In a possible implementation, one or more of the printing templates include an inch photo printing template, and the determining module is specifically used for:

若所述待打印图片的数量为1,所述待打印图片的内容和背景满足预设条件,则确定目标打印模板为寸照打印模板,所述寸照打印模板用于将多张待打印图片绘制于一张图片上。If the number of the to-be-printed pictures is 1, and the content and background of the to-be-printed pictures satisfy the preset conditions, the target printing template is determined to be an inch-photo printing template, and the inch-photo printing template is used to convert multiple pictures to be printed. Draw on a picture.

在一种可能的实现方式中,一个或多个所述打印模板包括拼图打印模板,确定模块具体用于:In a possible implementation manner, one or more of the printing templates include a collage printing template, and the determining module is specifically used for:

若所述待打印图片的数量大于1,所述待打印图片的像素大于第二预设像素,所述待打印图片的宽度和高度的比值在第二预设范围内,所述待打印图片的分辨率大于或者等于第二预设分辨率,则确定目标打印模板为拼图打印模板,所述拼图打印模板用于拼接所述待打印图片,得到拼接后的图片。If the number of the to-be-printed pictures is greater than 1, the pixels of the to-be-printed picture are greater than the second preset pixel, the ratio of the width to the height of the to-be-printed picture is within the second preset range, and the If the resolution is greater than or equal to the second preset resolution, it is determined that the target printing template is a mosaic printing template, and the mosaic printing template is used for splicing the to-be-printed pictures to obtain a spliced picture.

在一种可能的实现方式中,所述图片处理参数包括纸张尺寸、色彩、填充方式、缩放比例、排布方式中的任意一项或多项,所述打印机参数包括纸张类型以及打印质量。In a possible implementation manner, the image processing parameters include any one or more of paper size, color, filling mode, scaling ratio, and arrangement mode, and the printer parameters include paper type and print quality.

在一种可能的实现方式中,确定模块具体用于:在确定满足模板匹配的条件的情况下,响应于所述第一操作,从一个或多个所述打印模板中确定所述待打印图片对应的所述目标打印模板。In a possible implementation manner, the determining module is specifically configured to: in the case of determining that the template matching condition is satisfied, in response to the first operation, determine the to-be-printed picture from one or more of the printing templates corresponding to the target print template.

在一种可能的实现方式中,确定模块还用于:In one possible implementation, the determination module is also used to:

在不满足模板匹配的条件的情况下,显示一个或多个所述打印模板;Displaying one or more of the print templates if the conditions for template matching are not met;

检测针对所述一个或多个打印模板的第二操作;detecting a second operation for the one or more print templates;

将所述第二操作所选择的所述打印模板作为所述目标打印模板。The print template selected by the second operation is used as the target print template.

在一种可能的实现方式中,确定模块还用于:In one possible implementation, the determination module is also used to:

若未检测到所述第二操作,则确定满足模板匹配的条件。If the second operation is not detected, it is determined that the template matching condition is satisfied.

在一种可能的实现方式中,确定模块还用于:In one possible implementation, the determination module is also used to:

输出所述目标打印模板对应的打印参数;outputting printing parameters corresponding to the target printing template;

检测针对所述目标打印模板对应的打印参数的修改操作;Detecting a modification operation of the printing parameters corresponding to the target printing template;

在所述修改操作指示修改所述目标打印模板对应的所述图片处理参数的情况下,所述处理模块具体用于:When the modification operation instructs to modify the picture processing parameter corresponding to the target printing template, the processing module is specifically configured to:

采用所述目标打印模板对应的修改后的图片处理参数处理所述待打印图片,得到处理后的待打印图片;Use the modified picture processing parameters corresponding to the target printing template to process the to-be-printed picture to obtain the processed to-be-printed picture;

在所述修改操作指示修改所述目标打印模板对应的所述打印机参数的情况下,所述发送模块具体用于:When the modification operation instructs to modify the printer parameter corresponding to the target printing template, the sending module is specifically configured to:

向所述打印机发送所述处理后的待打印图片,以及所述目标打印模板对应的修改后的打印机参数。Send the processed picture to be printed and the modified printer parameters corresponding to the target printing template to the printer.

第三方面,提供一种电子设备,包括处理器,所述处理器用于执行存储在存储器中的计算机程序,以实现上述第一方面所述的图片打印方法。In a third aspect, an electronic device is provided, including a processor, where the processor is configured to execute a computer program stored in a memory, so as to implement the image printing method described in the first aspect.

第四方面,提供一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,所述计算机程序被处理器执行时实现上述第一方面所述的图片打印方法。In a fourth aspect, a computer-readable storage medium is provided, the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the image printing method described in the first aspect above is implemented.

第五方面,提供一种芯片,所述芯片包括处理器,所述处理器和存储器耦合,所述处理器执行所述存储器中存储的计算机程序或指令,以实现上述第一方面所述的图片打印方法。In a fifth aspect, a chip is provided, the chip includes a processor, the processor is coupled to a memory, and the processor executes a computer program or instruction stored in the memory, so as to realize the picture described in the first aspect above print method.

第六方面,提供一种计算机程序产品,当计算机程序产品在电子设备上运行时,使得电子设备执行上述第一方面所述的图片打印方法。In a sixth aspect, a computer program product is provided, when the computer program product is run on an electronic device, the electronic device is made to execute the picture printing method described in the first aspect.

可以理解的是,上述第二方面至第六方面的有益效果可以参见上述第一方面中的相关描述,在此不再赘述。It can be understood that, for the beneficial effects of the foregoing second aspect to the sixth aspect, reference may be made to the relevant descriptions in the foregoing first aspect, and details are not described herein again.

附图说明Description of drawings

图1A至图1F为本申请一实施例提供的大图打印场景下的用户界面示意图;1A to 1F are schematic diagrams of user interfaces in a large image printing scenario provided by an embodiment of the present application;

图2A和图2B是本申请一实施例提供的大图打印场景下进行参数设置的用户界面示意图;2A and 2B are schematic diagrams of user interfaces for parameter setting in a large-picture printing scenario provided by an embodiment of the present application;

图3A至图3D为本申请一实施例提供的长图打印场景下的用户界面示意图;3A to 3D are schematic diagrams of user interfaces in a long image printing scenario provided by an embodiment of the present application;

图4A至图4D为本申请一实施例提供的寸照打印场景下的用户界面示意图;4A to 4D are schematic diagrams of user interfaces in an inch photo printing scenario provided by an embodiment of the present application;

图5A至图5D为本申请一实施例提供的风景图打印场景下的用户界面示意图;5A to 5D are schematic diagrams of user interfaces in a landscape image printing scenario provided by an embodiment of the present application;

图6A至图6D为本申请一实施例提供的照片打印场景下的用户界面示意图;6A to 6D are schematic diagrams of user interfaces in a photo printing scenario provided by an embodiment of the present application;

图7A至图7C为本申请一实施例提供的身份证打印场景下的用户界面示意图;7A to 7C are schematic diagrams of user interfaces in an ID card printing scenario provided by an embodiment of the present application;

图8A至图8C为本申请一实施例提供的拼图打印场景下的用户界面示意图;8A to 8C are schematic diagrams of user interfaces in a puzzle printing scenario provided by an embodiment of the present application;

图9A至图9D为本申请另一实施例提供的打开打印界面过程中的用户界面示意图;9A to 9D are schematic diagrams of user interfaces in the process of opening a printing interface according to another embodiment of the present application;

图10A至图10E为本申请又一实施例提供的打开打印界面过程中的用户界面示意图;10A to 10E are schematic diagrams of user interfaces in the process of opening a print interface provided by yet another embodiment of the present application;

图11为本申请另一实施例提供的功能预览界面的示意图;11 is a schematic diagram of a function preview interface provided by another embodiment of the present application;

图12A至图12D为本申请另一实施例提供的大图打印场景下的用户界面示意图;12A to 12D are schematic diagrams of user interfaces in a large-picture printing scenario provided by another embodiment of the present application;

图13A至图13D为本申请另一实施例提供的长图打印场景下的用户界面示意图;13A to 13D are schematic diagrams of user interfaces in a long image printing scenario provided by another embodiment of the present application;

图14A至图14D为本申请另一实施例提供的照片打印场景下的用户界面示意图;14A to 14D are schematic diagrams of user interfaces in a photo printing scenario provided by another embodiment of the present application;

图15A至图15D为本申请另一实施例提供的风景图打印场景下的用户界面示意图;15A to 15D are schematic diagrams of user interfaces in a landscape image printing scenario provided by another embodiment of the present application;

图16A至图16E为本申请另一实施例提供的寸照打印场景下的用户界面示意图;16A to FIG. 16E are schematic diagrams of user interfaces in a inch photo printing scenario provided by another embodiment of the present application;

图17A至图17G为本申请另一实施例提供的身份证打印场景下的用户界面示意图;17A to 17G are schematic diagrams of user interfaces in an ID card printing scenario provided by another embodiment of the present application;

图18A至图18E为本申请另一实施例提供的拼图打印场景下的用户界面示意图;18A to 18E are schematic diagrams of user interfaces in a puzzle printing scenario provided by another embodiment of the present application;

图19A至图19F为本申请一实施例提供的区域打印场景下的用户界面示意图;19A to 19F are schematic diagrams of user interfaces in an area printing scenario provided by an embodiment of the present application;

图20为本申请一实施例提供的图片打印方法的流程示意图;20 is a schematic flowchart of a picture printing method provided by an embodiment of the present application;

图21为本申请一实施例提供的确定目标打印模板的流程图;21 is a flowchart of determining a target print template provided by an embodiment of the present application;

图22为本申请实施例提供的电子设备的软件架构图;22 is a software architecture diagram of an electronic device provided by an embodiment of the present application;

图23为本申请实施例提供的电子设备的结构示意图。FIG. 23 is a schematic structural diagram of an electronic device provided by an embodiment of the present application.

具体实施方式Detailed ways

以下描述中,为了说明而不是为了限定,提出了诸如特定系统结构、技术之类的具体细节,以便透彻理解本申请实施例。然而,本领域的技术人员应当清楚,在没有这些具体细节的其它实施例中也可以实现本申请。在其它情况中,省略对众所周知的系统、装置、电路以及方法的详细说明,以免不必要的细节妨碍本申请的描述。In the following description, for the purpose of illustration rather than limitation, specific details such as a specific system structure and technology are set forth in order to provide a thorough understanding of the embodiments of the present application. However, it will be apparent to those skilled in the art that the present application may be practiced in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present application with unnecessary detail.

应当理解,当在本申请说明书和所附权利要求书中使用时,术语“包括”指示所描述特征、整体、步骤、操作、元素和/或组件的存在,但并不排除一个或多个其它特征、整体、步骤、操作、元素、组件和/或其集合的存在或添加。It is to be understood that, when used in this specification and the appended claims, the term "comprising" indicates the presence of the described feature, integer, step, operation, element and/or component, but does not exclude one or more other The presence or addition of features, integers, steps, operations, elements, components and/or sets thereof.

在本申请说明书中描述的参考“一个实施例”或“一些实施例”等意味着在本申请的一个或多个实施例中包括结合该实施例描述的特定特征、结构或特点。由此,在本说明书中的不同之处出现的语句“在一个实施例中”、“在一些实施例中”、“在其他一些实施例中”、“在另外一些实施例中”等不是必然都参考相同的实施例,而是意味着“一个或多个但不是所有的实施例”,除非是以其他方式另外特别强调。术语“包括”、“包含”、“具有”及它们的变形都意味着“包括但不限于”,除非是以其他方式另外特别强调。References in this specification to "one embodiment" or "some embodiments" and the like mean that a particular feature, structure or characteristic described in connection with the embodiment is included in one or more embodiments of the present application. Thus, appearances of the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in other embodiments," etc. in various places in this specification are not necessarily All refer to the same embodiment, but mean "one or more but not all embodiments" unless specifically emphasized otherwise. The terms "including", "including", "having" and their variants mean "including but not limited to" unless specifically emphasized otherwise.

电子设备的打印功能中,供用户设置的打印参数较少,因此导致电子设备的打印功能较为简单,无法满足用户的打印需求。若为用户提供配置打印参数的权限,由于打印参数的设置比较复杂,会出现打印参数配置错误的情况,从而造成打印效果不佳,甚至打印出错的情况。In the printing function of the electronic device, there are few printing parameters for the user to set, so that the printing function of the electronic device is relatively simple and cannot meet the printing demand of the user. If the user is provided with the authority to configure the printing parameters, due to the complicated setting of the printing parameters, the configuration of the printing parameters will be incorrect, resulting in poor printing results or even printing errors.

为此,本申请提供一种图片打印方法,根据待打印图片的数量以及待打印图片的特征确定对应的打印模板,其中,待打印图片的特征包括待打印图片的尺寸、内容、像素中的任意一项或多项。在接收到打印指令时,根据打印模板对应的打印参数对待打印图片进行处理,将处理后的待打印图片发送至打印机,指示打印机打印处理后的待打印图片。相对于选择打印参数,选择打印模板可以降低由于参数选择错误导致的打印失败以及打印效果差的问题,同时,由于打印模板是根据待打印图片的数量以及特征确定的,因此,与打印模板对应的打印参数与待打印图片的匹配度更好,根据打印模板对应的打印参数对待打印图片进行处理后再进行打印,可以得到更好的打印效果。To this end, the present application provides a picture printing method, wherein a corresponding printing template is determined according to the number of pictures to be printed and the characteristics of the pictures to be printed, wherein the characteristics of the pictures to be printed include any of the size, content, and pixels of the pictures to be printed. one or more. When receiving the printing instruction, the picture to be printed is processed according to the printing parameters corresponding to the printing template, the processed picture to be printed is sent to the printer, and the printer is instructed to print the processed picture to be printed. Compared with selecting printing parameters, selecting a printing template can reduce the problems of printing failure and poor printing effect caused by wrong parameter selection. At the same time, since the printing template is determined according to the number and characteristics of the pictures to be printed, the corresponding The matching degree between the printing parameters and the to-be-printed picture is better. After processing the to-be-printed picture according to the printing parameters corresponding to the printing template, and then printing, a better printing effect can be obtained.

下面对本申请实施例提供的图片打印方法进行示例性说明。The image printing method provided by the embodiment of the present application is exemplarily described below.

本申请实施例提供的图片打印方法应用于电子设备。The picture printing method provided by the embodiment of the present application is applied to an electronic device.

示例性的,本申请实施例中所述的电子设备可以是手机、可穿戴设备(如智能手表、智能手环、智能眼镜、智能首饰等)、平板电脑、车载设备、增强现实(augmentedreality,AR)/虚拟现实(virtual reality,VR)设备、笔记本电脑、超级移动个人计算机(ultra-mobile personal computer,UMPC)、上网本、个人数字助理(personal digitalassistant,PDA)以及其他可以连接打印机的电子设备。上述电子设备包括但不限于搭载iOS®、Android®、Microsoft®、鸿蒙系统(Harmony OS)或者其他操作系统的设备。本申请实施例对电子设备的具体类型不做任何限制。Exemplarily, the electronic devices described in the embodiments of the present application may be mobile phones, wearable devices (such as smart watches, smart bracelets, smart glasses, smart jewelry, etc.), tablet computers, in-vehicle devices, augmented reality (AR) )/virtual reality (VR) devices, laptops, ultra-mobile personal computers (UMPCs), netbooks, personal digital assistants (PDAs), and other electronic devices that can connect to printers. The above electronic devices include but are not limited to devices equipped with iOS ® , Android ® , Microsoft ® , Harmony OS or other operating systems. The embodiments of the present application do not limit any specific types of electronic devices.

本申请实施例提供的图片打印方法,可以适用于多种类型的图片打印场景中。下面以电子设备是手机为例,结合附图,对一些应用场景进行介绍。The picture printing method provided by the embodiments of the present application can be applied to various types of picture printing scenarios. Taking the electronic device as a mobile phone as an example below, some application scenarios are introduced in conjunction with the accompanying drawings.

场景一:大图打印场景Scenario 1: Big Picture Printing Scenario

示例性地,如图1A所示,手机在检测到打开图库应用程序的操作时,显示如图1B所示的图库预览界面,图库预览界面展示手机中存储的图片。在图库预览界面,若检测到选中图片的操作(例如长按图片的操作),对选中的图片进行标记。例如,如图1C所示,在选中的图片上增加“√”的标记。在选中图片后,图库预览界面显示图片操作选项,通过点击图片操作选项可以对图片进行相应的处理。例如,如图1C所示,图片操作选项包括“分享”、“全选”、“复制”、“更多”选项。若检测到点击“分享”的操作,则手机打开分享界面。如图1D所示,分享界面显示选中的图片,以及显示“信息”、“电子邮件”、“蓝牙”、“打印”等分享选项,用户通过点击任一分享选项可以打开另一进程,以发送或者打印选中的图片。手机检测到点击“打印”的操作,则打开打印进程,将选中的图片作为待打印图片。示例性地,待打印图片为一张,手机根据待打印图片的尺寸和分辨率,确定待打印图片符合大图打印模板,显示如图1E所示的大图打印界面,在大图打印的界面显示待打印图片。Exemplarily, as shown in FIG. 1A , when the mobile phone detects an operation of opening a gallery application, it displays a gallery preview interface as shown in FIG. 1B , and the gallery preview interface displays pictures stored in the mobile phone. In the gallery preview interface, if an operation of selecting a picture is detected (for example, the operation of long-pressing the picture), the selected picture will be marked. For example, as shown in Figure 1C, a "√" mark is added to the selected image. After selecting a picture, the gallery preview interface displays picture operation options, and you can perform corresponding processing on the picture by clicking the picture operation option. For example, as shown in FIG. 1C , the picture operation options include "share", "select all", "copy", and "more" options. If the operation of clicking "Share" is detected, the mobile phone opens the sharing interface. As shown in Figure 1D, the sharing interface displays the selected picture and displays sharing options such as "Information", "Email", "Bluetooth", "Print", etc. The user can open another process by clicking any sharing option to send Or print selected pictures. When the mobile phone detects the operation of clicking "Print", the printing process is opened, and the selected picture is used as the picture to be printed. Exemplarily, the picture to be printed is one piece, and the mobile phone determines that the picture to be printed conforms to the large picture printing template according to the size and resolution of the picture to be printed, and displays the large picture printing interface as shown in FIG. Displays pictures to be printed.

在一实施例中,手机根据缩放比例以及纸张的尺寸,确定待打印图片需要裁剪的数量,并在大图打印界面显示。例如,如图1E所示,在待打印图片上显示分割线,分割线将待打印图片分割为4张子图。In one embodiment, the mobile phone determines the number of images to be printed that need to be cropped according to the zoom ratio and the size of the paper, and displays them on the large image printing interface. For example, as shown in FIG. 1E , a dividing line is displayed on the picture to be printed, and the dividing line divides the picture to be printed into 4 sub-pictures.

在大图打印界面,若检测到点击“开始打印”的操作,则手机根据大图打印模板对应的打印参数对待打印图片进行处理,得到4张子图,指示打印机依次打印4张子图。其中,对待打印图片的处理包括缩放、裁剪、填充等处理。用户得到打印的4张子图后,对4张子图进行拼接,可以得到完整的大图。In the large image printing interface, if the operation of clicking "Start Printing" is detected, the mobile phone will process the to-be-printed image according to the printing parameters corresponding to the large image printing template, and obtain 4 sub-images, instructing the printer to print the 4 sub-images in sequence. Among them, the processing of the picture to be printed includes scaling, cropping, filling and other processing. After the user obtains the printed 4 sub-images, splicing the 4 sub-images can obtain a complete large image.

在一实施例中,大图打印界面显示大图打印模板对应的部分打印参数,例如,大图打印界面显示的打印参数包括:当前连接的打印机的标识“HP Laser M330”,以及模式“A4纸/黑白/1份/纵向”,以及缩放比例“放大2倍”。其中,模式中的A4纸表示纸张尺寸,黑白表示色彩,1份表示打印数量,纵向表示排布方向。在一实施例中,用户可以修改大图打印模板对应的部分打印参数,例如在大图打印界面,手机响应于用户点击“打印机选择”的操作,进入打印机页面,以供用户选择打印机。或者,手机响应于点击“模式”的操作,进入模式页面,并根据用户的修改操作修改纸张尺寸、色彩、打印数量以及排布方向。或者,手机响应于用户触发的点击“缩放比例”的操作,进入缩放比例页面重新设置缩放比例。示例性地,若检测到点击“缩放比例”的操作,则手机显示如图1F所示的缩放比例设置页面。在缩放比例设置页面,用户可以选择缩放比例选项以重新设置缩放比例。例如,当前的选中的缩放比例是“放大2倍”,若检测到用户点击“放大1倍”的操作,则将缩放比例修改为放大1倍。若检测到点击“取消”选项的操作,则手机返回大图打印界面。若接收到用户修改打印参数的操作,则在检测到点击“开始打印”的操作时,手机根据修改后的打印参数处理待打印图片。In one embodiment, the large-picture printing interface displays some printing parameters corresponding to the large-picture printing template. For example, the printing parameters displayed on the large-picture printing interface include: the logo of the currently connected printer "HP Laser M330", and the mode "A4 paper". /B&W/1copy/Portrait", and the zoom ratio "Zoom in 2 times". Among them, A4 paper in the mode represents the paper size, black and white represents the color, 1 copy represents the number of prints, and vertical represents the arrangement direction. In one embodiment, the user can modify some printing parameters corresponding to the large image printing template. For example, in the large image printing interface, the mobile phone responds to the user's operation of clicking "printer selection" to enter the printer page for the user to select a printer. Alternatively, the mobile phone enters the mode page in response to the operation of clicking "mode", and modifies the paper size, color, print quantity and arrangement direction according to the user's modification operation. Alternatively, the mobile phone enters the zoom ratio page to reset the zoom ratio in response to the operation of clicking the "zoom ratio" triggered by the user. Exemplarily, if an operation of clicking "zoom ratio" is detected, the mobile phone displays a zoom ratio setting page as shown in FIG. 1F . On the zoom ratio setting page, the user can select the zoom ratio option to reset the zoom ratio. For example, the currently selected zoom ratio is "zoom in by 2 times", and if it is detected that the user clicks the operation of "zoom in by 1 time", the zoom ratio is modified to zoom in by 1 times. If the operation of clicking the "Cancel" option is detected, the mobile phone returns to the large image printing interface. If an operation of modifying the printing parameters by the user is received, when the operation of clicking "start printing" is detected, the mobile phone processes the picture to be printed according to the modified printing parameters.

可选的,在检测到用户修改打印参数的操作时,手机还可以提示用户是否保存打印参数修改后的大图打印模板。在检测到用户指示保存打印参数修改后的大图打印模板的情况下,手机保存打印参数修改后的大图打印模板。在检测到用户指示不保存打印参数修改后的大图打印模板的情况下,则手机不保存打印参数修改后的大图打印模板。后续用户可以选择将打印参数修改后的大图打印模板和未修改参数的大图打印模板中的一个作为默认的大图打印模板。Optionally, when detecting the user's operation of modifying the printing parameters, the mobile phone may also prompt the user whether to save the large image printing template after the modification of the printing parameters. In the case of detecting that the user instructs to save the large-picture printing template with the modified printing parameters, the mobile phone saves the large-picture printing template with the modified printing parameters. If it is detected that the user instructs not to save the large image printing template after the modification of the printing parameters, the mobile phone does not save the large image printing template after the modification of the printing parameters. Subsequent users may choose to use one of the large image printing template with the modified printing parameters and the large image printing template without modified parameters as the default large image printing template.

在一实施例中,打印机打印出的各子图上可以标识子图所在的位置,以便于用户进行拼接。例如,可以标识子图所在的行号和列号,或者子图所在的页码等。In one embodiment, the positions of the sub-images may be marked on each sub-image printed by the printer, so as to facilitate the user to perform splicing. For example, the row number and column number where the subgraph is located, or the page number where the subgraph is located can be identified.

如图2A所示,在一实施例中,大图打印界面还显示“拼接标识”的选项,手机用于根据拼接标识的参数,对子图进行标记,指示打印机打印标记后的子图。用户可以查看拼接标识的参数以及编辑拼接标识的参数。例如,若检测到用户点击“拼接标识”的选项,则打开如图2B所示的拼接标识的界面。在拼接标识界面,显示多种拼接标识的格式。例如,拼接标识的格式包括默认格式以及自定义格式。默认的格式的参数为留白2行2列,此处为p行q列。其中,留白表示分割后的子图的四周所留的空白区域。此处为p行q列表示在子图上标记的拼接标识。自定义格式对应的参数可以由用户输入。例如,用户添加的自定义格式的名称分别为模式1、模式2、自定义1。模式1的格式的参数为留白2行2列,此处接p行q列;模式2的格式的参数为留白0行0列,无;自定义1的格式的参数为留白1行1列, p行q列。同时,手机根据当前选中的拼接标识格式,在拼接标识界面展示添加拼接标识后的子图样式,用户通过点击预览按钮,可以依次浏览分割后的各子图对应的打印效果。例如,当前选中的拼接标识为默认,当前预览的子图是位于2行2列的子图,则在该子图的四周边缘显示“此处为2行2列”。As shown in FIG. 2A , in one embodiment, the large image printing interface also displays an option of "splicing mark", and the mobile phone is used to mark the sub-pictures according to the parameters of the splicing mark, and instruct the printer to print the marked sub-pictures. Users can view the parameters of the splice logo and edit the parameters of the splice logo. For example, if it is detected that the user clicks on the option of "splicing logo", the interface of splicing logo as shown in FIG. 2B is opened. In the splicing logo interface, a variety of splicing logo formats are displayed. For example, the format of the splice logo includes a default format and a custom format. The parameters of the default format are blank 2 rows and 2 columns, here are p rows and q columns. Wherein, the blank space represents the blank area left around the divided sub-images. Here, the p row and the q column represent the splicing marks marked on the subgraph. The parameters corresponding to the custom format can be input by the user. For example, the names of the custom formats added by the user are Mode 1, Mode 2, and Custom 1, respectively. The parameters of the format of mode 1 are blank 2 rows and 2 columns, where p row and q column are connected; the parameters of the format of mode 2 are blank 0 rows and 0 columns, none; the parameters of the custom 1 format are blank 1 row 1 column, p row q column. At the same time, the mobile phone displays the sub-image style after adding the splicing logo on the splicing logo interface according to the currently selected splicing logo format, and the user can click the preview button to browse the print effects corresponding to the divided sub-images in turn. For example, if the currently selected splicing ID is the default, and the currently previewed sub-image is a sub-image located in 2 rows and 2 columns, "here is 2 rows and 2 columns" will be displayed on the surrounding edges of the sub-image.

场景二:长图打印场景Scenario 2: Long Image Printing Scenario

示例性地,如图3A和图3B所示,在图库预览界面,若检测到选中图片的操作,在选中的图片上增加“√”的标记。在选中图片后,图库预览界面显示图片操作选项,例如,如图3B所示,图片操作选项包括“分享”、“全选”、“复制”、“更多”选项。若检测到点击“分享”的操作,则手机显示如图3C所示的分享界面。分享界面显示选中的图片,以及显示“信息”、“电子邮件”、“蓝牙”、“打印”等分享选项。若检测到点击“打印”的操作,则手机启动打印进程,将选中的图片作为待打印图片。示例性地,待打印图片为一张,手机根据待打印图片的尺寸和分辨率,确定待打印图片符合长图打印模板,显示如图3D所示的长图打印界面,在长图打印界面显示待打印图像。长图打印界面还显示长图打印模板对应的部分打印参数,例如,在长图打印界面显示的打印参数包括:当前连接的打印机的标识“HP Laser M330”,模式“A4纸/彩色/1份/纵向”,缩放比例“放大1倍”。同时,手机根据待打印图片的尺寸以及用于打印的纸张的尺寸,确定待打印图片需要分割为2张子图,在待打印图片上显示分割线,分割线将待打印图片分割为2张子图。Exemplarily, as shown in FIG. 3A and FIG. 3B , on the gallery preview interface, if an operation of selecting a picture is detected, a "√" mark is added to the selected picture. After a picture is selected, the gallery preview interface displays picture operation options. For example, as shown in FIG. 3B , the picture operation options include "share", "select all", "copy", and "more" options. If an operation of clicking "Share" is detected, the mobile phone displays a sharing interface as shown in FIG. 3C . The sharing interface displays the selected picture, as well as sharing options such as "Information", "Email", "Bluetooth", "Print". If the operation of clicking "print" is detected, the mobile phone starts the printing process, and takes the selected picture as the picture to be printed. Exemplarily, the picture to be printed is one piece, and the mobile phone determines that the picture to be printed conforms to the long picture printing template according to the size and resolution of the picture to be printed, and displays the long picture printing interface as shown in FIG. Image to be printed. The long-image printing interface also displays some printing parameters corresponding to the long-image printing template. For example, the printing parameters displayed in the long-image printing interface include: the logo of the currently connected printer "HP Laser M330", the mode "A4 paper/color/1 copy" /portrait", zoom ratio "1x zoom". At the same time, the mobile phone determines that the picture to be printed needs to be divided into 2 sub-pictures according to the size of the picture to be printed and the size of the paper used for printing, and displays a dividing line on the picture to be printed, and the dividing line divides the picture to be printed into 2 sub-pictures.

若检测到点击“开始打印”的操作,则手机根据长图打印模板对应的打印参数处理待打印图片,得到2张子图,指示打印机依次打印2张子图。用户得到打印的2张子图后,对2张子图进行拼接,可以得到完整的长图。在一实施例中,用户可以在长图打印界面修改长图打印模板对应的打印参数,若检测到修改打印参数的操作,后续手机根据修改后的打印参数处理待打印图片。在一实施例中,手机根据预先设置的拼接标识,在各子图上增加拼接标识,例如拼接标识可以为页码,手机指示打印机打印添加页码后的子图,用户根据页码可以确定各子图的位置,从而方便拼接。If the operation of clicking "Start Printing" is detected, the mobile phone processes the picture to be printed according to the printing parameters corresponding to the long picture printing template, and obtains 2 sub-pictures, instructing the printer to print the 2 sub-pictures in sequence. After the user obtains the two printed sub-images, splicing the two sub-images can obtain a complete long image. In one embodiment, the user can modify the printing parameters corresponding to the long-picture printing template on the long-picture printing interface. If an operation of modifying the printing parameters is detected, the subsequent mobile phone processes the pictures to be printed according to the modified printing parameters. In one embodiment, the mobile phone adds a splicing mark on each sub-picture according to a preset splicing mark, for example, the splicing mark can be a page number, the mobile phone instructs the printer to print the sub-picture after adding the page number, and the user can determine each sub-picture according to the page number. position for easy splicing.

场景三:寸照打印场景Scenario 3: inch photo printing scenario

示例性地,如图4A和图4B所示,在图库预览界面,若检测到选中图片的操作,在选中的图片上增加“√”的标记。在选中图片后,图库预览界面显示图片操作选项 “分享”、“全选”、“复制”、“更多”选项。若检测到点击“分享”的操作,则手机显示如图4C所示的分享界面。分享界面显示选中的图片,以及显示“信息”、“电子邮件”、“蓝牙”、“打印”等分享选项。若检测到点击“打印”的操作,则手机打开打印进程,将选中的图片作为待打印图片。示例性地,待打印图片为一张,手机根据待打印图片的尺寸以及内容,确定待打印图片符合寸照打印模板,显示如图4D所示的寸照打印界面,在寸照打印界面显示待打印的寸照。在一实施例中,手机根据待打印图片的尺寸以及纸张的尺寸确定纸张上可以排布的待打印图片的数量,在寸照打印界面显示多张待打印图片在纸张上排布的效果。寸照打印界面还显示寸照打印模板对应的部分打印参数。例如,显示当前连接的打印机的标识“HP Laser M330”,模式“相片纸/彩色/4*6/纵向”,缩放比例“放大1倍”。若检测到点击“开始打印”的操作,则手机根据寸照打印模板对应的打印参数处理待打印图片,并指示打印机打印处理后的待打印图片。在一实施例中,用户可以在寸照打印界面修改寸照打印模板对应的打印参数,若检测到修改打印参数的操作,后续手机根据修改后的打印参数处理待打印图片。Exemplarily, as shown in FIG. 4A and FIG. 4B , on the gallery preview interface, if an operation of selecting a picture is detected, a "√" mark is added to the selected picture. After selecting a picture, the gallery preview interface displays the picture operation options "Share", "Select All", "Copy", and "More" options. If an operation of clicking "Share" is detected, the mobile phone displays a sharing interface as shown in FIG. 4C . The sharing interface displays the selected picture, as well as sharing options such as "Information", "Email", "Bluetooth", "Print". If the operation of clicking "print" is detected, the mobile phone will start the printing process and use the selected picture as the picture to be printed. Exemplarily, the picture to be printed is one piece, and the mobile phone determines that the picture to be printed conforms to the inch photo printing template according to the size and content of the picture to be printed, and displays the inch photo printing interface as shown in FIG. Printed photo. In one embodiment, the mobile phone determines the number of pictures to be printed that can be arranged on the paper according to the size of the picture to be printed and the size of the paper, and displays the effect of arranging multiple pictures to be printed on the paper on the inch photo printing interface. The inch photo printing interface also displays some printing parameters corresponding to the inch photo printing template. For example, display the logo of the currently connected printer "HP Laser M330", the mode is "photo paper/color/4*6/portrait", and the zoom ratio is "1x magnification". If the operation of clicking "start printing" is detected, the mobile phone processes the picture to be printed according to the printing parameters corresponding to the inch photo printing template, and instructs the printer to print the processed picture to be printed. In one embodiment, the user can modify the printing parameters corresponding to the photo printing template on the photo printing interface. If an operation of modifying the printing parameters is detected, the subsequent mobile phone processes the pictures to be printed according to the modified printing parameters.

场景四:风景图打印场景Scenario 4: Landscape print scenario

示例性地,如图5A和图5B所示,在图库预览界面,若检测到选中图片的操作,在选中的图片上增加“√”的标记。在选中图片后,图库预览界面显示图片操作选项 “分享”、“全选”、“复制”、“更多”选项。若检测到点击“分享”的操作,则手机显示如图5C所示的分享界面。分享界面显示选中的图片,以及显示“信息”、“电子邮件”、“蓝牙”、“打印”等分享选项。若检测到点击“打印”的操作,则手机打开打印进程,将选中的图片作为待打印图片。示例性地,待打印图片为一张,手机根据待打印图片的尺寸以及内容,确定待打印图片符合风景图打印模板,显示如图5D所示的风景图打印界面。在风景图打印界面显示待打印的风景图,以及风景图打印模板对应的部分打印参数。例如,显示当前连接的打印机的标识“HP LaserM330”,打印参数“A4纸/彩色/1份/纵向”,缩放比例“放大1倍”。若检测到点击“开始打印”的操作,则手机根据风景图打印模板对应的打印参数处理待打印图片,并指示打印机打印处理后的待打印图片。在一实施例中,用户可以在风景图打印界面修改风景图打印模板对应的打印参数,若检测到修改打印参数的操作,后续手机根据修改后的打印参数处理待打印图片。Exemplarily, as shown in FIG. 5A and FIG. 5B , on the gallery preview interface, if an operation of selecting a picture is detected, a mark of "√" is added to the selected picture. After selecting a picture, the gallery preview interface displays the picture operation options "Share", "Select All", "Copy", and "More" options. If an operation of clicking "Share" is detected, the mobile phone displays the sharing interface as shown in FIG. 5C . The sharing interface displays the selected picture, as well as sharing options such as "Information", "Email", "Bluetooth", "Print". If the operation of clicking "print" is detected, the mobile phone will start the printing process and use the selected picture as the picture to be printed. Exemplarily, the picture to be printed is one piece, and the mobile phone determines that the picture to be printed conforms to the landscape print template according to the size and content of the picture to be printed, and displays the landscape print interface as shown in FIG. 5D . The landscape image to be printed and some print parameters corresponding to the landscape image print template are displayed on the landscape image print interface. For example, the logo of the currently connected printer is displayed "HP LaserM330", the printing parameters are "A4 paper/color/1 copy/portrait", and the zoom ratio is "1 times larger". If the operation of clicking "start printing" is detected, the mobile phone processes the picture to be printed according to the printing parameters corresponding to the landscape print template, and instructs the printer to print the processed picture to be printed. In one embodiment, the user can modify the print parameters corresponding to the landscape print template on the landscape print interface. If an operation of modifying the print parameters is detected, the subsequent mobile phone processes the picture to be printed according to the modified print parameters.

场景五:照片打印场景Scenario 5: Photo Printing Scenario

示例性地,如图6A和图6B所示,在图库预览界面,若检测到选中图片的操作,在选中的图片上增加“√”的标记。在选中图片后,图库预览界面显示图片操作选项 “分享”、“全选”、“复制”、“更多”选项。若检测到点击“分享”的操作,则手机显示如图6C所示的分享界面。分享界面显示选中的图片,以及显示“信息”、“电子邮件”、“蓝牙”、“打印”等分享选项。若检测到点击“打印”的操作,则手机打开打印进程,将选中的图片作为待打印图片。示例性地,待打印图片为一张,手机根据待打印图片的尺寸以及分辨率,确定待打印图片符合照片打印模板,显示如图6D所示的照片打印界面。在照片打印界面显示待打印的照片,以及照片打印模板对应的部分打印参数。例如显示当前连接的打印机的标识“HP Laser M330”,模式“相片纸/彩色/1份/纵向”,缩放比例“放大1倍”。若检测到点击“开始打印”的操作,则手机根据照片打印模板对应的打印参数处理待打印图片,并指示打印机打印处理后的待打印图片。在一实施例中,用户可以在照片打印界面修改照片打印模板对应的打印参数,若检测到修改打印参数的操作,后续手机根据修改后的打印参数处理待打印图片。Exemplarily, as shown in FIG. 6A and FIG. 6B , on the gallery preview interface, if an operation of selecting a picture is detected, a mark of "√" is added to the selected picture. After selecting a picture, the gallery preview interface displays the picture operation options "Share", "Select All", "Copy", and "More" options. If an operation of clicking "Share" is detected, the mobile phone displays a sharing interface as shown in FIG. 6C . The sharing interface displays the selected picture, as well as sharing options such as "Information", "Email", "Bluetooth", "Print". If the operation of clicking "print" is detected, the mobile phone will start the printing process and use the selected picture as the picture to be printed. Exemplarily, the picture to be printed is one piece, and the mobile phone determines that the picture to be printed conforms to the photo printing template according to the size and resolution of the picture to be printed, and displays the photo printing interface as shown in FIG. 6D . The photo to be printed and some printing parameters corresponding to the photo printing template are displayed on the photo printing interface. For example, the logo of the currently connected printer is displayed "HP Laser M330", the mode is "photo paper/color/1 copy/portrait", and the zoom ratio is "1 times larger". If an operation of clicking "start printing" is detected, the mobile phone processes the picture to be printed according to the printing parameters corresponding to the photo printing template, and instructs the printer to print the processed picture to be printed. In one embodiment, the user can modify the printing parameters corresponding to the photo printing template on the photo printing interface. If an operation of modifying the printing parameters is detected, the subsequent mobile phone processes the pictures to be printed according to the modified printing parameters.

场景六:身份证打印场景Scenario 6: ID card printing scenario

示例性地,如图7A所示,在图库预览界面,在选中的图片上增加“√”的标记,图库预览界面还显示图片操作选项 “分享”、“全选”、“复制”、“更多”选项。若检测到点击“分享”的操作,则手机显示如图7B所示的分享界面。分享界面显示选中图片的数量以及显示最近一次选中的图片,并显示“信息”、“电子邮件”、“蓝牙”、“打印”等分享选项。若检测到点击“打印”的操作,则手机启动打印进程,将选中的图片作为待打印图片。示例性地,待打印图片为两张,手机根据待打印图片的尺寸以及内容,确定待打印图片符合身份证打印模板。则显示如图7C所示的身份证打印界面。在身份证打印界面显示拼接后的图像,身份证的正面图像在上方,身份证的反面图像在下方,身份证的正面图像和身份证的反面图像间隔预设距离且对齐。同时,在身份证打印界面显示身份证打印模板对应的部分打印参数,例如,显示当前连接的打印机的标识“HP Laser M330”,打印参数“A4纸/黑白/1份/居中”,拼图模板“纵向”。若检测到点击“开始打印”的操作,则手机根据身份证打印模板对应的打印参数处理待打印图片,并指示打印机打印处理后的待打印图片。在一实施例中,用户可以在身份证打印界面修改身份证打印模板对应的打印参数,若检测到修改打印参数的操作,后续手机根据修改后的打印参数处理待打印图片。Exemplarily, as shown in FIG. 7A , in the gallery preview interface, a mark of "√" is added to the selected picture, and the picture operation options "Share", "Select All", "Copy", "Update" are also displayed on the gallery preview interface. Multiple" option. If the operation of clicking "Share" is detected, the mobile phone displays the sharing interface as shown in FIG. 7B . The sharing interface displays the number of selected pictures and the most recently selected picture, and displays sharing options such as "Information", "Email", "Bluetooth", "Print". If the operation of clicking "print" is detected, the mobile phone starts the printing process, and takes the selected picture as the picture to be printed. Exemplarily, there are two pictures to be printed, and the mobile phone determines that the pictures to be printed conform to the ID card printing template according to the size and content of the pictures to be printed. Then the ID card printing interface as shown in FIG. 7C is displayed. The spliced image is displayed on the ID card printing interface. The front image of the ID card is at the top, and the back image of the ID card is at the bottom. The front image of the ID card and the back image of the ID card are separated by a preset distance and aligned. At the same time, some printing parameters corresponding to the ID card printing template are displayed on the ID card printing interface. For example, the logo of the currently connected printer is "HP Laser M330", the printing parameters are "A4 paper/black and white/1 copy/center", and the puzzle template " portrait". If the operation of clicking "start printing" is detected, the mobile phone processes the picture to be printed according to the printing parameters corresponding to the ID card printing template, and instructs the printer to print the processed picture to be printed. In one embodiment, the user can modify the printing parameters corresponding to the ID card printing template on the ID card printing interface. If an operation of modifying the printing parameters is detected, the subsequent mobile phone processes the pictures to be printed according to the modified printing parameters.

场景七:拼图打印场景Scenario 7: Jigsaw Printing Scenario

示例性地,如图8A所示,在图库预览界面,在选中的图片上增加“√”的标记,图库预览界面还显示图片操作选项 “分享”、“全选”、“复制”、“更多”选项。若检测到点击“分享”的操作,则手机显示如图8B所示的分享界面。分享界面显示选中的图片数量以及显示最近一次选中的图片,并显示“信息”、“电子邮件”、“蓝牙”、“打印”等分享选项。若检测到点击“打印”的操作,则手机打开打印进程,将选中的图片作为待打印图片。示例性地,待打印图片为两张,手机根据待打印图片的内容,确定待打印图片符合拼图打印模板,显示如图8C所示的拼图打印界面。在拼图打印界面显示按照预设拼图模板拼接后的图像,其中,预设拼图模板可以是横向模板或者纵向模板。同时,在拼图打印界面显示拼图打印模板对应的部分打印参数,例如,显示当前连接的打印机的标识“HP Laser M330”,打印参数“相片纸/彩色/1份/横向”,拼图模板“横向”。若检测到点击“开始打印”的操作,则手机根据拼图打印模板对应的打印参数处理待打印图片,并指示打印机打印处理后的待打印图片。示例性地,用户可以在拼图打印界面修改拼图打印模板对应的打印参数,例如,可以将拼图模板改为“纵向”。若检测到修改打印参数的操作,后续手机根据修改后的打印参数处理待打印图片。Exemplarily, as shown in FIG. 8A , on the gallery preview interface, a mark of "√" is added to the selected picture, and the picture operation options "Share", "Select All", "Copy", "Update" are also displayed on the gallery preview interface. Multiple" option. If an operation of clicking "Share" is detected, the mobile phone displays the sharing interface as shown in FIG. 8B . The sharing interface displays the number of selected pictures and the most recently selected picture, and displays sharing options such as "Information", "Email", "Bluetooth", "Print". If the operation of clicking "print" is detected, the mobile phone will start the printing process and use the selected picture as the picture to be printed. Exemplarily, there are two pictures to be printed, and the mobile phone determines that the pictures to be printed conform to the puzzle printing template according to the content of the pictures to be printed, and displays the puzzle printing interface as shown in FIG. 8C . The image stitched according to the preset jigsaw template is displayed on the jigsaw print interface, wherein the preset jigsaw template may be a horizontal template or a vertical template. At the same time, some printing parameters corresponding to the puzzle printing template are displayed in the puzzle printing interface. For example, the logo of the currently connected printer is "HP Laser M330", the printing parameters are "photo paper/color/1 copy/landscape", and the puzzle template "landscape" is displayed. . If an operation of clicking "start printing" is detected, the mobile phone processes the to-be-printed picture according to the print parameters corresponding to the puzzle print template, and instructs the printer to print the processed to-be-printed picture. Exemplarily, the user can modify the printing parameters corresponding to the puzzle printing template on the puzzle printing interface, for example, the puzzle template can be changed to "portrait". If an operation of modifying the printing parameters is detected, the subsequent mobile phone processes the pictures to be printed according to the modified printing parameters.

在一实施例中,还可以通过其他方式显示上述大图打印界面、长图打印界面、寸照打印界面、风景图打印界面、照片打印界面、身份证打印界面、拼图打印界面等打印界面。In one embodiment, the above-mentioned large image printing interface, long image printing interface, inch photo printing interface, landscape image printing interface, photo printing interface, ID card printing interface, puzzle printing interface and other printing interfaces can also be displayed in other ways.

可以理解的是,手机中可以具有一个或多个打印模板,各个打印模板所对应的打印参数中可以相同,也可以不同。It can be understood that the mobile phone may have one or more printing templates, and the printing parameters corresponding to each printing template may be the same or different.

以寸照打印界面为例,在一种可能的实现方式中,如图9A所示,在图库预览界面,若检测到用户打开图片的操作(例如单击图片的操作),则显示如图9B所示的图片界面,图片界面显示打开的图片,以及显示图片操作选项,通过点击图片操作选项可以对显示界面上显示的图片进行相应的处理。例如,如图9B所示,图片操作选项包括“分享”、“收藏”、“编辑”、“更多”选项。若检测到点击“编辑”的操作,则手机显示如图9C所示的图片编辑界面。图片编辑界面显示修剪、滤镜、打印、更多等编辑选项,通过点击编辑选项可以对显示界面上显示的图片进行相应的编辑。若检测到点击“打印”的操作,则手机启动打印进程,将选中的图片作为待打印图片,根据待打印图片的尺寸以及内容确定符合寸照打印模板,显示如图9D所示的寸照打印界面。Taking the inch photo printing interface as an example, in a possible implementation manner, as shown in FIG. 9A , in the gallery preview interface, if an operation of opening a picture by the user (for example, an operation of clicking a picture) is detected, it will be displayed as shown in FIG. 9B As shown in the picture interface, the picture interface displays the opened picture and displays the picture operation options, and the pictures displayed on the display interface can be processed correspondingly by clicking the picture operation options. For example, as shown in FIG. 9B , the picture operation options include "Share", "Favorite", "Edit", and "More" options. If an operation of clicking "edit" is detected, the mobile phone displays a picture editing interface as shown in FIG. 9C . The picture editing interface displays editing options such as trimming, filtering, printing, and more. By clicking the editing options, the pictures displayed on the display interface can be edited accordingly. If the operation of clicking "Print" is detected, the mobile phone starts the printing process, takes the selected picture as the picture to be printed, and determines the size and content of the picture to be printed conforms to the inch print template, and displays the inch print as shown in Figure 9D interface.

在另一种可能的实现方式中,如图10A所示,手机在检测到打开打印应用程序的操作时,打开如图10B所示的功能预览界面。在功能预览界面,显示手机当前连接的打印机的标识为“HP Laser M330”,同时显示文档、图片、相机、扫描图标,用户可以通过点击文档图标打开文档所在的应用程序,以打印文档;通过点击图片图标打开图库应用程序,以打印图库中的图片;通过点击相机图标打开相机应用程序,以对相机拍摄的图片进行打印;通过点击扫描图标打开扫描进程,实现对文件的扫描。示例性地,若检测到点击“图片”图标的操作,则跳转至如图10C所示的图库界面,图库界面展示图库中存储的图片。在图库界面,若检测到打开图片的操作,则显示如图10D所示的图片显示界面,图片显示界面显示用户打开的图片,以及“打印”、“收藏”、“滤镜”、“分享”操作选项。在图片显示界面,若手机检测到用户点击“打印”的操作,将选中的图片作为待打印图片,根据待打印图片的尺寸以及内容确定符合寸照打印模板,显示如图10E所示的寸照打印界面。In another possible implementation manner, as shown in FIG. 10A , when the mobile phone detects an operation of opening the printing application, the mobile phone opens the function preview interface as shown in FIG. 10B . In the function preview interface, the logo of the printer currently connected to the mobile phone is displayed as "HP Laser M330", and the icons of documents, pictures, cameras, and scans are displayed at the same time. Users can click the document icon to open the application where the document is located to print the document; The picture icon opens the gallery application to print the pictures in the gallery; click the camera icon to open the camera application to print the pictures taken by the camera; click the scan icon to open the scanning process to scan the file. Exemplarily, if an operation of clicking the "picture" icon is detected, it will jump to the gallery interface as shown in FIG. 10C , and the gallery interface displays the pictures stored in the gallery. In the gallery interface, if the operation of opening a picture is detected, the picture display interface as shown in Figure 10D will be displayed. Action options. In the picture display interface, if the mobile phone detects that the user has clicked "print", the selected picture will be used as the picture to be printed, and the size and content of the picture to be printed will be determined to conform to the print template of the inch photo, and the inch photo as shown in Figure 10E will be displayed. print interface.

上述七个场景均是在确定待打印图片后,由手机确定与待打印图片对应的打印模板,根据打印模板打印待打印图片。从而不用用户选择打印参数,降低由于参数选择错误导致的打印失败以及打印效果差的问题,同时,由于打印模板是根据待打印图片确定的,因此,与打印模板对应的打印参数与待打印图片的匹配度更好,根据打印模板对应的打印参数进行打印,可以得到更好的打印效果。In the above seven scenarios, after the picture to be printed is determined, the mobile phone determines the printing template corresponding to the picture to be printed, and prints the picture to be printed according to the printing template. Therefore, it is not necessary for the user to select printing parameters, and the problems of printing failure and poor printing effect caused by wrong parameter selection are reduced. At the same time, since the printing template is determined according to the picture to be printed, the printing parameters corresponding to the printing template are different from those of the picture to be printed. The matching degree is better, and printing according to the printing parameters corresponding to the printing template can obtain a better printing effect.

在其他场景中,也可以由用户选择打印模板,根据用户选择的打印模板打印待打印图片。In other scenarios, the user may also select a print template, and print the picture to be printed according to the print template selected by the user.

场景八:用户选择打印模板的场景Scenario 8: The scenario where the user selects the print template

如图11所示,在功能预览界面,除了显示上述场景所述的打印机标识,以及文档、图片、相机、扫描图标之外,还显示打印功能图标。示例性地,打印功能图标包括大图打印图标、长图打印图标、寸照打印图标、照片打印图标、风景图打印图标、身份证打印图标、拼图打印图标、更多图标,用户可以通过点击各打印功能图标打开对应的打印模板。As shown in FIG. 11 , in the function preview interface, in addition to displaying the printer logo and the document, picture, camera, and scanning icons described in the above scenario, printing function icons are also displayed. Exemplarily, the print function icons include a large image print icon, a long image print icon, an inch photo print icon, a photo print icon, a landscape image print icon, an ID card print icon, a puzzle print icon, and more icons. The print function icon opens the corresponding print template.

示例性地,如图12A所示,在功能预览界面,手机在检测到用户点击大图打印图标的操作时,显示如图12B所示的图片展示界面。图片展示界面展示“图片”和“拍摄”两个选项。在“图片”处于选中状态下,图片展示界面展示图库中的图片,在“拍摄”处于选中状态下,图片展示界面显示拍摄界面,在拍摄界面可以供用户拍摄图片。示例性地,在图片展示界面展示图库中的图片时,若手机检测到选中图片的操作,则在选中的图片上增加标记。例如,如图12C所示,在选中的图片上增加“√”的标记。用户可以通过如图12C中的标记确定已经选中的图片。手机在检测到选中图片的操作后,若检测到点击“确定”的操作,则将选中的图片作为待打印图片,显示如图12D所示的大图打印界面,在大图打印界面,用户可以修改大图打印模板对应的打印参数,例如修改连接的打印机、模式以及缩放比例。若检测到点击“开始打印”的操作,则手机根据大图打印模板对应的打印参数处理待打印图片,并指示打印机打印处理后的待打印图片。Exemplarily, as shown in FIG. 12A , in the function preview interface, when the mobile phone detects an operation of the user clicking the large image print icon, the mobile phone displays the picture display interface as shown in FIG. 12B . The picture display interface displays two options, "Picture" and "Shooting". When "Picture" is selected, the picture display interface displays the pictures in the gallery. When "Shooting" is selected, the picture display interface displays the shooting interface, and the user can take pictures on the shooting interface. Exemplarily, when a picture in the gallery is displayed on the picture display interface, if the mobile phone detects an operation of selecting a picture, a mark is added to the selected picture. For example, as shown in Fig. 12C, a "√" mark is added to the selected picture. The user can determine the selected picture by marking as shown in FIG. 12C . After the mobile phone detects the operation of selecting a picture, if it detects the operation of clicking "OK", the selected picture will be used as the picture to be printed, and the large picture printing interface shown in Figure 12D will be displayed. In the large picture printing interface, the user can Modify the printing parameters corresponding to the large image printing template, such as modifying the connected printer, mode, and scaling. If an operation of clicking "start printing" is detected, the mobile phone processes the picture to be printed according to the printing parameters corresponding to the large picture printing template, and instructs the printer to print the processed picture to be printed.

示例性地,如图13A所示,在功能预览界面,手机在检测到用户点击长图打印图标的操作时,打开如图13B所示的图片展示界面。在图片展示界面展示图库中的图片时,若手机检测到选中图片的操作,则如图13C所示,在选中的图片上增加“√”的标记。手机在检测到选中图片的操作后,若检测到点击“确定”的操作,则将选中的图片作为待打印图片,显示如图13D所示的长图打印界面,在长图打印界面,用户可以修改打印机、打印参数以及缩放比例。若检测到点击“开始打印”的操作,则手机根据长图打印模板对应的打印参数处理待打印图片,并指示打印机打印处理后的待打印图片。Exemplarily, as shown in FIG. 13A , in the function preview interface, when the mobile phone detects that the user clicks the long-picture print icon, the mobile phone opens the picture display interface as shown in FIG. 13B . When displaying pictures in the gallery on the picture display interface, if the mobile phone detects the operation of selecting a picture, as shown in FIG. 13C , a "√" mark is added to the selected picture. After the mobile phone detects the operation of selecting a picture, if it detects the operation of clicking "OK", the selected picture will be used as the picture to be printed, and the long picture printing interface shown in Figure 13D will be displayed. In the long picture printing interface, the user can Modify the printer, printing parameters, and scaling. If an operation of clicking "start printing" is detected, the mobile phone processes the picture to be printed according to the printing parameters corresponding to the long picture printing template, and instructs the printer to print the processed picture to be printed.

示例性地,如图14A所示,在功能预览界面,手机在检测到用户点击照片打印图标的操作时,打开如图14B所示的图片展示界面。在图片展示界面展示图库中的图片时,若手机检测到选中图片的操作,则如图14C所示,在选中的图片上增加“√”的标记。手机在检测到选中图片的操作后,若检测到点击“确定”的操作,则将选中的图片作为待打印图片,显示如图14D所示的照片打印界面。若检测到点击“开始打印”的操作,则手机根据照片打印模板对应的打印参数处理待打印图片,并指示打印机打印处理后的待打印图片。Exemplarily, as shown in FIG. 14A , on the function preview interface, when the mobile phone detects that the user clicks the photo print icon, the mobile phone opens the picture display interface as shown in FIG. 14B . When displaying pictures in the gallery on the picture display interface, if the mobile phone detects the operation of selecting a picture, as shown in FIG. 14C , a mark of "√" is added to the selected picture. After the mobile phone detects the operation of selecting a picture, if it detects the operation of clicking "OK", the selected picture will be used as the picture to be printed, and the photo printing interface shown in FIG. 14D will be displayed. If an operation of clicking "start printing" is detected, the mobile phone processes the picture to be printed according to the printing parameters corresponding to the photo printing template, and instructs the printer to print the processed picture to be printed.

示例性地,如图15A所示,在功能预览界面,手机在检测到用户点击风景图打印图标的操作时,打开如图15B所示的图片展示界面。在图片展示界面展示图库中的图片时,若手机检测到选中图片的操作,则如图15C所示,在选中的图片上增加“√”的标记。手机在检测到选中图片的操作后,若检测到点击“确定”的操作,则将选中的图片作为待打印图片,显示如图15D所示的风景图打印界面。若检测到点击“开始打印”的操作,则手机根据风景图打印模板对应的打印参数处理待打印图片,并指示打印机打印处理后的待打印图片。Exemplarily, as shown in FIG. 15A , in the function preview interface, when the mobile phone detects that the user clicks on the landscape image print icon, the mobile phone opens the picture display interface as shown in FIG. 15B . When displaying pictures in the gallery on the picture display interface, if the mobile phone detects the operation of selecting a picture, as shown in FIG. 15C , a mark of "√" is added to the selected picture. After the mobile phone detects the operation of selecting a picture, if it detects the operation of clicking "OK", the selected picture will be used as the picture to be printed, and the landscape picture printing interface shown in FIG. 15D will be displayed. If the operation of clicking "start printing" is detected, the mobile phone processes the picture to be printed according to the printing parameters corresponding to the landscape print template, and instructs the printer to print the processed picture to be printed.

示例性地,如图16A所示,在功能预览界面,手机在检测到用户点击寸照打印图标的操作时,显示如图16B所示的图片展示界面。在图片展示界面,若检测到点击“拍摄”的操作,则显示如图16C所示的拍摄界面。在拍摄界面,显示拍照图标161以及摄像头转换图标162,用户可以点击拍照图标161进行图片拍摄,点击摄像头转换图标162转换摄像方式为前置摄像头拍摄或者后置摄像头拍摄。在一实施例中,拍摄界面还显示设置图标163,用户可以点击设置图标163打开拍照设置界面,以修改拍照参数,例如缩放大小、亮度、对比度、滤镜等。若手机检测到点击拍照图标161的操作,则将最近一次拍摄的图片作为待打印图片,并在显示界面显示。例如,如图16D所示,在显示界面显示拍摄得到的图片,以及显示“重拍”以及“使用照片”的选项。若手机检测到点击“重拍”的操作,则返回拍摄界面,若检测到点击“使用照片”的操作,则显示如图16E所示的寸照打印界面。若检测到点击“开始打印”的操作,则手机根据寸照打印模板对应的打印参数处理待打印图片,并指示打印机打印处理后的待打印图片。Exemplarily, as shown in FIG. 16A , in the function preview interface, when the mobile phone detects an operation of the user clicking the one-size-fits-all print icon, the mobile phone displays the picture display interface as shown in FIG. 16B . On the picture display interface, if an operation of clicking "shoot" is detected, a shooting interface as shown in FIG. 16C is displayed. On the shooting interface, the camera icon 161 and the camera conversion icon 162 are displayed. The user can click the camera icon 161 to take a picture, and click the camera conversion icon 162 to switch the camera mode to front camera shooting or rear camera shooting. In one embodiment, a setting icon 163 is also displayed on the photographing interface, and the user can click the setting icon 163 to open the photographing setting interface to modify photographing parameters, such as zoom size, brightness, contrast, filter and the like. If the mobile phone detects the operation of clicking the photographing icon 161, the latest photographed picture will be used as the picture to be printed and displayed on the display interface. For example, as shown in FIG. 16D , the captured picture is displayed on the display interface, and the options of “retake” and “use photo” are displayed. If the mobile phone detects the operation of clicking "retake", it will return to the shooting interface, and if it detects the operation of clicking "use photo", it will display the one-inch photo printing interface as shown in Figure 16E. If the operation of clicking "start printing" is detected, the mobile phone processes the picture to be printed according to the printing parameters corresponding to the inch photo printing template, and instructs the printer to print the processed picture to be printed.

示例性地,如图17A所示,在功能预览界面,手机在检测到用户点击身份证打印图标的操作时,显示如图17B所示的图片展示界面。在图片展示界面,若手机检测到点击“拍摄”的操作,则打开如图17C所示的拍摄界面。在拍摄界面,显示拍照图标、摄像头转换图标以及设置图标。在一实施例中,拍摄界面还显示“请拍摄身份证正面”的提示信息,以提示用户拍摄身份证正面。若检测到点击拍照图标的操作,则将最近一次拍摄的图片作为待打印图片,并在显示界面显示。例如,如图17D所示,在显示界面显示拍摄得到的图片,以及显示“重拍”以及“继续拍摄”的选项。若手机检测到点击“重拍”的操作,则返回拍摄界面,若手机检测到点击“继续拍摄”的操作,则打开如图17E所示的拍摄界面。在拍摄界面显示“请拍摄身份证反面”的提示信息,以提示用户拍摄身份证反面。若检测到点击拍照图标的操作,则将最近一次拍摄的图片作为待打印图片,并在显示界面显示。例如,如图17F所示,在显示界面显示拍摄得到的图片,以及显示“重拍”以及“使用照片”的选项。若检测到点击“重拍”的操作,则返回拍摄界面,若检测到点击“使用照片”的操作,则打开如图17G所示的身份证打印界面。在身份证打印界面显示拍摄得到的身份证正面图片以及身份证反面图片。若检测到点击“开始打印”的操作,则手机根据身份证打印模板对应的打印参数处理待打印图片,并指示打印机打印处理后的待打印图片。Exemplarily, as shown in FIG. 17A , in the function preview interface, when the mobile phone detects that the user clicks the ID card printing icon, the mobile phone displays the picture display interface as shown in FIG. 17B . On the picture display interface, if the mobile phone detects the operation of clicking "shoot", it will open the shooting interface as shown in FIG. 17C . In the shooting interface, the camera icon, camera conversion icon and setting icon are displayed. In one embodiment, the photographing interface also displays a prompt message of "Please photograph the front side of the ID card" to prompt the user to photograph the front side of the ID card. If the operation of clicking the photo icon is detected, the most recent picture taken is used as the picture to be printed and displayed on the display interface. For example, as shown in FIG. 17D , the captured picture is displayed on the display interface, and the options of “retake” and “continue shooting” are displayed. If the mobile phone detects the operation of clicking "retake", it returns to the shooting interface, and if the mobile phone detects the operation of clicking "continue shooting", it opens the shooting interface as shown in FIG. 17E . The prompt message "Please photograph the reverse side of the ID card" is displayed on the shooting interface to prompt the user to shoot the reverse side of the ID card. If the operation of clicking the photo icon is detected, the most recent picture taken is used as the picture to be printed and displayed on the display interface. For example, as shown in FIG. 17F , the captured picture is displayed on the display interface, and the options of “retake” and “use photo” are displayed. If the operation of clicking "retake" is detected, it will return to the shooting interface, and if the operation of clicking "use photo" is detected, the ID card printing interface as shown in Figure 17G will be opened. On the ID card printing interface, the front image of the ID card and the reverse image of the ID card are displayed. If the operation of clicking "start printing" is detected, the mobile phone processes the picture to be printed according to the printing parameters corresponding to the ID card printing template, and instructs the printer to print the processed picture to be printed.

示例性地,如图18A所示,在功能预览界面,手机在检测到用户点击拼图打印图标的操作时,显示如图18B所示的图片展示界面。在图片展示界面展示图库中的图片时,若手机检测到选中图片的操作,则如图18C所示,在选中的两个图片上增加“√”的标记。手机在检测到选中图片的操作后,若检测到点击“确定”的操作,则将选中的图片作为待打印图片,显示如图18D所示的拼图模板选择界面。在拼图模板选择界面显示与选中的图片数量对应的各拼图模板,以及显示与当前选中的模板对应的拼接后的图形。示例性地,如图18D所示,选中的图片的数量为2,则在拼图模板选择界面显示2张图片对应的拼图模板,若第一个拼图模板被选中,则在模板选择界面显示按照第一个拼图模板拼接后的图形。Exemplarily, as shown in FIG. 18A , in the function preview interface, when the mobile phone detects an operation of the user clicking the puzzle print icon, the mobile phone displays the picture display interface as shown in FIG. 18B . When displaying pictures in the gallery on the picture display interface, if the mobile phone detects the operation of selecting a picture, as shown in FIG. 18C , a mark of "√" is added to the two selected pictures. After the mobile phone detects the operation of selecting a picture, if it detects the operation of clicking "OK", the selected picture will be used as the picture to be printed, and a puzzle template selection interface as shown in Figure 18D will be displayed. The jigsaw template selection interface displays each jigsaw template corresponding to the number of selected pictures, and displays the spliced graphics corresponding to the currently selected template. Exemplarily, as shown in FIG. 18D , the number of selected pictures is 2, then the puzzle templates corresponding to the two pictures are displayed on the puzzle template selection interface. A jigsaw template stitched graphics.

在拼图模板选择界面,用户也可以调整各待打印图片的位置。示例性地,若手机检测到用户调换图片的操作(例如将第一个待打印图片拖动至第二个待打印图片所在的位置的操作,或者将第二个待打印图片拖动至第一个待打印图片所在的位置的操作),则调换两个待打印图片的位置。在拼图模板选择界面,若手机检测到点击“确定”的操作,则将按照选中的模板拼接后的图形作为待打印图片,并显示如图18E所示的拼图打印界面。在拼图打印界面,若检测到点击“开始打印”的操作,则手机根据拼图打印模板对应的打印参数处理待打印图片,并指示打印机打印处理后的待打印图片。In the puzzle template selection interface, the user can also adjust the position of each picture to be printed. Exemplarily, if the mobile phone detects the user's operation of changing pictures (for example, the operation of dragging the first picture to be printed to the position of the second picture to be printed, or the operation of dragging the second picture to be printed to the first picture to be printed) the position of the picture to be printed), then the positions of the two pictures to be printed are exchanged. In the puzzle template selection interface, if the mobile phone detects the operation of clicking "OK", the graphics spliced according to the selected template will be used as the picture to be printed, and the puzzle printing interface shown in Figure 18E will be displayed. In the puzzle printing interface, if the operation of clicking "start printing" is detected, the mobile phone processes the picture to be printed according to the printing parameters corresponding to the puzzle printing template, and instructs the printer to print the processed picture to be printed.

示例性地,如图19A所示,在功能预览界面,在手机检测到用户点击更多图标的操作时,打开如图19B所示的打印功能界面,在打印功能界面显示其他打印功能。例如,其他打印功能还包括区域打印功能、自定义图片打印功能、试卷打印、卡通贴打印、趣味打印。其中,区域打印功能对应区域打印模板,用于打印图片的部分区域。自定义图片打印功能对应自定义图片打印模板,可以由用户设置打印模板的参数以及对应的图片特征。试卷打印功能对应试卷打印模板,用于打印内容为试卷的图片。卡通贴打印功能对应卡通贴打印模板,用于按照预设拼接格式对多个内容为卡通贴的图片进行拼接并打印。趣味打印用于打印内容为对联、红包、特殊字等的图片。Exemplarily, as shown in FIG. 19A , in the function preview interface, when the mobile phone detects the operation of the user clicking more icons, the printing function interface shown in FIG. 19B is opened, and other printing functions are displayed on the printing function interface. For example, other printing functions include area printing function, custom picture printing function, test paper printing, cartoon sticker printing, and fun printing. Among them, the area printing function corresponds to the area printing template, which is used to print part of the picture. The custom picture printing function corresponds to a custom picture printing template, and the parameters of the printing template and the corresponding picture features can be set by the user. The test paper printing function corresponds to the test paper printing template, which is used to print the pictures of the test paper. The cartoon sticker printing function corresponds to the cartoon sticker printing template, which is used to stitch and print multiple pictures with cartoon stickers according to the preset stitching format. Fun Print is used to print pictures with couplets, red envelopes, special words, etc.

示例性地,若检测到点击“区域打印”的操作,则显示如图19C所示的图片展示界面。在图片展示界面展示图库中的图片时,若检测到选中图片的操作,则如图19D所示,在选中的图片上增加“√”的标记。手机在检测到选中图片的操作后,若检测到点击“确定”的操作,则打开如图19E所示的编辑界面。在编辑界面显示用户选中的图片以及编辑框195,编辑框内的部分图片即为待打印图片。用户可以缩放编辑框以改变选中区域的大小,也可以拖动编辑框以选择不同的区域作为待打印图片。在编辑界面,若手机检测到点击“完成”的操作,则将编辑框内的部分图片作为待打印图片,打开如图19F所示的区域打印界面。在区域打印界面显示编辑框内的部分图片,即为待打印图片。在区域打印界面,若检测到点击“开始打印”的操作,则手机根据区域打印模板对应的打印参数处理待打印图片,并指示打印机打印处理后的待打印图片。Exemplarily, if an operation of clicking "area print" is detected, a picture display interface as shown in FIG. 19C is displayed. When displaying pictures in the gallery on the picture display interface, if an operation of selecting a picture is detected, as shown in FIG. 19D , a “√” mark is added to the selected picture. After the mobile phone detects the operation of selecting a picture, if it detects the operation of clicking "OK", the editing interface shown in FIG. 19E is opened. The picture selected by the user and the editing box 195 are displayed on the editing interface, and some pictures in the editing box are pictures to be printed. The user can zoom the edit box to change the size of the selected area, or drag the edit box to select a different area as the image to be printed. In the editing interface, if the mobile phone detects the operation of clicking "Finish", it will take part of the pictures in the editing box as pictures to be printed, and open the area printing interface as shown in Figure 19F. Some pictures in the edit box are displayed on the regional print interface, which are pictures to be printed. In the area printing interface, if the operation of clicking "Start Printing" is detected, the mobile phone processes the picture to be printed according to the printing parameters corresponding to the area printing template, and instructs the printer to print the processed picture to be printed.

上述实施例中,由用户选择打印模板,而不用选择打印参数,降低由于参数选择错误导致的打印失败以及打印效果差的问题。In the above embodiment, the user selects the printing template instead of the printing parameters, which reduces the problems of printing failure and poor printing effect caused by wrong parameter selection.

下面对本申请实施例提供的图片打印方法的具体实现过程进行介绍。The specific implementation process of the picture printing method provided by the embodiments of the present application will be introduced below.

如图20所示,本申请实施例提供的图片打印方法应用于电子设备,电子设备与打印机通信连接,图片打印方法包括:As shown in FIG. 20 , the picture printing method provided by the embodiment of the present application is applied to an electronic device, and the electronic device is communicatively connected to a printer, and the picture printing method includes:

S2001:电子设备检测指示打印待打印图片的第一操作,其中,电子设备中具有一个或多个打印模板,一个打印模板对应一组打印参数,打印参数包括打印机参数以及图片处理参数。S2001: The electronic device detects a first operation instructing to print a picture to be printed, wherein the electronic device has one or more printing templates, one printing template corresponds to a set of printing parameters, and the printing parameters include printer parameters and picture processing parameters.

示例性地,第一操作是点击预设图标的操作,例如第一操作是如图1D、图3C、图4C、图5C、图6C、图7B、图8B所示的点击“打印”图标的操作。Exemplarily, the first operation is an operation of clicking a preset icon, for example, the first operation is clicking the “print” icon as shown in FIG. 1D , FIG. 3C , FIG. 4C , FIG. 5C , FIG. 6C , FIG. 7B , and FIG. 8B . operate.

在一实施例中,打印机参数包括纸张类型以及打印质量等。图片处理参数包括纸张尺寸、色彩、填充方式、缩放比例、排布方式中的一项或多项。In one embodiment, the printer parameters include paper type, print quality, and the like. The image processing parameters include one or more of paper size, color, filling method, scaling ratio, and arrangement method.

示例性地,多个打印模板分别为大图打印模板、长图打印模板、照片打印模板、寸照打印模板、拼图打印模板、身份证打印模板、普通图片打印模板等。Exemplarily, the multiple printing templates are respectively a large image printing template, a long image printing template, a photo printing template, an inch photo printing template, a puzzle printing template, an ID card printing template, an ordinary picture printing template, and the like.

其中,大图打印模板对应的打印参数中,纸张类型是普通纸,纸张尺寸是A4,打印质量是中质量,色彩是彩色,缩放比例是图片的宽度与A4纸的宽度的比值、图片的长度与A4纸的长度的比值中的最小值。Among them, in the printing parameters corresponding to the large image printing template, the paper type is plain paper, the paper size is A4, the printing quality is medium quality, the color is color, and the zoom ratio is the ratio of the width of the picture to the width of A4 paper, and the length of the picture. The smallest among the ratios to the length of A4 paper.

长图可以是手机界面的长截图,也可以是长度大于预设值的图片。长图打印模板对应的打印参数中,纸张类型是普通纸,纸张尺寸是A4,打印质量是中质量,色彩是彩色,缩放比例是图片的宽度与A4纸的宽度的比值。The long picture can be a long screenshot of the mobile phone interface, or a picture whose length is longer than a preset value. In the printing parameters corresponding to the long image printing template, the paper type is plain paper, the paper size is A4, the printing quality is medium quality, the color is color, and the zoom ratio is the ratio of the width of the picture to the width of A4 paper.

照片打印模板对应的打印参数中,纸张类型是相片纸,纸张质量是高质量,纸张尺寸是4*6英寸,色彩是彩色,填充方式是full,根据图片长宽比确定为横向排布或竖向排布。例如,图片的长度方向沿相片纸的长度方向,图片的宽度方向沿相片纸的宽度方向。In the printing parameters corresponding to the photo printing template, the paper type is photo paper, the paper quality is high quality, the paper size is 4*6 inches, the color is color, and the filling method is full. to the arrangement. For example, the length direction of the picture is along the length direction of the photo paper, and the width direction of the picture is along the width direction of the photo paper.

寸照打印模板对应的打印参数中,纸张类型是相片纸,纸张质量是高质量,纸张尺寸是4*6英寸,色彩是彩色,排布方式是纵向,相片纸上的寸照数量根据寸照的尺寸以及纸张尺寸确定。例如,寸照的尺寸是1寸,相片纸上的寸照数量为6。In the printing parameters corresponding to the inch photo printing template, the paper type is photo paper, the paper quality is high quality, the paper size is 4*6 inches, the color is color, the arrangement method is vertical, and the number of inch photos on the photo paper is based on the inch photos. size and paper size. For example, the size of an inch photo is 1 inch, and the number of inch photos on photo paper is 6.

拼图打印模板对应的打印参数中,纸张类型是相片纸,纸张质量是高质量,纸张尺寸是4*6英寸,色彩是彩色,拼图样式由拼接前的各图片的尺寸确定。In the printing parameters corresponding to the puzzle printing template, the paper type is photo paper, the paper quality is high quality, the paper size is 4*6 inches, the color is color, and the puzzle style is determined by the size of each picture before splicing.

身份证打印模板对应的打印参数中,纸张类型是普通纸,纸张尺寸是A4,打印质量是中质量,色彩是黑白,身份证正面图片和身份证反面图片上下排布,图片居中。In the printing parameters corresponding to the ID card printing template, the paper type is plain paper, the paper size is A4, the printing quality is medium quality, and the color is black and white.

普通图片打印模板对应的打印参数中,纸张类型是普通纸,纸张尺寸是A4,打印质量是中质量,色彩是彩色,填充方式是fitcenter, 根据图片长宽比确定为横向排布或竖向排布。例如,图片的长度方向沿A4纸的长度方向,图片的宽度方向沿A4纸的宽度方向。In the printing parameters corresponding to the ordinary picture printing template, the paper type is plain paper, the paper size is A4, the printing quality is medium quality, the color is color, the filling method is fitcenter, and the horizontal arrangement or vertical arrangement is determined according to the aspect ratio of the picture. cloth. For example, the length direction of the picture is along the length direction of A4 paper, and the width direction of the picture is along the width direction of the A4 paper.

风景图打印模板对应的打印参数中,纸张类型是普通纸,纸张尺寸是A4,打印质量是中质量,色彩是彩色,根据图片长宽比确定为横向排布或竖向排布。In the print parameters corresponding to the landscape print template, the paper type is plain paper, the paper size is A4, the print quality is medium quality, and the color is color. According to the aspect ratio of the picture, it is determined as horizontal arrangement or vertical arrangement.

试卷打印模板对应的打印参数中,纸张类型是普通纸,纸张尺寸是A4,打印质量是低质量,色彩是黑白,竖向排布。In the printing parameters corresponding to the test paper printing template, the paper type is plain paper, the paper size is A4, the printing quality is low quality, the color is black and white, and the layout is vertical.

S2002、响应于第一操作,电子设备从一个或多个打印模板中确定待打印图片对应的目标打印模板。S2002. In response to the first operation, the electronic device determines a target printing template corresponding to the picture to be printed from one or more printing templates.

具体地,电子设备在检测到第一操作后,可以根据待打印图片确定目标打印模板。电子设备在检测到第一操作后,也可以输出一个或多个打印模板,接收用户选择的打印模板,将用户选择的打印模板作为目标打印模板。Specifically, after detecting the first operation, the electronic device may determine the target printing template according to the picture to be printed. After detecting the first operation, the electronic device may also output one or more print templates, receive the print template selected by the user, and use the print template selected by the user as the target print template.

S2003、电子设备采用目标打印模板对应的图片处理参数处理待打印图片,得到处理后的待打印图片。S2003 , the electronic device processes the picture to be printed by using the picture processing parameters corresponding to the target printing template, and obtains the processed picture to be printed.

具体地,电子设备根据图片处理参数对待打印图片进行处理,包括电子设备根据图片处理参数将待打印图片绘制在与纸张尺寸一致的图片上,再将与纸张尺寸一致的图片转换成PDF格式的文档。Specifically, the electronic device processes the to-be-printed picture according to the picture processing parameters, including the electronic device drawing the to-be-printed picture on a picture consistent with the paper size according to the picture processing parameters, and then converting the picture consistent with the paper size into a document in PDF format .

示例性地,若确定目标打印模板是大图打印模板,在检测到打印指令时,根据缩放比例对待打印图片进行缩放,根据缩放后的图片与A4纸的尺寸确定裁剪数量。根据裁剪数量对待打印图片进行裁剪,得到多张子图。根据打印模板中的排布方式以及色彩将各子图分别绘制在与纸张尺寸一致的图片上,再将各图片分别转换成PDF格式的文档。通过将大图裁剪为多张子图,分别打印各子图,相对于将一张大图打印在一张纸上,可以减少打印过程中丢失的图片细节,提高打印效果。Exemplarily, if it is determined that the target printing template is a large image printing template, when a printing instruction is detected, the to-be-printed picture is scaled according to the scaling ratio, and the cropping quantity is determined according to the scaled picture and the size of A4 paper. Crop the picture to be printed according to the crop number to obtain multiple sub-pictures. According to the layout and color in the print template, draw each sub-picture on a picture that is the same size as the paper, and then convert each picture into a PDF format document. By cutting the large image into multiple sub-images and printing each sub-image separately, compared with printing one large image on one sheet of paper, it can reduce the image details lost during the printing process and improve the printing effect.

在一实施例中,对待打印图片进行缩放后,确定缩放后的图片的长度与A4纸的长度的第一比值,以及缩放后的图片的宽度与A4纸的宽度的第二比值,第一比值取整后加1得到缩放后的图片在横向上的裁剪数量,第二比值取整后加1得到缩放后的图片在纵向上的裁剪数量,横向上的裁剪数量与纵向上的裁剪数量的乘积即为最终的裁剪数量。In one embodiment, after scaling the picture to be printed, a first ratio of the length of the scaled picture to the length of A4 paper, and a second ratio of the width of the scaled picture to the width of A4 paper, the first ratio is determined. After rounding, add 1 to get the cropped number of the scaled picture in the horizontal direction. After the second ratio is rounded, add 1 to get the cropped number of the scaled picture in the vertical direction. The product of the cropped amount in the horizontal direction and the cropped amount in the vertical direction is the final cropping number.

若确定打印模板是长图打印模板,在接收到打印指令时,根据缩放比例对待打印图片进行缩放,根据缩放后的图片与A4纸的尺寸确定裁剪数量。根据裁剪数量在长度方向上对待打印图片进行裁剪,得到多个子图。根据打印模板中的排布方式以及色彩将各子图分别绘制在与纸张尺寸一致的图片上,再将各图片分别转换成PDF格式的文档。通过将长图在长度方向上裁剪为多个子图,分别打印各子图,相对于将一张长图打印在一张纸上,可以减少打印过程中丢失的图片细节,提高打印效果。If it is determined that the printing template is a long-image printing template, when receiving the printing instruction, the to-be-printed picture is scaled according to the scaling ratio, and the cropping quantity is determined according to the scaled picture and the size of A4 paper. The to-be-printed picture is cropped in the length direction according to the cropping quantity to obtain multiple sub-pictures. According to the layout and color in the print template, draw each sub-picture on a picture that is the same size as the paper, and then convert each picture into a PDF format document. By cutting the long image into multiple sub-images in the length direction, and printing each sub-image separately, compared with printing one long image on one sheet of paper, it can reduce the lost image details during the printing process and improve the printing effect.

若确定打印模板是照片打印模板,在检测到打印指令时,根据待打印图片的长宽比确定排布方式,再根据排布方式、色彩和填充方式将待打印图片绘制在与纸张尺寸一致的图片上,再将图片转换成PDF格式的文档。If it is determined that the print template is a photo print template, when a print instruction is detected, the arrangement method is determined according to the aspect ratio of the picture to be printed, and then the picture to be printed is drawn in a size consistent with the paper size according to the arrangement method, color and filling method. On the picture, and then convert the picture into a PDF document.

若确定打印模板是寸照打印模板,在检测到打印指令时,根据纸张尺寸以及寸照尺寸确定纸张上排布的寸照的数量。之后,根据数量、色彩以及排布方式将多张寸照绘制在与纸张尺寸一致的图片上,再将图片转换成PDF格式的文档。If it is determined that the printing template is an inch photo printing template, when a print instruction is detected, the number of inch photos arranged on the paper is determined according to the paper size and the inch photo size. After that, according to the quantity, color and arrangement, draw multiple inch photos on the pictures that are the same size as the paper, and then convert the pictures into PDF format documents.

若确定打印模板是拼图打印模板,在检测到打印指令时,根据各待打印图片的尺寸确定拼图模板,根据拼图模板对各待打印图片进行拼接,得到拼接后的图片。再根据色彩将拼接后的图片绘制在与纸张尺寸一致的图片上,再将图片转换成PDF格式的文档。If it is determined that the print template is a jigsaw print template, when a print instruction is detected, a jigsaw template is determined according to the size of each picture to be printed, and each picture to be printed is spliced according to the jigsaw template to obtain a stitched picture. Then draw the spliced picture on the picture that is the same size as the paper according to the color, and then convert the picture into a document in PDF format.

在一实施例中,也可以根据待打印图片的数量确定对应的拼图模板,根据拼图模板对各待打印图片进行缩放,对缩放后的图片进行拼接,得到拼接后的图片。在一实施例中,也可以根据各待打印图片的选中顺序,对各待打印图片依次拼接得到拼接后的图片。在一实施例中,在确定打印模板是拼图打印模板后,获取用户选择的拼图模板和/或拼接顺序的信息,根据用户选择的拼图模板对各待打印图片进行缩放,对缩放后的图片进行拼接,得到拼接后的图片。In one embodiment, a corresponding jigsaw template may also be determined according to the number of pictures to be printed, each picture to be printed is scaled according to the jigsaw template, and the scaled pictures are stitched to obtain a stitched picture. In an embodiment, according to the selection order of the pictures to be printed, the pictures to be printed can be spliced in sequence to obtain the spliced pictures. In one embodiment, after it is determined that the printing template is a jigsaw printing template, the information of the jigsaw template and/or the splicing order selected by the user is obtained, each picture to be printed is scaled according to the jigsaw template selected by the user, and the scaled pictures are scaled. Stitching to get the stitched picture.

若确定打印模板是身份证打印模板,在检测到打印指令时,将身份证正面图片和身份证反面图片进行拼接,再根据排布方式和色彩将拼接后的图片绘制在与纸张尺寸一致的图片上,再将图片转换成PDF格式的文档。If it is determined that the printing template is an ID card printing template, when the print instruction is detected, the front image of the ID card and the back image of the ID card are spliced together, and then the spliced image is drawn on the image that is consistent with the paper size according to the arrangement and color. , and then convert the image into a document in PDF format.

若确定打印模板是普通图片打印模板,在检测到打印指令时,根据待打印图片的长宽比确定排布方式,再根据排布方式、填充方式和色彩将待打印图片绘制在与纸张尺寸一致的图片上,再将图片转换成PDF格式的文档。If it is determined that the print template is an ordinary picture print template, when a print instruction is detected, the arrangement method is determined according to the aspect ratio of the picture to be printed, and then the picture to be printed is drawn in the same size as the paper size according to the arrangement method, filling method and color. image, and then convert the image into a document in PDF format.

若确定打印模板是风景图打印模板或试卷打印模板,在检测到打印指令时,根据排布方式和色彩将待打印图片绘制在与纸张尺寸一致的图片上,再将图片转换成PDF格式的文档。If it is determined that the print template is a landscape print template or a test paper print template, when a print instruction is detected, the to-be-printed image will be drawn on the image that is the same size as the paper according to the layout and color, and then the image will be converted into a document in PDF format .

在一实施例中,风景图打印模板或试卷打印模板的打印参数还包括亮度、对比度等图像调节参数。若确定打印模板是风景图打印模板或试卷打印模板,对待打印图片的处理还包括根据对应的亮度、对比度等参数对待打印图片进行调整,从而提高打印效果。In one embodiment, the printing parameters of the landscape image printing template or the test paper printing template further include image adjustment parameters such as brightness and contrast. If it is determined that the printing template is a landscape image printing template or a test paper printing template, the processing of the to-be-printed picture also includes adjusting the to-be-printed picture according to corresponding parameters such as brightness and contrast, thereby improving the printing effect.

在一实施例中,电子设备采用目标打印模板对应的图片处理参数处理待打印图片后,在显示界面上显示处理后的待打印图片,以便用户查看处理效果。In one embodiment, after the electronic device processes the picture to be printed by using the picture processing parameters corresponding to the target printing template, the processed picture to be printed is displayed on the display interface, so that the user can check the processing effect.

在另一实施例中,电子设备在确定目标打印模板后,输出目标打印模板对应的打印参数。其中,输出打印参数可以是语音提示打印参数,也可以是在显示界面上显示,以便于用户对打印参数进行确认。电子设备在输出目标打印模板对应的打印参数后,若检测到打印指令,采用目标打印模板对应的图片处理参数处理待打印图片。示例性地,参考图1E、图3D、图4D、图5D、图6D、图7C、图8C,电子设备确定目标打印模板后,在显示界面显示目标打印模板对应的打印参数,在检测到点击“开始打印”的操作时,采用目标打印模板对应的图片处理参数处理待打印图片。In another embodiment, after determining the target printing template, the electronic device outputs the printing parameters corresponding to the target printing template. The output printing parameters may be voice prompts for printing parameters, or may be displayed on a display interface, so as to facilitate the user to confirm the printing parameters. After outputting the printing parameters corresponding to the target printing template, if the electronic device detects a printing instruction, the electronic device uses the picture processing parameters corresponding to the target printing template to process the to-be-printed picture. Exemplarily, referring to Figure 1E, Figure 3D, Figure 4D, Figure 5D, Figure 6D, Figure 7C, Figure 8C, after the electronic device determines the target printing template, it displays the printing parameters corresponding to the target printing template on the display interface. During the "start printing" operation, the image to be printed is processed using the image processing parameters corresponding to the target print template.

在一实施例中,电子设备在输出目标打印模板对应的打印参数后,检测针对目标打印模板对应的打印参数的修改操作,在修改操作指示修改目标打印模板对应的图片处理参数的情况下,采用目标打印模板对应的修改后的图片处理参数处理待打印图片,得到处理后的待打印图片。示例性地,参考图1E和图1F,若检测到修改图片处理参数,则在检测到点击“开始打印”的操作时,采用目标打印模板对应的修改后的图片处理参数处理待打印图片。In one embodiment, after outputting the printing parameters corresponding to the target printing template, the electronic device detects a modification operation for the printing parameters corresponding to the target printing template, and when the modification operation instructs to modify the image processing parameters corresponding to the target printing template, adopts The modified image processing parameters corresponding to the target printing template process the to-be-printed image to obtain the processed to-be-printed image. 1E and 1F, if it is detected to modify the picture processing parameters, when the operation of clicking "start printing" is detected, the picture to be printed is processed using the modified picture processing parameters corresponding to the target printing template.

S2004、电子设备向打印机发送处理后的待打印图片以及目标打印模板对应的所述打印机参数。S2004, the electronic device sends the processed picture to be printed and the printer parameters corresponding to the target printing template to the printer.

具体地,电子设备将根据处理后的待打印图片得到的PDF格式的文档以及打印机参数发送至与电子设备通信连接的打印机,打印机按照打印机参数打印PDF格式的文档。其中,接收打印指示的打印机可以根据打印模板确定,也可以根据用户的打印机选择指令确定。Specifically, the electronic device sends the document in PDF format obtained according to the processed picture to be printed and the printer parameters to a printer that is communicatively connected to the electronic device, and the printer prints the document in PDF format according to the printer parameters. The printer that receives the print instruction may be determined according to the print template, or may be determined according to the user's printer selection instruction.

若待打印图片被分割为多张子图,则电子设备指示打印机依次打印处理后的各子图。例如,若待打印图片是大图,电子设备根据图片处理参数对待打印图片进行处理,得到多张子图,将多张子图分别转换成PDF格式的文档,将各子图对应的PDF格式的文档以及打印机参数发送至打印机。If the picture to be printed is divided into multiple sub-images, the electronic device instructs the printer to print the processed sub-images in sequence. For example, if the image to be printed is a large image, the electronic device processes the image to be printed according to the image processing parameters, obtains multiple sub-images, converts the multiple sub-images into PDF-format documents, and converts the PDF-format documents and printer parameters corresponding to each sub-image. sent to the printer.

在一实施例中,电子设备在输出目标打印模板对应的打印参数后,若检测到打印参数的修改操作指示修改目标打印模板对应的打印机参数的情况下,向打印机发送处理后的待打印图片,以及目标打印模板对应的修改后的打印机参数,从而方便用户灵活选择打印方式,提高用户体验。In one embodiment, after outputting the printing parameters corresponding to the target printing template, the electronic device sends the processed picture to be printed to the printer if it detects that the modification operation of the printing parameters instructs to modify the printer parameters corresponding to the target printing template, and the modified printer parameters corresponding to the target printing template, so as to facilitate the user to flexibly select the printing method and improve the user experience.

本申请实施例中,在检测到指示打印待打印图片的第一操作的情况下,电子设备先确定打印该待打印图片时采用的目标打印模板,由于每个打印模板对应一组图片处理参数,因此后续电子设备可以基于目标打印模板对应的图片处理参数对待打印图片进行处理,之后指示打印机打印处理后的待打印图片,该方案由于每个打印模板都对应一组打印参数,因此使用该方法打印图片时可以避免用户输入打印参数,相对于选择打印参数,选择打印模板可以降低由于参数选择错误导致的打印失败以及打印效果差的问题。In the embodiment of the present application, in the case of detecting the first operation instructing to print the picture to be printed, the electronic device first determines the target printing template used when printing the picture to be printed. Since each printing template corresponds to a set of picture processing parameters, Therefore, the subsequent electronic device can process the to-be-printed image based on the image processing parameters corresponding to the target print template, and then instruct the printer to print the processed to-be-printed image. In this solution, since each print template corresponds to a set of print parameters, this method is used to print The user can avoid inputting printing parameters when taking pictures. Compared with selecting printing parameters, selecting a printing template can reduce the problems of printing failure and poor printing effect caused by wrong parameter selection.

在一实施例中,本申请实施例中的S2002可以通过以下方式实现:In an embodiment, S2002 in this embodiment of the present application may be implemented in the following manner:

响应于第一操作,电子设备根据待打印图片的数量以及特征,从一个或多个打印模板中确定待打印图片对应的目标打印模板。其中,待打印图片的特征包括待打印图片的尺寸、像素、内容、分辨率中的任意一项或多项。待打印图片的尺寸指待打印图片的高度和宽度,待打印图片的内容可以为身份证、寸照、风景、半身照、试卷等中的一项。In response to the first operation, the electronic device determines a target printing template corresponding to the picture to be printed from one or more printing templates according to the number and characteristics of the picture to be printed. The characteristics of the picture to be printed include any one or more of the size, pixels, content, and resolution of the picture to be printed. The size of the picture to be printed refers to the height and width of the picture to be printed, and the content of the picture to be printed can be one of ID cards, inch photos, landscapes, half-length photos, test papers, etc.

由于打印模板是根据待打印图片的数量以及特征确定的,因此,与打印模板对应的打印参数与待打印图片的匹配度更好,根据打印模板对应的打印参数对待打印图片进行处理后再进行打印,可以得到更好的打印效果。Since the printing template is determined according to the number and characteristics of the pictures to be printed, the matching degree between the printing parameters corresponding to the printing template and the pictures to be printed is better, and the pictures to be printed are processed according to the printing parameters corresponding to the printing template before printing. , you can get better printing effect.

电子设备可以通过读取待打印图片的属性信息,确定待打印图片的尺寸以及分辨率。电子设备也可以通过对待打印图片进行特征提取,确定待打印图片的尺寸以及分辨率。The electronic device can determine the size and resolution of the to-be-printed image by reading the attribute information of the to-be-printed image. The electronic device can also determine the size and resolution of the to-be-printed image by performing feature extraction on the to-be-printed image.

在一实施例中,电子设备采用图像识别模型识别待打印图片的内容。其中,图像识别模型是深度卷积网络模板,例如,图像识别模型为ResNet34模型。示例性地,图像识别模型是经过训练后得到。该图像识别模型可以是电子设备训练得到的,也可以是服务器训练得到的,然后由电子设备从服务器处获取,本申请实施例对此不做限定。下述以电子设备训练图像识别模型为例,描述训练图像识别模型的具体过程。具体地,电子设备采集样本图片,为样本图像设定标签,样本图像的标签包括寸照、风景、人物、动物、试卷等。将样本图片以及对应的标签输入分类模型,以优化分类模型的参数。在达到训练终止条件时,得到最优参数,根据最优参数即可得到图像识别模型。后续,电子设备将待打印图片输入图像识别模型,即可得到待打印图片的内容。In one embodiment, the electronic device uses an image recognition model to recognize the content of the picture to be printed. The image recognition model is a deep convolutional network template, for example, the image recognition model is the ResNet34 model. Exemplarily, the image recognition model is obtained after training. The image recognition model may be obtained by training on an electronic device, or may be obtained by training on a server, and then obtained by the electronic device from the server, which is not limited in this embodiment of the present application. The following describes the specific process of training the image recognition model by taking the electronic equipment training image recognition model as an example. Specifically, the electronic device collects sample pictures, sets labels for the sample images, and the labels of the sample images include inch photos, landscapes, people, animals, test papers, and the like. Input the sample images and corresponding labels into the classification model to optimize the parameters of the classification model. When the training termination condition is reached, the optimal parameters are obtained, and the image recognition model can be obtained according to the optimal parameters. Subsequently, the electronic device inputs the picture to be printed into the image recognition model, and then the content of the picture to be printed can be obtained.

在一实施例中,在确定待打印图片后,识别待打印图片的特征,根据待打印图片的数量以及特征与打印模板对应的数量以及特征的关系,确定打印模板。In one embodiment, after the pictures to be printed are determined, the features of the pictures to be printed are identified, and the print templates are determined according to the number of pictures to be printed and the relationship between the features and the numbers and features corresponding to the print templates.

具体地,若待打印图片的数量为1,待打印图片的像素大于第一预设像素,待打印图片的宽度和高度的比值在第一预设范围内,待打印图片的分辨率大于或者等于第一预设分辨率,则确定待打印图片的特征符合大图打印模板对应的特征,目标打印模板为大图打印模板。示例性地,待打印图片的数量为1,待打印图片在高度方向上的像素和在宽度方向上的像素均大于10K像素,待打印图片的宽度和高度的比值小于0.5或大于2,待打印图片的水平分辨率或者垂直分辨率大于或等于300dpi,则确定目标打印模板为大图打印模板。其中,大图打印模板用于根据裁剪数量对待打印图片进行裁剪,得到与待打印图片对应的至少两张子图,从而避免在打印过程中丢失待打印图片的细节,得到更好的打印效果。Specifically, if the number of pictures to be printed is 1, the pixels of the picture to be printed are larger than the first preset pixel, the ratio of the width and height of the picture to be printed is within the first preset range, and the resolution of the picture to be printed is greater than or equal to For the first preset resolution, it is determined that the characteristics of the picture to be printed conform to the characteristics corresponding to the large image printing template, and the target printing template is the large image printing template. Exemplarily, the number of pictures to be printed is 1, the pixels in the height direction and the pixels in the width direction of the pictures to be printed are both greater than 10K pixels, the ratio of the width and height of the pictures to be printed is less than 0.5 or greater than 2, and the pixels to be printed are If the horizontal resolution or vertical resolution of the picture is greater than or equal to 300dpi, it is determined that the target printing template is a large-picture printing template. The large image printing template is used to cut the to-be-printed image according to the number of cuts to obtain at least two sub-images corresponding to the to-be-printed image, so as to avoid losing details of the to-be-printed image during the printing process and obtain better printing effects.

若待打印图片的数量为1,待打印图片的尺寸与电子设备的屏幕的尺寸满足预设关系,则确定待打印图片的特征符合长图打印模板对应的特征,确定目标打印模板为长图打印模板。示例性地,待打印图片的数量为1,待打印图片的宽度与手机屏幕的宽度相等,待打印图片的高度大于1.5倍屏幕高度,则确定打目标打印模板为长图打印模板。长图打印模板用于在长度方向上对待打印图片进行裁剪,得到与待打印图片对应的至少两张子图,从而可以避免在打印过程中对长图的缩放比例不合理造成打印效果差的问题。If the number of pictures to be printed is 1, and the size of the picture to be printed and the size of the screen of the electronic device satisfy the preset relationship, it is determined that the characteristics of the picture to be printed conform to the characteristics corresponding to the long-picture printing template, and the target printing template is determined to be long-picture printing. template. Exemplarily, if the number of pictures to be printed is 1, the width of the picture to be printed is equal to the width of the mobile phone screen, and the height of the picture to be printed is greater than 1.5 times the screen height, the target printing template is determined to be a long-image printing template. The long image printing template is used to cut the to-be-printed image in the length direction to obtain at least two sub-images corresponding to the to-be-printed image, so as to avoid the problem of poor printing effect caused by unreasonable scaling of the long image during the printing process.

若待打印图片的数量为1,待打印图片的内容和背景满足预设条件,则确定待打印图片的特征符合寸照打印模板对应的特征,确定目标打印模板为寸照打印模板。示例性地,若待打印图片的内容为人物半身照,且待打印图片的背景为纯蓝、纯白、纯红中的一种,则确定待打印图片为寸照,目标打印模板为寸照打印模板。寸照打印模板用于将多张待打印图片绘制于一张图片上,从而可以在一张照片纸上打印多个寸照。If the number of pictures to be printed is 1, and the content and background of the picture to be printed meet the preset conditions, it is determined that the characteristics of the picture to be printed conform to the characteristics corresponding to the inch photo printing template, and the target printing template is determined to be the inch photo printing template. Exemplarily, if the content of the picture to be printed is a portrait of a person, and the background of the picture to be printed is one of pure blue, pure white, and pure red, then it is determined that the picture to be printed is an inch photo, and the target printing template is an inch photo. Print the template. The inch photo printing template is used to draw multiple pictures to be printed on one picture, so that multiple inch photos can be printed on one photo paper.

示例性地,若待打印图片的数量为1,待打印图片再高度方向上的像素或在宽度方向上的像素大于6K像素,待打印图片的宽度和高度的比值,与4*6英寸的相片纸的宽高比之间的差值小于或等于0.15,待打印图片的水平分辨率或垂直分辨率大于150dpi,则确定待打印图片的特征符合照片打印模板对应的特征,确定目标打印模板为照片打印模板。照片打印模板用于按照相片纸的尺寸对打印图片进行缩放,以将待打印图片打印在相片纸上。Exemplarily, if the number of pictures to be printed is 1, the pixels in the height direction of the picture to be printed or the pixels in the width direction are greater than 6K pixels, the ratio of the width and height of the picture to be printed, and the photo of 4*6 inches. The difference between the aspect ratios of the paper is less than or equal to 0.15, and the horizontal resolution or vertical resolution of the picture to be printed is greater than 150dpi, then it is determined that the characteristics of the picture to be printed conform to the characteristics corresponding to the photo printing template, and the target printing template is determined to be a photo Print the template. The photo printing template is used to scale the print image according to the size of the photo paper, so that the to-be-printed image can be printed on the photo paper.

若待打印图片的数量大于1,待打印图片的像素大于第二预设像素,待打印图片的宽度和高度的比值在第二预设范围内,待打印图片的分辨率大于或者等于第二预设分辨率,则确定待打印图片的特征符合拼图打印模板对应的特征,确定目标打印模板为拼图打印模板。示例性地,若待打印图片的数量大于1,待打印图片在高度方向上的像素或在宽度方向上的像素大于6K像素,待打印图片的宽度和高度的比值,与4*6英寸的相片纸的宽高比之间的差值小于或等于0.15,待打印图片的水平分辨率或垂直分辨率大于150dpi,则确定目标打印模板为拼图打印模板。拼图打印模板用于拼接待打印图片,得到拼接后的图片。If the number of pictures to be printed is greater than 1, the pixels of the picture to be printed are greater than the second preset pixel, the ratio of the width and height of the picture to be printed is within the second preset range, and the resolution of the picture to be printed is greater than or equal to the second preset pixel If the resolution is set, it is determined that the characteristics of the picture to be printed conform to the characteristics corresponding to the puzzle printing template, and the target printing template is determined to be the puzzle printing template. Exemplarily, if the number of pictures to be printed is greater than 1, the pixels in the height direction of the picture to be printed or the pixels in the width direction are greater than 6K pixels, the ratio of the width and height of the picture to be printed, and the 4*6 inch photo If the difference between the aspect ratios of the paper is less than or equal to 0.15, and the horizontal resolution or vertical resolution of the picture to be printed is greater than 150dpi, the target printing template is determined as a puzzle printing template. The jigsaw print template is used to assemble the pre-printed pictures to obtain the stitched pictures.

示例性地,若待打印图片的数量为2,待打印图片的内容分别为身份证的正面图片和反面图片,则确定待打印图片的特征符合身份证打印模板对应的特征,确定打印模板为身份证打印模板。Exemplarily, if the number of pictures to be printed is 2, and the content of the pictures to be printed is respectively the front picture and the back picture of the ID card, then it is determined that the characteristics of the picture to be printed conform to the corresponding characteristics of the ID card printing template, and the printing template is determined to be the identity. certificate printing template.

若待打印图片的数量为1,待打印图片不符合上述照片打印模板对应的尺寸和分辨率,则识别待打印图片的内容。若待打印图片的内容为风景,则确定待打印图片的特征符合风景图打印模板对应的特征,确定打印模板为风景图打印模板。若待打印图片的内容为试卷,则确定待打印图片的特征符合试卷打印模板对应的特征,确定打印模板为试卷打印模板。If the number of pictures to be printed is 1, and the picture to be printed does not conform to the size and resolution corresponding to the above photo printing template, the content of the picture to be printed is identified. If the content of the picture to be printed is landscape, it is determined that the characteristics of the picture to be printed conform to the characteristics corresponding to the landscape image printing template, and the printing template is determined to be a landscape image printing template. If the content of the picture to be printed is the test paper, it is determined that the characteristics of the picture to be printed conform to the characteristics corresponding to the test paper printing template, and the printing template is determined to be the test paper printing template.

如图21所示,在一实施例中,电子设备确定目标打印模板的流程包括:As shown in FIG. 21, in one embodiment, the process of determining the target printing template by the electronic device includes:

S2101:确定待打印图片。S2101: Determine the picture to be printed.

S2102:判断是否多张待打印图片。S2102: Determine whether there are multiple pictures to be printed.

S2103:若是多张待打印图片,判断待打印图片的内容是否是身份证。S2103: If there are multiple pictures to be printed, determine whether the content of the pictures to be printed is an ID card.

其中,该步骤为可选步骤,电子设备在确定是多张待打印图片后,可以直接判断均符合照片打印模板对应的特征。Wherein, this step is an optional step. After determining that there are multiple pictures to be printed, the electronic device can directly determine that they all meet the characteristics corresponding to the photo printing template.

S2104:若待打印图片的内容是身份证的正面和反面,确定目标打印模板是身份证打印模板。S2104: If the content of the picture to be printed is the front and back of the ID card, determine that the target printing template is the ID card printing template.

示例性地,参考图7A至图7C,待打印图片的内容是身份证的正面和反面,确定目标打印模板是身份证打印模板。Exemplarily, referring to FIGS. 7A to 7C , the content of the picture to be printed is the front side and the back side of the ID card, and it is determined that the target printing template is the ID card printing template.

S2105:若待打印图片的内容不是身份证的正面和反面,判断待打印图片的特征是否均符合照片打印模板对应的特征。S2105: If the content of the picture to be printed is not the front and back of the ID card, determine whether the features of the picture to be printed all conform to the features corresponding to the photo printing template.

S2106:若待打印图片的特征均符合照片打印模板对应的特征,确定目标打印模板是拼图打印模板。S2106: If the features of the picture to be printed all conform to the features corresponding to the photo print template, determine that the target print template is a puzzle print template.

示例性地,参考图8A至图8C,待打印图片的特征均符合照片打印模板对应的特征,确定目标打印模板是拼图打印模板。Exemplarily, referring to FIGS. 8A to 8C , the characteristics of the pictures to be printed all conform to the characteristics corresponding to the photo printing template, and it is determined that the target printing template is a jigsaw printing template.

S2107:若存在特征不符合照片打印模板对应的特征的待打印图片,确定目标打印模板是普通图片打印模板。S2107: If there is a to-be-printed picture whose characteristics do not conform to the characteristics corresponding to the photo printing template, determine that the target printing template is a common picture printing template.

S2108:若不是多张待打印图片,即是一张待打印图片,判断待打印图片的特征是否符合大图打印模板对应的特征。S2108: If there are not multiple pictures to be printed, that is, one picture to be printed, determine whether the features of the picture to be printed conform to the features corresponding to the large-picture printing template.

其中,该步骤为可选步骤,电子设备在确定是一张待打印图片后,可以直接判断是否符合长图打印模板对应的特征,或者直接识别待打印图片的内容。Wherein, this step is an optional step. After determining that the electronic device is a picture to be printed, it can directly determine whether it conforms to the characteristics corresponding to the long picture printing template, or directly identify the content of the picture to be printed.

S2109:若待打印图片的特征符合大图打印模板对应的特征,确定目标打印模板是大图打印模板。S2109: If the characteristics of the picture to be printed conform to the characteristics corresponding to the large image printing template, determine that the target printing template is the large image printing template.

示例性地,参考图1A至图1F,待打印图片的特征符合大图打印模板对应的特征,确定目标打印模板是大图打印模板。Exemplarily, referring to FIGS. 1A to 1F , the characteristics of the picture to be printed conform to the characteristics corresponding to the large-image printing template, and it is determined that the target printing template is the large-image printing template.

S2110:若待打印图片的特征不符合大图打印模板对应的特征,判断待打印图片的特征是否符合长图打印模板对应的特征。S2110: If the features of the to-be-printed picture do not conform to the features corresponding to the large-picture printing template, determine whether the features of the to-be-printed picture conform to the features corresponding to the long-picture printing template.

其中,该步骤为可选步骤,电子设备在确定是一张待打印图片后,可以直接识别待打印图片的内容。Wherein, this step is an optional step, after the electronic device determines that it is a picture to be printed, it can directly identify the content of the picture to be printed.

S2111:若待打印图片的特征符合长图打印模板对应的特征,确定目标打印模板是长图打印模板。S2111: If the characteristics of the picture to be printed conform to the characteristics corresponding to the long-image printing template, determine that the target printing template is the long-image printing template.

示例性地,参考图3A至图3D,待打印图片的特征符合长图打印模板对应的特征,确定目标打印模板是长图打印模板。Exemplarily, referring to FIGS. 3A to 3D , the characteristics of the picture to be printed conform to the characteristics corresponding to the long-image printing template, and it is determined that the target printing template is the long-image printing template.

S2112:若待打印图片的特征不符合长图打印模板对应的特征,判断待打印图片的特征是否符合照片打印模板对应的特征。S2112: If the feature of the picture to be printed does not conform to the feature corresponding to the long image printing template, determine whether the feature of the picture to be printed conforms to the feature corresponding to the photo printing template.

其中,该步骤为可选步骤,电子设备在确定是一张待打印图片后,可以直接识别待打印图片的内容。Wherein, this step is an optional step, after the electronic device determines that it is a picture to be printed, it can directly identify the content of the picture to be printed.

S2113:若待打印图片的特征符合照片打印模板对应的特征,确定目标打印模板是照片打印模板。S2113: If the characteristics of the picture to be printed conform to the characteristics corresponding to the photo printing template, determine that the target printing template is the photo printing template.

示例性地,参考图6A至图6D,待打印图片的特征符合照片打印模板对应的特征,确定目标打印模板是照片打印模板。Exemplarily, referring to FIGS. 6A to 6D , the characteristics of the picture to be printed conform to the characteristics corresponding to the photo printing template, and it is determined that the target printing template is the photo printing template.

S2114:若待打印图片的特征不符合照片打印模板对应的特征,识别待打印图片的内容。S2114: If the characteristics of the picture to be printed do not conform to the characteristics corresponding to the photo printing template, identify the content of the picture to be printed.

S2115:若待打印图片的内容是寸照,确定目标打印模板是寸照打印模板。S2115: If the content of the picture to be printed is an inch photo, determine that the target printing template is an inch photo printing template.

示例性地,参考图4A至图4D,待打印图片的特征符合寸照打印模板对应的特征,确定目标打印模板是寸照打印模板。Exemplarily, with reference to FIGS. 4A to 4D , the characteristics of the picture to be printed conform to the characteristics corresponding to the inch photo printing template, and it is determined that the target printing template is the inch photo printing template.

S2116:若待打印图片的内容是试卷,确定目标打印模板是试卷打印模板。S2116: If the content of the picture to be printed is the test paper, determine that the target printing template is the test paper printing template.

S2117:若待打印图片的内容是风景图,确定目标打印模板是风景图打印模板。S2117: If the content of the picture to be printed is a landscape image, determine that the target print template is a landscape image print template.

示例性地,参考图5A至图5D,待打印图片的特征符合风景图打印模板对应的特征,确定目标打印模板是风景图打印模板。Exemplarily, referring to FIGS. 5A to 5D , the characteristics of the picture to be printed conform to the characteristics corresponding to the landscape image printing template, and it is determined that the target printing template is a landscape image printing template.

S2118:若待打印图片的内容不是寸照、试卷、风景图,确定目标打印模板是普通图片打印模板。S2118: If the content of the picture to be printed is not an inch photo, a test paper, or a landscape picture, determine that the target printing template is an ordinary picture printing template.

可选的,在电子设备根据待打印图片的数量以及特征确定出目标打印模板之后,还可以在电子设备的显示界面上提示用户是否选择该目标打印模板。如果接收到用户输入的选择该目标打印模板的指示,则电子设备以目标打印模板对应的打印参数处理待打印图片。如果接收到用户输入的重新匹配模板的指示,则电子设备可以重新根据待打印图片的特征确定目标打印模板,或者显示一个或多个打印模板,以供用户从一个或多个打印模板中选择一个打印模板,并将用户所选择的打印模板作为目标打印模板。Optionally, after the electronic device determines the target printing template according to the number and characteristics of the pictures to be printed, the electronic device may also prompt the user whether to select the target printing template on the display interface of the electronic device. If an instruction to select the target printing template input by the user is received, the electronic device processes the picture to be printed according to the printing parameters corresponding to the target printing template. If receiving an instruction to re-match the template input by the user, the electronic device may re-determine the target printing template according to the characteristics of the picture to be printed, or display one or more printing templates for the user to select one from the one or more printing templates Print the template, and use the print template selected by the user as the target print template.

在一实施例中,本申请实施例中的S2002具体包括:在确定满足模板匹配的条件的情况下,响应于所述第一操作,从一个或多个打印模板中确定待打印图片对应的目标打印模板。对应地,图片打印方法还包括:在不满足模板匹配的条件的情况下,显示一个或多个打印模板,检测针对一个或多个打印模板的第二操作,将第二操作所选择的打印模板作为目标打印模板,从而提高了选择打印模板的灵活性,提高用户体验。其中,第二操作可以是选择打印模板的操作,若未检测到第二操作,则确定满足模板匹配的条件。在一实施例中,在检测到第一操作后,若确定在第一操作之前未检测到第二操作,则确定满足模板匹配的条件。In one embodiment, S2002 in this embodiment of the present application specifically includes: in the case of determining that the template matching condition is satisfied, in response to the first operation, determining the target corresponding to the to-be-printed picture from one or more printing templates Print the template. Correspondingly, the picture printing method further includes: displaying one or more print templates under the condition that the template matching conditions are not met, detecting a second operation on the one or more print templates, and converting the print template selected by the second operation to the second operation. As a target printing template, the flexibility of selecting a printing template is improved, and the user experience is improved. The second operation may be an operation of selecting a print template, and if the second operation is not detected, it is determined that the template matching condition is satisfied. In one embodiment, after the first operation is detected, if it is determined that the second operation is not detected before the first operation, it is determined that the template matching condition is satisfied.

示例性地,参考图11,电子设备在检测到打开打印应用程序的操作时,显示界面显示功能预览界面,若确定在显示功能预览界面之前,未检测到选择待打印图片的操作,确定不满足模板匹配的条件,在显示显示界面显示多个打印模板供用户选择。参考图12A 、图13A、图14A、图15A、图16A、图17A、图18A、图19B,第二操作是点击其中一个打印功能图标的操作,第二操作所选择的打印功能图标对应的打印模板即为目标打印模板。Exemplarily, referring to FIG. 11 , when the electronic device detects the operation of opening the printing application, the display interface displays the function preview interface. If it is determined that the operation of selecting the picture to be printed is not detected before the function preview interface is displayed, it is determined that the operation of selecting the picture to be printed is not satisfied. Template matching conditions, multiple print templates are displayed on the display interface for the user to select. 12A , 13A, 14A, 15A, 16A, 17A, 18A, 19B, the second operation is an operation of clicking one of the print function icons, and the print function corresponding to the selected print function icon in the second operation The template is the target print template.

在一实施例中,电子设备在检测到指示打印待打印图片的第一操作后,检测是否存在自动进行模板匹配的设置信息。若存在自动进行模板匹配的设置信息,确定满足模板匹配的条件,响应于第一操作,从一个或多个打印模板中确定待打印图片对应的目标打印模板。若不存在自动进行模板匹配的设置信息,确定不满足模板匹配的条件,输出一个或多个打印模板供用户选择,将用户选择的打印模板作为目标打印模板,从而可以根据用户的意愿进行目标打印模板的匹配,提高用户体验。In one embodiment, after detecting the first operation instructing to print the picture to be printed, the electronic device detects whether there is setting information for automatically performing template matching. If there is setting information for automatically performing template matching, it is determined that the template matching conditions are satisfied, and in response to the first operation, a target printing template corresponding to the picture to be printed is determined from one or more printing templates. If there is no setting information for automatic template matching, it is determined that the conditions for template matching are not satisfied, and one or more printing templates are output for the user to select, and the printing template selected by the user is used as the target printing template, so that target printing can be performed according to the user's wishes. Template matching to improve user experience.

在一实施例中,在确定用户选择的打印模板后,若检测到待打印图片的特征不符合打印模板对应的图片的特征,则输出不匹配的提示信息。若检测到用户输入的继续打印的指示信息,则根据打印模板对应的打印参数对待打印图片处理,以防止用户输入错误的打印指示,从而降低打印失败及打印效果差的概率。In one embodiment, after determining the printing template selected by the user, if it is detected that the characteristics of the picture to be printed do not conform to the characteristics of the picture corresponding to the printing template, a mismatching prompt message is output. If the instruction information for continuing printing input by the user is detected, the to-be-printed image is processed according to the printing parameters corresponding to the printing template to prevent the user from inputting wrong printing instructions, thereby reducing the probability of printing failure and poor printing effect.

在一实施例中,电子设备统计预设时段内用户选择的打印模板以及对应的待打印图片的特征的关联关系,确定每个特征的待打印图片对应的打印模板的选择倾向,根据该选择倾向更新预设的打印图片的特征与打印模板的对应关系,用于在下一次满足模板匹配的条件时,确定与待打印图片对应的打印模板,从而可以为用户推荐符合用户习惯的打印模板。In one embodiment, the electronic device counts the association relationship between the print templates selected by the user and the features of the corresponding to-be-printed pictures within a preset time period, determines the selection tendency of the print templates corresponding to the to-be-printed pictures of each feature, and determines the selection tendency Updating the preset correspondence between the characteristics of the print picture and the print template is used to determine the print template corresponding to the to-be-printed picture when the template matching conditions are met next time, so that a print template that conforms to the user's habit can be recommended for the user.

应理解,上述实施例中各步骤的序号的大小并不意味着执行顺序的先后,各过程的执行顺序应以其功能和内在逻辑确定,而不应对本申请实施例的实施过程构成任何限定。It should be understood that the size of the sequence numbers of the steps in the above embodiments does not mean the sequence of execution, and the execution sequence of each process should be determined by its function and internal logic, and should not constitute any limitation to the implementation process of the embodiments of the present application.

下面结合电子设备的软件架构对本申请实施例提供的图片打印方法进行说明。The image printing method provided by the embodiments of the present application will be described below in conjunction with the software architecture of the electronic device.

电子设备的软件系统可以采用分层架构,事件驱动架构,微核架构,微服务架构,或云架构。本发明实施例以分层架构的Android系统为例,示例性说明电子设备的软件结构。The software system of the electronic device may adopt a layered architecture, an event-driven architecture, a microkernel architecture, a microservice architecture, or a cloud architecture. The embodiments of the present invention take an Android system with a layered architecture as an example to illustrate the software structure of an electronic device.

分层架构将软件分成若干个层,每一层都有清晰的角色和分工。层与层之间通过软件接口通信。在一些实施例中,将Android系统分为四层,从上至下分别为应用程序层,应用程序框架层,安卓运行时(Android runtime)和系统库,以及内核层。The layered architecture divides the software into several layers, and each layer has a clear role and division of labor. Layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers, which are, from top to bottom, an application layer, an application framework layer, an Android runtime (Android runtime) and system libraries, and a kernel layer.

应用程序层可以包括一系列应用程序包。The application layer can include a series of application packages.

如图22所示,应用程序包可以包括相机,图库,日历,通话,地图,导航,WLAN,蓝牙,音乐,视频,短信息,打印等应用程序。As shown in Figure 22, the application package may include applications such as camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, short message, printing and so on.

应用程序框架层为应用程序层的应用程序提供应用编程接口(applicationprogramming interface,API)和编程框架。应用程序框架层包括一些预先定义的函数。The application framework layer provides an application programming interface (application programming interface, API) and a programming framework for the applications of the application layer. The application framework layer includes some predefined functions.

如图22所示,应用程序框架层可以包括窗口管理器,内容提供器,视图系统,电话管理器,资源管理器,通知管理器,打印管理器等。As shown in Figure 22, the application framework layer may include a window manager, a content provider, a view system, a telephony manager, a resource manager, a notification manager, a print manager, and the like.

窗口管理器用于管理窗口程序。窗口管理器可以获取显示屏大小,判断是否有状态栏,锁定屏幕,截取屏幕等。A window manager is used to manage window programs. The window manager can get the size of the display screen, determine whether there is a status bar, lock the screen, take screenshots, etc.

内容提供器用来存放和获取数据,并使这些数据可以被应用程序访问。所述数据可以包括视频,图像,音频,拨打和接听的电话,浏览历史和书签,电话簿等。Content providers are used to store and retrieve data and make these data accessible to applications. The data may include video, images, audio, calls made and received, browsing history and bookmarks, phone book, etc.

视图系统包括可视控件,例如显示文字的控件,显示图片的控件等。视图系统可用于构建应用程序。显示界面可以由一个或多个视图组成的。例如,包括短信通知图标的显示界面,可以包括显示文字的视图以及显示图片的视图。The view system includes visual controls, such as controls for displaying text, controls for displaying pictures, and so on. View systems can be used to build applications. A display interface can consist of one or more views. For example, the display interface including the short message notification icon may include a view for displaying text and a view for displaying pictures.

电话管理器用于提供电子设备的通信功能。例如通话状态的管理(包括接通,挂断等)。The phone manager is used to provide the communication function of the electronic device. For example, the management of call status (including connecting, hanging up, etc.).

资源管理器为应用程序提供各种资源,比如本地化字符串,图标,图片,布局文件,视频文件等等。The resource manager provides various resources for the application, such as localization strings, icons, pictures, layout files, video files and so on.

通知管理器使应用程序可以在状态栏中显示通知信息,可以用于传达告知类型的消息,可以短暂停留后自动消失,无需用户交互。比如通知管理器被用于告知下载完成,消息提醒等。通知管理器还可以是以图表或者滚动条文本形式出现在系统顶部状态栏的通知,例如后台运行的应用程序的通知,还可以是以对话窗口形式出现在屏幕上的通知。例如在状态栏提示文本信息,发出提示音,电子设备振动,指示灯闪烁等。The notification manager enables applications to display notification information in the status bar, which can be used to convey notification-type messages, and can disappear automatically after a brief pause without user interaction. For example, the notification manager is used to notify download completion, message reminders, etc. The notification manager can also display notifications in the status bar at the top of the system in the form of graphs or scroll bar text, such as notifications of applications running in the background, and notifications on the screen in the form of dialog windows. For example, text information is prompted in the status bar, a prompt sound is issued, the electronic device vibrates, and the indicator light flashes.

Android Runtime包括核心库和虚拟机。Android runtime负责安卓系统的调度和管理。Android Runtime includes core libraries and a virtual machine. The Android runtime is responsible for the scheduling and management of the Android system.

核心库包含两部分:一部分是java语言需要调用的功能函数,另一部分是安卓的核心库。The core library consists of two parts: one is the function functions that the java language needs to call, and the other is the core library of Android.

应用程序层和应用程序框架层运行在虚拟机中。虚拟机将应用程序层和应用程序框架层的java文件执行为二进制文件。虚拟机用于执行对象生命周期的管理,堆栈管理,线程管理,安全和异常的管理,以及垃圾回收等功能。The application layer and the application framework layer run in virtual machines. The virtual machine executes the java files of the application layer and the application framework layer as binary files. The virtual machine is used to perform functions such as object lifecycle management, stack management, thread management, safety and exception management, and garbage collection.

系统库可以包括多个功能模块。例如:表面管理器(surface manager),媒体库(Media Libraries),三维图形处理库(例如:OpenGL ES),2D图形引擎(例如:SGL)等。A system library can include multiple functional modules. For example: surface manager (surface manager), media library (Media Libraries), 3D graphics processing library (eg: OpenGL ES), 2D graphics engine (eg: SGL) and so on.

表面管理器用于对显示子系统进行管理,并且为多个应用程序提供了2D和3D图层的融合。The Surface Manager is used to manage the display subsystem and provides a fusion of 2D and 3D layers for multiple applications.

媒体库支持多种常用的音频,视频格式回放和录制,以及静态图像文件等。媒体库可以支持多种音视频编码格式,例如: MPEG4,H.264,MP3,AAC,AMR,JPG,PNG等。The media library supports playback and recording of a variety of commonly used audio and video formats, as well as still image files. The media library can support a variety of audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.

三维图形处理库用于实现三维图形绘图,图像渲染,合成,和图层处理等。The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing.

2D图形引擎是2D绘图的绘图引擎。2D graphics engine is a drawing engine for 2D drawing.

内核层是硬件和软件之间的层。内核层至少包含显示驱动,摄像头驱动,音频驱动,传感器驱动。The kernel layer is the layer between hardware and software. The kernel layer contains at least display drivers, camera drivers, audio drivers, and sensor drivers.

本申请实施例中,打印应用程序在确定待打印图片以及对应的打印模板后,根据打印模板中的打印参数中的图片处理参数对待打印图片进行处理。在待打印图片处理完成后,将处理后的图片、打印参数中的打印机参数,以及打印机标识发送打印管理器。打印管理器包括不同型号的打印机对应的SDK。例如存储佳能打印机对应的SDK、惠普打印机对应的SDK、爱普生打印机对应的SDK等。打印管理器在接收到打印机标识后,确定与打印机标识对应的SDK以及传输方式,通过对应的SDK调用打印机插件,通过打印机插件,以与打印机标识对应的传输方式,将处理后的图片以及打印机参数发送至打印机,指示打印机进行打印。其中,传输方式可以是USB、WIFI、蓝牙、5G等。In the embodiment of the present application, after determining the picture to be printed and the corresponding printing template, the printing application processes the picture to be printed according to the picture processing parameters in the printing parameters in the printing template. After the image to be printed is processed, the processed image, the printer parameters in the print parameters, and the printer identifier are sent to the print manager. The print manager includes SDKs corresponding to different models of printers. For example, the SDK corresponding to Canon printers, the SDK corresponding to HP printers, and the SDK corresponding to Epson printers are stored. After receiving the printer ID, the print manager determines the SDK and the transmission mode corresponding to the printer ID, calls the printer plug-in through the corresponding SDK, and uses the printer plug-in to transfer the processed image and printer parameters in the transmission mode corresponding to the printer ID. Sent to the printer, instructing the printer to print. Among them, the transmission method can be USB, WIFI, Bluetooth, 5G, etc.

示例性的,图23示出了电子设备100的一种结构示意图。Exemplarily, FIG. 23 shows a schematic structural diagram of the electronic device 100 .

电子设备100可以包括处理器110,外部存储器接口120,内部存储器121,通用串行总线(universal serial bus,USB)接口130,充电管理模块140,电源管理模块141,电池142,天线1,天线2,移动通信模块150,无线通信模块160,音频模块170,扬声器170A,受话器170B,麦克风170C,耳机接口170D,传感器模块180,按键190,马达191,指示器192,摄像头193,显示屏194,以及用户标识模块(subscriber identification module,SIM)卡接口195等。其中传感器模块180可以包括压力传感器180A,陀螺仪传感器180B,气压传感器180C,磁传感器180D,加速度传感器180E,距离传感器180F,接近光传感器180G,指纹传感器180H,温度传感器180J,触摸传感器180K,环境光传感器180L,骨传导传感器180M等。The electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charge management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2 , mobile communication module 150, wireless communication module 160, audio module 170, speaker 170A, receiver 170B, microphone 170C, headphone jack 170D, sensor module 180, buttons 190, motor 191, indicator 192, camera 193, display screen 194, and Subscriber identification module (SIM) card interface 195 and the like. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, and ambient light. Sensor 180L, bone conduction sensor 180M, etc.

可以理解的是,本发明实施例示意的结构并不构成对电子设备100的具体限定。在本申请另一些实施例中,电子设备100可以包括比图示更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置。图示的部件可以以硬件,软件或软件和硬件的组合实现。It can be understood that, the structures illustrated in the embodiments of the present invention do not constitute a specific limitation on the electronic device 100 . In other embodiments of the present application, the electronic device 100 may include more or less components than shown, or combine some components, or separate some components, or arrange different components. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.

处理器110可以包括一个或多个处理单元,例如:处理器110可以包括应用处理器(application processor,AP),调制解调处理器,图形处理器(graphics processingunit,GPU),图像信号处理器(image signal processor,ISP),控制器,视频编解码器,数字信号处理器(digital signal processor,DSP),基带处理器,和/或神经网络处理器(neural-network processing unit,NPU)等。其中,不同的处理单元可以是独立的器件,也可以集成在一个或多个处理器中。The processor 110 may include one or more processing units, for example, the processor 110 may include an application processor (application processor, AP), a modem processor, a graphics processor (graphics processing unit, GPU), an image signal processor ( image signal processor, ISP), controller, video codec, digital signal processor (digital signal processor, DSP), baseband processor, and/or neural-network processing unit (neural-network processing unit, NPU), etc. Wherein, different processing units may be independent devices, or may be integrated in one or more processors.

控制器可以根据指令操作码和时序信号,产生操作控制信号,完成取指令和执行指令的控制。The controller can generate an operation control signal according to the instruction operation code and timing signal, and complete the control of fetching and executing instructions.

处理器110中还可以设置存储器,用于存储指令和数据。在一些实施例中,处理器110中的存储器为高速缓冲存储器。该存储器可以保存处理器110刚用过或循环使用的指令或数据。如果处理器110需要再次使用该指令或数据,可从所述存储器中直接调用。避免了重复存取,减少了处理器110的等待时间,因而提高了系统的效率。A memory may also be provided in the processor 110 for storing instructions and data. In some embodiments, the memory in processor 110 is cache memory. This memory may hold instructions or data that have just been used or recycled by the processor 110 . If the processor 110 needs to use the instruction or data again, it can be called directly from the memory. Repeated accesses are avoided and the latency of the processor 110 is reduced, thereby increasing the efficiency of the system.

在一些实施例中,处理器110可以包括一个或多个接口。接口可以包括集成电路(inter-integrated circuit,I2C)接口,集成电路内置音频(inter-integrated circuitsound,I2S)接口,脉冲编码调制(pulse code modulation,PCM)接口,通用异步收发传输器(universal asynchronous receiver/transmitter,UART)接口,移动产业处理器接口(mobile industry processor interface,MIPI),通用输入输出(general-purposeinput/output,GPIO)接口,用户标识模块(subscriber identity module,SIM)接口,和/或通用串行总线(universal serial bus,USB)接口等。In some embodiments, the processor 110 may include one or more interfaces. The interface may include an integrated circuit (inter-integrated circuit, I2C) interface, an integrated circuit built-in audio (inter-integrated circuitsound, I2S) interface, a pulse code modulation (pulse code modulation, PCM) interface, a universal asynchronous receiver (universal asynchronous receiver) interface /transmitter, UART) interface, mobile industry processor interface (MIPI), general-purpose input/output (GPIO) interface, subscriber identity module (SIM) interface, and/or Universal serial bus (universal serial bus, USB) interface, etc.

可以理解的是,本发明实施例示意的各模块间的接口连接关系,只是示意性说明,并不构成对电子设备100的结构限定。在本申请另一些实施例中,电子设备100也可以采用上述实施例中不同的接口连接方式,或多种接口连接方式的组合。It can be understood that the interface connection relationship between the modules illustrated in the embodiment of the present invention is only a schematic illustration, and does not constitute a structural limitation of the electronic device 100 . In other embodiments of the present application, the electronic device 100 may also adopt different interface connection manners in the foregoing embodiments, or a combination of multiple interface connection manners.

电子设备100的无线通信功能可以通过天线1,天线2,移动通信模块150,无线通信模块160,调制解调处理器以及基带处理器等实现。The wireless communication function of the electronic device 100 may be implemented by the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modulation and demodulation processor, the baseband processor, and the like.

天线1和天线2用于发射和接收电磁波信号。电子设备100中的每个天线可用于覆盖单个或多个通信频带。不同的天线还可以复用,以提高天线的利用率。例如:可以将天线1复用为无线局域网的分集天线。在另外一些实施例中,天线可以和调谐开关结合使用。Antenna 1 and Antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in electronic device 100 may be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve antenna utilization. For example, the antenna 1 can be multiplexed as a diversity antenna of the wireless local area network. In other embodiments, the antenna may be used in conjunction with a tuning switch.

移动通信模块150可以提供应用在电子设备100上的包括2G/3G/4G/5G等无线通信的解决方案。移动通信模块150可以包括至少一个滤波器,开关,功率放大器,低噪声放大器(low noise amplifier,LNA)等。移动通信模块150可以由天线1接收电磁波,并对接收的电磁波进行滤波,放大等处理,传送至调制解调处理器进行解调。移动通信模块150还可以对经调制解调处理器调制后的信号放大,经天线1转为电磁波辐射出去。在一些实施例中,移动通信模块150的至少部分功能模块可以被设置于处理器110中。在一些实施例中,移动通信模块150的至少部分功能模块可以与处理器110的至少部分模块被设置在同一个器件中。The mobile communication module 150 may provide wireless communication solutions including 2G/3G/4G/5G etc. applied on the electronic device 100 . The mobile communication module 150 may include at least one filter, switch, power amplifier, low noise amplifier (low noise amplifier, LNA) and the like. The mobile communication module 150 can receive electromagnetic waves from the antenna 1, filter and amplify the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modulation and demodulation processor, and then turn it into an electromagnetic wave for radiation through the antenna 1 . In some embodiments, at least part of the functional modules of the mobile communication module 150 may be provided in the processor 110 . In some embodiments, at least part of the functional modules of the mobile communication module 150 may be provided in the same device as at least part of the modules of the processor 110 .

无线通信模块160可以提供应用在电子设备100上的包括无线局域网(wirelesslocal area networks,WLAN)(如无线保真(wireless fidelity,Wi-Fi)网络),蓝牙(bluetooth,BT),全球导航卫星系统(global navigation satellite system,GNSS),调频(frequency modulation,FM),近距离无线通信技术(near field communication,NFC),红外技术(infrared,IR)等无线通信的解决方案。无线通信模块160可以是集成至少一个通信处理模块的一个或多个器件。无线通信模块160经由天线2接收电磁波,将电磁波信号调频以及滤波处理,将处理后的信号发送到处理器110。无线通信模块160还可以从处理器110接收待发送的信号,对其进行调频,放大,经天线2转为电磁波辐射出去。The wireless communication module 160 can provide wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), bluetooth (BT), and global navigation satellite systems applied on the electronic device 100 . (global navigation satellite system, GNSS), frequency modulation (frequency modulation, FM), near field communication technology (near field communication, NFC), infrared technology (infrared, IR) and other wireless communication solutions. The wireless communication module 160 may be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2 , frequency modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 110 . The wireless communication module 160 can also receive the signal to be sent from the processor 110 , perform frequency modulation on it, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2 .

电子设备100通过GPU,显示屏194,以及应用处理器等实现显示功能。GPU为图像处理的微处理器,连接显示屏194和应用处理器。GPU用于执行数学和几何计算,用于图形渲染。处理器110可包括一个或多个GPU,其执行程序指令以生成或改变显示信息。The electronic device 100 implements a display function through a GPU, a display screen 194, an application processor, and the like. The GPU is a microprocessor for image processing, and is connected to the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. Processor 110 may include one or more GPUs that execute program instructions to generate or alter display information.

显示屏194用于显示图像,视频等。显示屏194包括显示面板。显示面板可以采用液晶显示屏(liquid crystal display,LCD),有机发光二极管(organic light-emittingdiode,OLED),有源矩阵有机发光二极体或主动矩阵有机发光二极体(active-matrixorganic light emitting diode的,AMOLED),柔性发光二极管(flex light-emittingdiode,FLED),Miniled,MicroLed,Micro-oLed,量子点发光二极管(quantum dot lightemitting diodes,QLED)等。在一些实施例中,电子设备100可以包括1个或N个显示屏194,N为大于1的正整数。Display screen 194 is used to display images, videos, and the like. Display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode or an active-matrix organic light-emitting diode (active-matrix organic light-emitting diode). , AMOLED), flexible light-emitting diode (flex light-emitting diode, FLED), Miniled, MicroLed, Micro-oLed, quantum dot light-emitting diodes (quantum dot light emitting diodes, QLED) and so on. In some embodiments, the electronic device 100 may include one or N display screens 194 , where N is a positive integer greater than one.

电子设备100可以通过ISP,摄像头193,视频编解码器,GPU,显示屏194以及应用处理器等实现拍摄功能。The electronic device 100 may implement a shooting function through an ISP, a camera 193, a video codec, a GPU, a display screen 194, an application processor, and the like.

ISP 用于处理摄像头193反馈的数据。例如,拍照时,打开快门,光线通过镜头被传递到摄像头感光元件上,光信号转换为电信号,摄像头感光元件将所述电信号传递给ISP处理,转化为肉眼可见的图像。ISP还可以对图像的噪点,亮度,肤色进行算法优化。ISP还可以对拍摄场景的曝光,色温等参数优化。在一些实施例中,ISP可以设置在摄像头193中。The ISP is used to process the data fed back by the camera 193 . For example, when taking a photo, the shutter is opened, the light is transmitted to the camera photosensitive element through the lens, the light signal is converted into an electrical signal, and the camera photosensitive element transmits the electrical signal to the ISP for processing, and converts it into an image visible to the naked eye. ISP can also perform algorithm optimization on image noise, brightness, and skin tone. ISP can also optimize the exposure, color temperature and other parameters of the shooting scene. In some embodiments, the ISP may be provided in the camera 193 .

摄像头193用于捕获静态图像或视频。物体通过镜头生成光学图像投射到感光元件。感光元件可以是电荷耦合器件(charge coupled device,CCD)或互补金属氧化物半导体(complementary metal-oxide-semiconductor,CMOS)光电晶体管。感光元件把光信号转换成电信号,之后将电信号传递给ISP转换成数字图像信号。ISP将数字图像信号输出到DSP加工处理。DSP将数字图像信号转换成标准的RGB,YUV等格式的图像信号。在一些实施例中,电子设备100可以包括1个或N个摄像头193,N为大于1的正整数。Camera 193 is used to capture still images or video. The object is projected through the lens to generate an optical image onto the photosensitive element. The photosensitive element may be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the optical signal into an electrical signal, and then transmits the electrical signal to the ISP to convert it into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. DSP converts digital image signals into standard RGB, YUV and other formats of image signals. In some embodiments, the electronic device 100 may include 1 or N cameras 193 , where N is a positive integer greater than 1.

数字信号处理器用于处理数字信号,除了可以处理数字图像信号,还可以处理其他数字信号。例如,当电子设备100在频点选择时,数字信号处理器用于对频点能量进行傅里叶变换等。A digital signal processor is used to process digital signals, in addition to processing digital image signals, it can also process other digital signals. For example, when the electronic device 100 selects a frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy and so on.

视频编解码器用于对数字视频压缩或解压缩。电子设备100可以支持一种或多种视频编解码器。这样,电子设备100可以播放或录制多种编码格式的视频,例如:动态图像专家组(moving picture experts group,MPEG)1,MPEG2,MPEG3,MPEG4等。Video codecs are used to compress or decompress digital video. The electronic device 100 may support one or more video codecs. In this way, the electronic device 100 can play or record videos in various encoding formats, for example, moving picture experts group (MPEG) 1, MPEG2, MPEG3, MPEG4, and so on.

NPU为神经网络(neural-network ,NN)计算处理器,通过借鉴生物神经网络结构,例如借鉴人脑神经元之间传递模式,对输入信息快速处理,还可以不断的自学习。通过NPU可以实现电子设备100的智能认知等应用,例如:图像识别,人脸识别,语音识别,文本理解等。The NPU is a neural-network (NN) computing processor. By borrowing the structure of biological neural networks, such as the transmission mode between neurons in the human brain, it can quickly process the input information and can continuously learn by itself. Applications such as intelligent cognition of the electronic device 100 can be implemented through the NPU, such as image recognition, face recognition, speech recognition, text understanding, and the like.

外部存储器接口120可以用于连接外部存储卡,例如Micro SD卡,实现扩展电子设备100的存储能力。外部存储卡通过外部存储器接口120与处理器110通信,实现数据存储功能。例如将音乐,视频等文件保存在外部存储卡中。The external memory interface 120 may be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100 . The external memory card communicates with the processor 110 through the external memory interface 120 to realize the data storage function. For example to save files like music, video etc in external memory card.

内部存储器121可以用于存储计算机可执行程序代码,所述可执行程序代码包括指令。内部存储器121可以包括存储程序区和存储数据区。其中,存储程序区可存储操作系统,至少一个功能所需的应用程序(比如声音播放功能,图像播放功能等)等。存储数据区可存储电子设备100使用过程中所创建的数据(比如音频数据,电话本等)等。此外,内部存储器121可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件,闪存器件,通用闪存存储器(universal flash storage,UFS)等。处理器110通过运行存储在内部存储器121的指令,和/或存储在设置于处理器中的存储器的指令,执行电子设备100的各种功能应用以及数据处理。Internal memory 121 may be used to store computer executable program code, which includes instructions. The internal memory 121 may include a storage program area and a storage data area. The storage program area can store an operating system, an application program required for at least one function (such as a sound playback function, an image playback function, etc.), and the like. The storage data area may store data (such as audio data, phone book, etc.) created during the use of the electronic device 100 and the like. In addition, the internal memory 121 may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, universal flash storage (UFS), and the like. The processor 110 executes various functional applications and data processing of the electronic device 100 by executing instructions stored in the internal memory 121 and/or instructions stored in a memory provided in the processor.

电子设备100可以通过音频模块170,扬声器170A,受话器170B,麦克风170C,耳机接口170D,以及应用处理器等实现音频功能。例如音乐播放,录音等。The electronic device 100 may implement audio functions through an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, an application processor, and the like. Such as music playback, recording, etc.

音频模块170用于将数字音频信息转换成模拟音频信号输出,也用于将模拟音频输入转换为数字音频信号。音频模块170还可以用于对音频信号编码和解码。在一些实施例中,音频模块170可以设置于处理器110中,或将音频模块170的部分功能模块设置于处理器110中。The audio module 170 is used for converting digital audio information into analog audio signal output, and also for converting analog audio input into digital audio signal. Audio module 170 may also be used to encode and decode audio signals. In some embodiments, the audio module 170 may be provided in the processor 110 , or some functional modules of the audio module 170 may be provided in the processor 110 .

压力传感器180A用于感受压力信号,可以将压力信号转换成电信号。在一些实施例中,压力传感器180A可以设置于显示屏194。压力传感器180A的种类很多,如电阻式压力传感器,电感式压力传感器,电容式压力传感器等。电容式压力传感器可以是包括至少两个具有导电材料的平行板。当有力作用于压力传感器180A,电极之间的电容改变。电子设备100根据电容的变化确定压力的强度。当有触摸操作作用于显示屏194,电子设备100根据压力传感器180A检测所述触摸操作强度。电子设备100也可以根据压力传感器180A的检测信号计算触摸的位置。在一些实施例中,作用于相同触摸位置,但不同触摸操作强度的触摸操作,可以对应不同的操作指令。例如:当有触摸操作强度小于第一压力阈值的触摸操作作用于短消息应用图标时,执行查看短消息的指令。当有触摸操作强度大于或等于第一压力阈值的触摸操作作用于短消息应用图标时,执行新建短消息的指令。The pressure sensor 180A is used to sense pressure signals, and can convert the pressure signals into electrical signals. In some embodiments, the pressure sensor 180A may be provided on the display screen 194 . There are many types of pressure sensors 180A, such as resistive pressure sensors, inductive pressure sensors, capacitive pressure sensors, and the like. The capacitive pressure sensor may be comprised of at least two parallel plates of conductive material. When a force is applied to the pressure sensor 180A, the capacitance between the electrodes changes. The electronic device 100 determines the intensity of the pressure according to the change in capacitance. When a touch operation acts on the display screen 194, the electronic device 100 detects the intensity of the touch operation according to the pressure sensor 180A. The electronic device 100 may also calculate the touched position according to the detection signal of the pressure sensor 180A. In some embodiments, touch operations acting on the same touch position but with different touch operation intensities may correspond to different operation instructions. For example, when a touch operation whose intensity is less than the first pressure threshold acts on the short message application icon, the instruction for viewing the short message is executed. When a touch operation with a touch operation intensity greater than or equal to the first pressure threshold acts on the short message application icon, the instruction to create a new short message is executed.

触摸传感器180K,也称“触控器件”。触摸传感器180K可以设置于显示屏194,由触摸传感器180K与显示屏194组成触摸屏,也称“触控屏”。触摸传感器180K用于检测作用于其上或附近的触摸操作。触摸传感器可以将检测到的触摸操作传递给应用处理器,以确定触摸事件类型。可以通过显示屏194提供与触摸操作相关的视觉输出。在另一些实施例中,触摸传感器180K也可以设置于电子设备100的表面,与显示屏194所处的位置不同。Touch sensor 180K, also called "touch device". The touch sensor 180K may be disposed on the display screen 194 , and the touch sensor 180K and the display screen 194 form a touch screen, also called a “touch screen”. The touch sensor 180K is used to detect a touch operation on or near it. The touch sensor can pass the detected touch operation to the application processor to determine the type of touch event. Visual output related to touch operations may be provided through display screen 194 . In other embodiments, the touch sensor 180K may also be disposed on the surface of the electronic device 100 , which is different from the location where the display screen 194 is located.

在上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述或记载的部分,可以参见其它实施例的相关描述。In the foregoing embodiments, the description of each embodiment has its own emphasis. For parts that are not described or described in detail in a certain embodiment, reference may be made to the relevant descriptions of other embodiments.

所属领域的技术人员可以清楚地了解到,为了描述的方便和简洁,仅以上述各功能单元、模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能单元、模块完成,即将所述装置的内部结构划分成不同的功能单元或模块,以完成以上描述的全部或者部分功能。实施例中的各功能单元、模块可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中,上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。另外,各功能单元、模块的具体名称也只是为了便于相互区分,并不用于限制本申请的保护范围。上述系统中单元、模块的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。Those skilled in the art can clearly understand that, for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example. Module completion, that is, dividing the internal structure of the device into different functional units or modules to complete all or part of the functions described above. Each functional unit and module in the embodiment may be integrated in one processing unit, or each unit may exist physically alone, or two or more units may be integrated in one unit, and the above-mentioned integrated units may adopt hardware. It can also be realized in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing from each other, and are not used to limit the protection scope of the present application. For the specific working processes of the units and modules in the above-mentioned system, reference may be made to the corresponding processes in the foregoing method embodiments, which will not be repeated here.

所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请实现上述实施例方法中的全部或部分流程,可以通过计算机程序来指令相关的硬件来完成,所述的计算机程序可存储于一计算机可读存储介质中,该计算机程序在被处理器执行时,可实现上述各个方法实施例的步骤。其中,所述计算机程序包括计算机程序代码,所述计算机程序代码可以为源代码形式、对象代码形式、可执行文件或某些中间形式等。所述计算机可读介质至少可以包括:能够将计算机程序代码携带到拍照装置/电子设备的任何实体或装置、记录介质、计算机存储器、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,RandomAccess Memory)、电载波信号、电信信号以及软件分发介质。例如U盘、移动硬盘、磁碟或者光盘等。The integrated unit, if implemented in the form of a software functional unit and sold or used as an independent product, may be stored in a computer-readable storage medium. Based on this understanding, the present application realizes all or part of the processes in the methods of the above embodiments, which can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a computer-readable storage medium. When executed by a processor, the steps of each of the above method embodiments can be implemented. Wherein, the computer program includes computer program code, and the computer program code may be in the form of source code, object code, executable file or some intermediate form, and the like. The computer-readable medium may include at least: any entity or device capable of carrying the computer program code to the photographing device/electronic device, recording medium, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, RandomAccess Memory), electrical carrier signals, telecommunication signals, and software distribution media. For example, U disk, mobile hard disk, disk or CD, etc.

所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated, and components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution in this embodiment.

在本申请所提供的实施例中,应该理解到,所揭露的装置/网络设备和方法,可以通过其它的方式实现。例如,以上所描述的装置/网络设备实施例仅仅是示意性的,例如,所述模块或单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通讯连接可以是通过一些接口,装置或单元的间接耦合或通讯连接,可以是电性,机械或其它的形式。In the embodiments provided in this application, it should be understood that the disclosed apparatus/network device and method may be implemented in other manners. For example, the apparatus/network device embodiments described above are only illustrative. For example, the division of the modules or units is only a logical function division. In actual implementation, there may be other division methods, such as multiple units. Or components may be combined or may be integrated into another system, or some features may be omitted, or not implemented. On the other hand, the shown or discussed mutual coupling or direct coupling or communication connection may be through some interfaces, indirect coupling or communication connection of devices or units, and may be in electrical, mechanical or other forms.

本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。Those of ordinary skill in the art can realize that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Skilled artisans may implement the described functionality using different methods for each particular application, but such implementations should not be considered beyond the scope of this application.

最后应说明的是:以上所述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何在本申请揭露的技术范围内的变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以所述权利要求的保护范围为准。Finally, it should be noted that: the above are only specific embodiments of the present application, but the protection scope of the present application is not limited to this, and any changes or replacements within the technical scope disclosed in the present application should be covered by the present application. within the scope of protection of the application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.

Claims (11)

1.一种图片打印方法,应用于电子设备,其特征在于,所述电子设备中具有一个或多个打印模板,一个打印模板对应一组打印参数,打印参数包括打印机参数以及图片处理参数,所述方法包括:1. a picture printing method, is applied to electronic equipment, it is characterised in that there is one or more printing templates in the electronic equipment, a printing template corresponds to a group of printing parameters, and the printing parameters include printer parameters and picture processing parameters, so The methods described include: 检测指示打印待打印图片的第一操作;detecting a first operation instructing to print the picture to be printed; 响应于所述第一操作,从一个或多个所述打印模板中确定所述待打印图片对应的目标打印模板;所述从一个或多个所述打印模板中确定所述待打印图片对应的目标打印模板,包括:根据所述待打印图片的数量以及特征,从一个或多个所述打印模板中确定所述待打印图片对应的所述目标打印模板,所述待打印图片的特征包括所述待打印图片的尺寸、像素、分辨率;根据所述待打印图片的数量以及特征,从一个或多个打印模板中确定所述待打印图片对应的目标打印模板,包括:若所述待打印图片的数量为1,所述待打印图片的像素大于第一预设像素,所述待打印图片的宽度和高度的比值在第一预设范围内,所述待打印图片的分辨率大于或者等于第一预设分辨率,则确定所述目标打印模板为大图打印模板,所述大图打印模板对应的所述图片处理参数用于根据裁剪数量对所述待打印图片进行裁剪,得到与所述待打印图片对应的至少两张子图,根据拼接标识的参数,对所述子图进行标记;In response to the first operation, a target printing template corresponding to the to-be-printed picture is determined from one or more of the printing templates; the target printing template corresponding to the to-be-printed picture is determined from one or more of the printing templates; A target printing template, comprising: determining the target printing template corresponding to the to-be-printed picture from one or more of the to-be-printed pictures according to the number and characteristics of the to-be-printed pictures, wherein the characteristics of the to-be-printed picture include all the The size, pixel and resolution of the picture to be printed; according to the number and characteristics of the picture to be printed, determine the target printing template corresponding to the picture to be printed from one or more printing templates, including: if the picture to be printed is The number of pictures is 1, the pixels of the picture to be printed are larger than the first preset pixel, the ratio of the width and height of the picture to be printed is within the first preset range, and the resolution of the picture to be printed is greater than or equal to For the first preset resolution, it is determined that the target printing template is a large-image printing template, and the image processing parameter corresponding to the large-image printing template is used to trim the to-be-printed image according to the trimming quantity, and obtain a at least two sub-images corresponding to the picture to be printed, marking the sub-images according to the parameters of the splicing mark; 采用所述目标打印模板对应的所述图片处理参数处理所述待打印图片,得到处理后的待打印图片;Use the picture processing parameters corresponding to the target printing template to process the to-be-printed picture to obtain a processed to-be-printed picture; 向所述打印机发送所述处理后的待打印图片以及所述目标打印模板对应的所述打印机参数。Send the processed picture to be printed and the printer parameters corresponding to the target printing template to the printer. 2.根据权利要求1所述的方法,其特征在于,一个或多个所述打印模板包括长图打印模板,根据所述待打印图片的数量以及特征,从一个或多个打印模板中确定所述待打印图片对应的目标打印模板,包括:2. The method according to claim 1, characterized in that, one or more of the printing templates comprises a long-image printing template, and according to the quantity and characteristics of the pictures to be printed, determined from the one or more printing templates. Describe the target printing template corresponding to the picture to be printed, including: 若所述待打印图片的数量为1,所述待打印图片的尺寸与所述电子设备的屏幕的尺寸满足预设关系,则确定所述目标打印模板为所述长图打印模板,所述长图打印模板用于在长度方向上对所述待打印图片进行裁剪,得到与所述待打印图片对应的至少两张子图。If the number of the to-be-printed pictures is 1, and the size of the to-be-printed picture and the size of the screen of the electronic device satisfy a preset relationship, the target printing template is determined to be the long-picture printing template, and the long-picture printing template is determined. The image printing template is used for cropping the to-be-printed image in the length direction to obtain at least two sub-images corresponding to the to-be-printed image. 3.根据权利要求1所述的方法,其特征在于,一个或多个所述打印模板包括寸照打印模板,根据所述待打印图片的数量以及特征,从一个或多个打印模板中确定所述待打印图片对应的目标打印模板,包括:3. The method according to claim 1, characterized in that, one or more of the printing templates comprises an inch photo printing template, and according to the number and characteristics of the pictures to be printed, the one or more printing templates are determined. Describe the target printing template corresponding to the picture to be printed, including: 若所述待打印图片的数量为1,所述待打印图片的内容和背景满足预设条件,则确定目标打印模板为寸照打印模板,所述寸照打印模板用于将多张待打印图片绘制于一张图片上。If the number of the to-be-printed pictures is 1, and the content and background of the to-be-printed pictures satisfy the preset conditions, the target printing template is determined to be an inch-photo printing template, and the inch-photo printing template is used to convert multiple pictures to be printed. Draw on a picture. 4.根据权利要求1所述的方法,其特征在于,一个或多个所述打印模板包括拼图打印模板,根据所述待打印图片的数量以及特征,从一个或多个打印模板中确定所述待打印图片对应的目标打印模板,包括:4. The method according to claim 1, wherein one or more of the printing templates comprises a puzzle printing template, and the one or more printing templates are determined from the one or more printing templates according to the number and characteristics of the pictures to be printed. The target print template corresponding to the image to be printed, including: 若所述待打印图片的数量大于1,所述待打印图片的像素大于第二预设像素,所述待打印图片的宽度和高度的比值在第二预设范围内,所述待打印图片的分辨率大于或者等于第二预设分辨率,则确定目标打印模板为拼图打印模板,所述拼图打印模板用于拼接所述待打印图片,得到拼接后的图片。If the number of the to-be-printed pictures is greater than 1, the pixels of the to-be-printed picture are greater than the second preset pixel, the ratio of the width to the height of the to-be-printed picture is within the second preset range, and the If the resolution is greater than or equal to the second preset resolution, it is determined that the target printing template is a mosaic printing template, and the mosaic printing template is used for splicing the to-be-printed pictures to obtain a spliced picture. 5.根据权利要求1~4任一项所述的方法,其特征在于,所述图片处理参数包括纸张尺寸、色彩、填充方式、缩放比例、排布方式中的任意一项或多项,所述打印机参数包括纸张类型以及打印质量。5. The method according to any one of claims 1 to 4, wherein the picture processing parameters include any one or more of paper size, color, filling method, scaling ratio, and arrangement method, and The printer parameters described include paper type and print quality. 6.根据权利要求1~4任一项所述的方法,其特征在于,在确定满足模板匹配的条件的情况下,响应于所述第一操作,从一个或多个所述打印模板中确定所述待打印图片对应的所述目标打印模板。6. The method according to any one of claims 1 to 4, characterized in that, in response to the first operation, in response to the first operation, determining from one or more print templates The target printing template corresponding to the picture to be printed. 7.根据权利要求6所述的方法,其特征在于,所述方法还包括:7. The method according to claim 6, wherein the method further comprises: 在不满足模板匹配的条件的情况下,显示一个或多个所述打印模板;Displaying one or more of the print templates if the conditions for template matching are not met; 检测针对所述一个或多个打印模板的第二操作;detecting a second operation for the one or more print templates; 将所述第二操作所选择的所述打印模板作为所述目标打印模板。The print template selected by the second operation is used as the target print template. 8.根据权利要求7所述的方法,其特征在于,所述方法还包括:8. The method according to claim 7, wherein the method further comprises: 若未检测到所述第二操作,则确定满足模板匹配的条件。If the second operation is not detected, it is determined that the template matching condition is satisfied. 9.根据权利要求1所述的方法,其特征在于,在响应于所述第一操作,从一个或多个所述打印模板中确定所述待打印图片对应的所述目标打印模板之后,所述方法还包括:9 . The method according to claim 1 , wherein in response to the first operation, after determining the target printing template corresponding to the to-be-printed picture from one or more of the printing templates, the The method also includes: 输出所述目标打印模板对应的打印参数;outputting printing parameters corresponding to the target printing template; 检测针对所述目标打印模板对应的打印参数的修改操作;Detecting a modification operation of the printing parameters corresponding to the target printing template; 在所述修改操作指示修改所述目标打印模板对应的所述图片处理参数的情况下,所述采用所述目标打印模板对应的所述图片处理参数处理所述待打印图片,得到处理后的待打印图片,包括:In the case where the modification operation instructs to modify the picture processing parameter corresponding to the target printing template, the picture to be printed is processed by using the picture processing parameter corresponding to the target printing template, and a processed to-be-printed picture is obtained. Print pictures, including: 采用所述目标打印模板对应的修改后的图片处理参数处理所述待打印图片,得到处理后的待打印图片;Use the modified picture processing parameters corresponding to the target printing template to process the to-be-printed picture to obtain the processed to-be-printed picture; 在所述修改操作指示修改所述目标打印模板对应的所述打印机参数的情况下,所述向所述打印机发送所述处理后的待打印图片以及所述目标打印模板对应的所述打印机参数,包括:In the case that the modification operation instructs to modify the printer parameters corresponding to the target printing template, the sending the processed picture to be printed and the printer parameters corresponding to the target printing template to the printer, include: 向所述打印机发送所述处理后的待打印图片,以及所述目标打印模板对应的修改后的打印机参数。Send the processed picture to be printed and the modified printer parameters corresponding to the target printing template to the printer. 10.一种电子设备,其特征在于,包括处理器,所述处理器用于执行存储在存储器中的计算机程序,以实现如权利要求1~9任一项所述的方法。10. An electronic device, characterized by comprising a processor, wherein the processor is configured to execute a computer program stored in a memory, so as to implement the method according to any one of claims 1 to 9. 11.一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,其特征在于,所述计算机程序被处理器执行时实现如权利要求1~9任一项所述的方法。11. A computer-readable storage medium storing a computer program, wherein when the computer program is executed by a processor, the method according to any one of claims 1 to 9 is implemented.
CN202210080529.3A 2022-01-24 2022-01-24 Picture printing method, electronic device and computer-readable storage medium Active CN114089931B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202210637023.8A CN116521101A (en) 2022-01-24 2022-01-24 Picture printing method, electronic device and computer readable storage medium
CN202210080529.3A CN114089931B (en) 2022-01-24 2022-01-24 Picture printing method, electronic device and computer-readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210080529.3A CN114089931B (en) 2022-01-24 2022-01-24 Picture printing method, electronic device and computer-readable storage medium

Related Child Applications (1)

Application Number Title Priority Date Filing Date
CN202210637023.8A Division CN116521101A (en) 2022-01-24 2022-01-24 Picture printing method, electronic device and computer readable storage medium

Publications (2)

Publication Number Publication Date
CN114089931A CN114089931A (en) 2022-02-25
CN114089931B true CN114089931B (en) 2022-06-21

Family

ID=80309177

Family Applications (2)

Application Number Title Priority Date Filing Date
CN202210080529.3A Active CN114089931B (en) 2022-01-24 2022-01-24 Picture printing method, electronic device and computer-readable storage medium
CN202210637023.8A Pending CN116521101A (en) 2022-01-24 2022-01-24 Picture printing method, electronic device and computer readable storage medium

Family Applications After (1)

Application Number Title Priority Date Filing Date
CN202210637023.8A Pending CN116521101A (en) 2022-01-24 2022-01-24 Picture printing method, electronic device and computer readable storage medium

Country Status (1)

Country Link
CN (2) CN114089931B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115454365A (en) * 2022-10-13 2022-12-09 维沃移动通信有限公司 Picture processing method and device, electronic equipment and medium
CN119225581A (en) * 2023-06-29 2024-12-31 荣耀终端有限公司 Object processing method, electronic device and storage medium
CN118269498B (en) * 2024-06-04 2024-07-26 珠海恒茂电子科技有限公司 Method for improving longitudinal resolution of thermal printer

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1315717A (en) * 2000-03-28 2001-10-03 诺日士钢机株式会社 Digital photographic treater
CN1630328A (en) * 2003-12-04 2005-06-22 索尼株式会社 Printing system and printing method
US6967740B1 (en) * 1998-06-01 2005-11-22 Hewlett-Packard Development Company, L.P. Virtual media size printing system
CN1734411A (en) * 2004-08-11 2006-02-15 明基电通股份有限公司 Data processing device and method for automatically determining optimal printing mode according to data characteristics
CN106126133A (en) * 2016-06-23 2016-11-16 联想(北京)有限公司 A kind of Method of printing, printing device and electronic installation
CN108764385A (en) * 2018-05-16 2018-11-06 中国联合网络通信集团有限公司 Intelligent printing method, Intelligent printing equipment
CN110347355A (en) * 2019-07-08 2019-10-18 武汉诚信卓远科技发展有限公司 Cloud Method of printing, equipment and computer readable storage medium
WO2020051968A1 (en) * 2018-09-11 2020-03-19 华为技术有限公司 Data sharing method, graphic user interface, and electronic device and system
CN111552447A (en) * 2020-04-30 2020-08-18 中国银行股份有限公司 Printing method and system

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10599963B2 (en) * 2014-09-19 2020-03-24 Ccl Label, Inc. System and method for printing customized items
JP7313801B2 (en) * 2018-05-24 2023-07-25 キヤノン株式会社 Control device, control method and program

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6967740B1 (en) * 1998-06-01 2005-11-22 Hewlett-Packard Development Company, L.P. Virtual media size printing system
CN1315717A (en) * 2000-03-28 2001-10-03 诺日士钢机株式会社 Digital photographic treater
CN1630328A (en) * 2003-12-04 2005-06-22 索尼株式会社 Printing system and printing method
CN1734411A (en) * 2004-08-11 2006-02-15 明基电通股份有限公司 Data processing device and method for automatically determining optimal printing mode according to data characteristics
CN106126133A (en) * 2016-06-23 2016-11-16 联想(北京)有限公司 A kind of Method of printing, printing device and electronic installation
CN108764385A (en) * 2018-05-16 2018-11-06 中国联合网络通信集团有限公司 Intelligent printing method, Intelligent printing equipment
WO2020051968A1 (en) * 2018-09-11 2020-03-19 华为技术有限公司 Data sharing method, graphic user interface, and electronic device and system
CN110347355A (en) * 2019-07-08 2019-10-18 武汉诚信卓远科技发展有限公司 Cloud Method of printing, equipment and computer readable storage medium
CN111552447A (en) * 2020-04-30 2020-08-18 中国银行股份有限公司 Printing method and system

Also Published As

Publication number Publication date
CN114089931A (en) 2022-02-25
CN116521101A (en) 2023-08-01

Similar Documents

Publication Publication Date Title
CN110401766B (en) Shooting method and terminal
CN113747048B (en) Image content removing method and related device
CN114089931B (en) Picture printing method, electronic device and computer-readable storage medium
CN115484380B (en) Shooting method, graphical user interface and electronic equipment
WO2021129198A1 (en) Method for photography in long-focal-length scenario, and terminal
WO2022057852A1 (en) Method for interaction between multiple applications
CN110471606B (en) Input method and electronic equipment
CN109857401B (en) Display method of electronic equipment, graphical user interface and electronic equipment
CN112598594A (en) Color consistency correction method and related device
US20250004799A1 (en) Theme wallpaper generation method and electronic device
EP4109879A1 (en) Image color retention method and device
CN113891009A (en) Exposure adjusting method and related equipment
WO2024041394A1 (en) Photographing method and related apparatus
WO2024055797A9 (en) Method for capturing images in video, and electronic device
CN114845059A (en) A shooting method and related equipment
CN115802146A (en) Method and electronic device for capturing images in video
CN113497888A (en) Photo preview method, electronic device and storage medium
CN114466101B (en) Display method and electronic equipment
WO2023035868A1 (en) Photographing method and electronic device
EP4277257A1 (en) Filming method and electronic device
CN115460343A (en) Image processing method, device and storage medium
CN117177064A (en) Shooting method and related equipment
CN117119276B (en) Underwater shooting method and electronic equipment
CN115701129B (en) Image processing method and electronic equipment
CN119255093A (en) Frame preview method, device, electronic device and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
CP03 Change of name, title or address
CP03 Change of name, title or address

Address after: Unit 3401, unit a, building 6, Shenye Zhongcheng, No. 8089, Hongli West Road, Donghai community, Xiangmihu street, Futian District, Shenzhen, Guangdong 518040

Patentee after: Honor Terminal Co.,Ltd.

Country or region after: China

Address before: 3401, unit a, building 6, Shenye Zhongcheng, No. 8089, Hongli West Road, Donghai community, Xiangmihu street, Futian District, Shenzhen, Guangdong

Patentee before: Honor Device Co.,Ltd.

Country or region before: China