Detailed Description
In order to make those skilled in the art better understand the technical solutions in the present specification, the technical solutions in the embodiments of the present specification will be clearly and completely described below with reference to the drawings in the embodiments of the present specification, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be obtained by a person skilled in the art without making any inventive step based on the embodiments of the present disclosure, shall fall within the scope of protection of the present application.
Fig. 1 is a schematic diagram of a picture scaling process involved in a practical application scenario of the solution of the present specification. After a picture to be processed (such as a high-definition picture obtained based on a Retina display technology) is inserted into an editing page (such as a rich text editing page), determining the size of the currently displayed picture to be processed; further, determining a corresponding scaling boundary according to the current display size, for example, the size of the high definition picture is 100 × 100, and the size of the corresponding scaling boundary is 50 × 50; based on an adjustment operation (such as a drag operation and/or a click operation) for the to-be-processed picture, the to-be-processed picture is automatically absorbed to a preset zoom boundary. In the process of zooming the picture to be processed, an operator does not need to designate the zooming size of the picture to be processed, the picture to be processed can be automatically absorbed to the size limited by the corresponding adjusting boundary, and the efficiency of adjusting the picture size in the editing page is effectively improved.
It should be noted that the editing page may be a browser editing page, a mailbox editing page, an editing page of a text editing application, or other rich text editing pages; the picture to be processed may be a high definition picture with higher pixels. The technical scheme of the embodiment can be applied to terminal equipment such as mobile phones and computers which support rich text editing pages.
Based on the above-described scenarios, the following describes the embodiments of the present specification in detail.
Fig. 2 is a schematic flow chart of a method for scaling an image according to an embodiment of the present disclosure, where the method specifically includes the following steps:
step S202: determining the size of a picture to be processed displayed in the editing page; and the size of the picture to be processed displayed in the editing page is larger than the original size of the picture to be processed.
In the editing page, text and pictures may need to be edited, and if the picture to be processed inserted into the editing page is a high-definition picture with higher pixels, the display size in the editing page may exceed the original size (for example, the picture exceeds the frame of the editing page). Thus, the size of the picture to be processed needs to be adjusted.
For example, it is assumed that the picture to be processed is a high-definition picture obtained based on Retina display technology. And assuming that the pixel size of the picture to be processed is 50 × 50 (i.e., the original size of the picture to be processed) when the picture is displayed on a display device supporting the Retina display technology. If the picture to be processed is edited on a certain terminal device which does not support the Retina display technology, the editing process includes the following steps: when the image is inserted into the editing page, the pixel size of the image to be processed in the editing page is 100 × 100.
It should be noted that the size mentioned herein may be a size determined based on pixels, or may be a size determined based on centimeters or millimeters; in the case of a resolution determination, the correspondence between pixels and centimeters is also determined.
Step S204: and setting a scaling boundary corresponding to the picture to be processed according to the size of the picture to be processed.
As can be seen from the above, the size of the picture to be processed refers to the size displayed in the editing page (the size that is not adjusted), the size displayed in the editing page is often larger than the original size, and usually, the user needs to reduce the size of the picture to be processed in the editing page. Of course, if the user wants to more clearly display the to-be-processed picture, the to-be-processed picture may be further enlarged based on the size of the to-be-processed picture.
The scaling boundary is determined based on a border or boundary line of the picture to be processed. For example: the picture to be processed is a 2 times high-definition rectangular picture, and needs to be reduced to the original size, so that the long border and the wide border of the picture to be processed can be reduced to one half of the original length and width based on the top point of the left upper corner of the picture to be processed, and the obtained rectangular area can be regarded as a group of scaling boundaries corresponding to the picture to be processed.
Step S206: when the adjusting operation aiming at the picture to be processed is triggered, the picture to be processed is adjusted to the zooming boundary, and the adjusted picture is obtained.
It will be readily appreciated that the adjustment operations referred to herein may include: drag, pull, drag and/or click, etc., and may be directed to any one or more borders of the picture to be processed.
Due to the fact that the zooming boundary is set, when the size of the picture to be processed is adjusted, the position of the zooming boundary to which the image needs to be automatically adjusted can be determined according to the acting position of zooming operation, the zooming direction and distance and the like.
It should be noted that the adjusted picture may have pixels with the same original size, or may have more or less pixels than the original size.
Through the steps, in the editing page, the zooming boundary is set for the picture to be processed with higher pixels, and after the zooming operation for the picture to be processed is triggered, the picture to be processed is automatically adjusted to the size corresponding to the zooming boundary, so that the adjusting efficiency of the picture size can be effectively improved.
In one or more embodiments of the present specification, setting a scaling boundary corresponding to the picture to be processed according to the size of the picture to be processed may specifically include: setting a plurality of groups of zooming boundaries corresponding to the pictures to be processed according to the size of the pictures to be processed and the effective display area of the editing page; or setting a group of zooming boundaries corresponding to the picture to be processed according to the original size of the picture to be processed and the effective display area of the editing page.
It is easily understood that, in order to meet different scaling requirements of users, multiple sets of scaling boundaries corresponding to different sizes may be determined for the picture to be processed. Generally, a group of scaling boundaries may include a plurality of boundaries, at least one boundary, or a marker point for indicating the position of the scaling boundary.
Generally, the number of pixels of a high-definition picture obtained based on the Retina display technology is usually 2 times or 3 times of the number of pixels of a picture with the same size. And after the pixels of the picture to be processed displayed in the equipment supporting the Retina display technology are compressed, the pixels are displayed according to the original size. However, for a device that does not support the Retina display technology, the pixel size of the picture to be processed displayed in the effective display area of its editing page is 2 times or 3 times the original size. When a reduction operation is performed on a picture to be processed obtained based on a display technology of n-fold enlargement, the reduced size may be 1/n, and a corresponding scaling boundary may be determined based on a reduction ratio of 1/n. Moreover, the scaling boundary can realize the scaling of the length and the width of the picture to be processed in equal proportion, and the length and the width of the picture to be processed cannot be changed.
In one or more embodiments of the present specification, when an adjustment operation for the to-be-processed picture is triggered, adjusting the to-be-processed picture to the zoom boundary may specifically include: when the adjustment operation aiming at the picture to be processed is triggered, determining the action position and/or the adjustment direction of the adjustment operation; automatically sucking the picture to be processed to the zooming boundary based on the acting position and/or the adjusting direction.
The trigger mode of the adjustment operation can be triggered by a finger, a stylus or a mouse. Taking the adjustment operation as a drag operation, a single click or a double click as an example, specifically, the drag operation may drag a vertex or a border of the to-be-processed image, and the single click or the double click may operate on a zoom boundary corresponding to the to-be-processed image.
The action position can be understood as the position where the adjustment operation acts on the picture to be processed. Of course, it is also possible to trigger a control with zoom function by a finger or a stylus, or to trigger a certain position in the active area supporting the zoom function. The adjustment direction is understood to be the direction of action when adjusted by a finger, a mouse or a stylus.
For example, the adjustment operation is a drag operation, and the vertex of the to-be-processed picture may be dragged by the mouse and dragged toward the direction of the position of the zoom boundary. After the dragging direction is determined, the user releases the dragging operation of the mouse, and the picture to be processed is automatically absorbed to the zooming boundary.
In one or more embodiments of the present disclosure, as shown in fig. 3, which is a schematic diagram of a group of zoom boundaries for zooming a picture provided in an embodiment of the present disclosure, when a group of zoom boundaries corresponding to the picture to be processed is set, the automatically sucking the picture to be processed to the zoom boundaries based on the action position and/or the adjustment direction may specifically include: monitoring an adjustment distance for the picture to be processed based on the action position and/or the adjustment direction; and when the adjusting distance is larger than a preset automatic adjusting threshold value, automatically adsorbing the picture to be processed to the zooming boundary.
As shown in fig. 3, monitoring an adjustment distance a corresponding to an adjustment operation for a picture to be processed, assuming that a preset automatic adjustment threshold is b; when the user drags the lower right corner of the picture to be processed by a distance a, the user releases the dragging operation after the user drags the picture to be processed to a position a > b, and the picture to be processed can be automatically absorbed to a preset zooming boundary.
In one or more embodiments of the present disclosure, as shown in fig. 4, which is a schematic diagram of zooming a picture by using multiple sets of zoom boundaries provided in the embodiment of the present disclosure, when multiple sets of zoom boundaries corresponding to the picture to be processed are set, the picture to be processed is automatically adsorbed to the zoom boundaries based on the action position and/or the adjustment direction, which may specifically include: monitoring an adjustment distance for the picture to be processed based on the action position and/or the adjustment direction; determining intervals between the boundary of the picture to be processed and a plurality of scaling boundaries according to the adjusting distance; and automatically adsorbing the picture to be processed to the scaling boundary with the nearest interval distance.
In practical applications, in order to meet the diversified requirements of users, as shown in fig. 4, multiple groups of zoom boundaries may be set for the picture to be processed based on the rich text editing page, for example, a zoom-out by half (as a first zoom boundary in the figure) or a zoom-in by 2 times (as a second zoom boundary in the figure) may be set. When zooming an image to be processed, it needs to be determined to which zoom boundary the user wants to zoom.
The judging method, one embodiment of which may include: monitoring an adjustment distance of a user when adjusting a picture to be processed and a position of an end point of the adjustment operation, further, judging an interval between the position of the current end point and each scaling boundary (for example, a vertical distance between the position of the end point and each scaling boundary), and taking the scaling boundary with the minimum interval as a target scaling boundary; after the target zooming boundary is determined, the picture to be processed can be automatically absorbed or rebounded to the corresponding zooming boundary.
Another embodiment may include: monitoring and comparing the size of the interval between the boundary line of the current picture to be processed and the multiple groups of scaling boundary lines; each group of scaling boundaries simultaneously comprises a plurality of boundary lines, the minimum interval between the boundary line of each group of scaling boundaries and the boundary line of the current picture to be processed is respectively determined, and further, the determined minimum intervals of each group are compared; determining a target scaling boundary according to the comparison result; and automatically adsorbing or rebounding the picture to be processed to the corresponding zooming boundary.
In the editing page, a zooming boundary of a to-be-processed picture with higher pixels is set, and after the zooming operation aiming at the to-be-processed picture is triggered, the to-be-processed picture is automatically adjusted to the zooming boundary, so that the adjusting efficiency of the picture size can be effectively improved, and the user experience is improved.
Based on the same idea, an embodiment of the present specification further provides a picture scaling device, as shown in fig. 5, the device may specifically include:
the measuring module 501 determines the size of the picture to be processed displayed in the editing page; the size of the picture to be adjusted displayed in the editing page is larger than the original size of the picture to be processed;
a setting module 502, configured to set a scaling boundary corresponding to the to-be-processed picture according to the size of the to-be-processed picture;
when the adjustment operation for the to-be-processed picture is triggered, the adjustment module 503 adjusts the to-be-processed picture to the zoom boundary, so as to obtain an adjusted picture.
Further, the setting module 502, according to the size of the to-be-processed picture, sets a scaling boundary corresponding to the to-be-processed picture, which may specifically include: the setting module 502 sets multiple groups of zooming boundaries corresponding to the pictures to be processed according to the sizes of the pictures to be processed and the effective display areas of the editing pages; alternatively, the setting module 502 sets a group of zoom boundaries corresponding to the to-be-processed picture according to the original size of the to-be-processed picture and the effective display area of the editing page.
The adjusting module 503, when triggering an adjusting operation for the to-be-processed picture, adjusts the to-be-processed picture to the zoom boundary, and specifically may include: when the adjustment operation aiming at the picture to be processed is triggered, determining the action position and/or the adjustment direction of the adjustment operation; automatically sucking the picture to be processed to the zooming boundary based on the acting position and/or the adjusting direction.
Further, based on the action position and/or the adjustment direction, the adjustment module 503 monitors an adjustment distance corresponding to the adjustment operation for the picture to be processed; and when the adjusting distance is larger than a preset automatic adjusting threshold value, automatically adsorbing the picture to be processed to the zooming boundary.
Further, based on the action position and/or the adjustment direction, the adjustment module 503 monitors an adjustment distance for the picture to be processed; and according to the adjusting distance, determining the intervals between the boundary of the picture to be processed and the zooming boundaries, and automatically adsorbing the picture to be processed to the zooming boundary with the closest interval distance.
Further, the editing page includes: a text editing page and/or a rich text editing page.
Based on the same idea, an embodiment of this specification further provides an electronic device, including:
at least one processor; and the number of the first and second groups,
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions executable by the at least one processor to enable the at least one processor to:
determining the size of a picture to be processed displayed in the editing page; the size of the picture to be processed displayed in the editing page is larger than the original size of the picture to be processed;
setting a scaling boundary corresponding to the picture to be processed according to the size of the picture to be processed;
when the adjusting operation aiming at the picture to be processed is triggered, the picture to be processed is adjusted to the zooming boundary, and the adjusted picture is obtained.
The foregoing description has been directed to specific embodiments of this disclosure. Other embodiments are within the scope of the following claims. In some cases, the actions or steps recited in the claims may be performed in a different order than in the embodiments and still achieve desirable results. In addition, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some embodiments, multitasking and parallel processing may also be possible or may be advantageous.
The embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the embodiments of the apparatus, the electronic device, and the nonvolatile computer storage medium, since they are substantially similar to the embodiments of the method, the description is simple, and the relevant points can be referred to the partial description of the embodiments of the method.
The apparatus, the electronic device, the nonvolatile computer storage medium and the method provided in the embodiments of the present description correspond to each other, and therefore, the apparatus, the electronic device, and the nonvolatile computer storage medium also have similar advantageous technical effects to the corresponding method.
In the 90 s of the 20 th century, improvements in a technology could clearly distinguish between improvements in hardware (e.g., improvements in circuit structures such as diodes, transistors, switches, etc.) and improvements in software (improvements in process flow). However, as technology advances, many of today's process flow improvements have been seen as direct improvements in hardware circuit architecture. Designers almost always obtain the corresponding hardware circuit structure by programming an improved method flow into the hardware circuit. Thus, it cannot be said that an improvement in the process flow cannot be realized by hardware physical modules. For example, a Programmable Logic Device (PLD), such as a Field Programmable Gate Array (FPGA), is an integrated circuit whose Logic functions are determined by programming the Device by a user. A digital system is "integrated" on a PLD by the designer's own programming without requiring the chip manufacturer to design and fabricate application-specific integrated circuit chips. Furthermore, nowadays, instead of manually making an Integrated Circuit chip, such Programming is often implemented by "logic compiler" software, which is similar to a software compiler used in program development and writing, but the original code before compiling is also written by a specific Programming Language, which is called Hardware Description Language (HDL), and HDL is not only one but many, such as abel (advanced Boolean Expression Language), ahdl (alternate Hardware Description Language), traffic, pl (core universal Programming Language), HDCal (jhdware Description Language), lang, Lola, HDL, laspam, hardward Description Language (vhr Description Language), vhal (Hardware Description Language), and vhigh-Language, which are currently used in most common. It will also be apparent to those skilled in the art that hardware circuitry that implements the logical method flows can be readily obtained by merely slightly programming the method flows into an integrated circuit using the hardware description languages described above.
The controller may be implemented in any suitable manner, for example, the controller may take the form of, for example, a microprocessor or processor and a computer-readable medium storing computer-readable program code (e.g., software or firmware) executable by the (micro) processor, logic gates, switches, an Application Specific Integrated Circuit (ASIC), a programmable logic controller, and an embedded microcontroller, examples of which include, but are not limited to, the following microcontrollers: ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20, and Silicone Labs C8051F320, the memory controller may also be implemented as part of the control logic for the memory. Those skilled in the art will also appreciate that, in addition to implementing the controller as pure computer readable program code, the same functionality can be implemented by logically programming method steps such that the controller is in the form of logic gates, switches, application specific integrated circuits, programmable logic controllers, embedded microcontrollers and the like. Such a controller may thus be considered a hardware component, and the means included therein for performing the various functions may also be considered as a structure within the hardware component. Or even means for performing the functions may be regarded as being both a software module for performing the method and a structure within a hardware component.
The systems, devices, modules or units illustrated in the above embodiments may be implemented by a computer chip or an entity, or by a product with certain functions. One typical implementation device is a computer. In particular, the computer may be, for example, a personal computer, a laptop computer, a cellular telephone, a camera phone, a smartphone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
For convenience of description, the above devices are described as being divided into various units by function, and are described separately. Of course, the functionality of the various elements may be implemented in the same one or more software and/or hardware implementations in implementing one or more embodiments of the present description.
As will be appreciated by one skilled in the art, the present specification embodiments may be provided as a method, system, or computer program product. Accordingly, embodiments of the present description may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, embodiments of the present description may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and so forth) having computer-usable program code embodied therein.
The description has been presented with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the description. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In a typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include forms of volatile memory in a computer readable medium, Random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of a computer-readable medium.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
This description may be described in the general context of computer-executable instructions, such as program modules, being executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform particular tasks or implement particular abstract data types. The specification may also be practiced in distributed computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed computing environment, program modules may be located in both local and remote computer storage media including memory storage devices.
The embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the system embodiment, since it is substantially similar to the method embodiment, the description is simple, and for the relevant points, reference may be made to the partial description of the method embodiment.
The above description is only an example of the present specification, and is not intended to limit the present application. Various modifications and changes may occur to those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.