Graphical input to a computer or other electronic device executing a drawing application may be provided by a variety of peripheral devices including a touch sensitive screen that responds to touch from a user's finger and/or a stylus, a computer mouse, a stylus, a touch pad and other pointing device.
One common use of a physical ruler is to draw a straight line on a sheet of paper using a pen or pencil. In contrast, in a drawing application, a straight line is usually drawn by selecting a line tool from a menu and then selecting the start and end points of the line by ‘clicking’ or touching the points on the touch screen.
More recently, a virtual ruler has been introduced that provides a screen template for drawing a straight line in a drawing application. In this approach, a virtual ruler is displayed on a screen. Touch within the virtual ruler is interpreted as an instruction to move the ruler, while a finger swiping motion outside of the ruler is interpreted as an instruction to draw a straight line. This approach, while closer to the traditional pen, ruler and paper approach, does not provide all of the features available with real pen, ruler and paper. It would be useful to provide an improved virtual ruler that more closely matches all the uses afforded by a physical ruler, pen, and paper.
Exemplary embodiments of the present disclosure will be described below with reference to the included drawings such that like reference numerals refer to like elements and in which:
For simplicity and clarity of illustration, reference numerals may be repeated among the figures to indicate corresponding or analogous elements. Numerous details are set forth to provide an understanding of the illustrative embodiments described herein. The embodiments may be practiced without these details. In other instances, well-known methods, procedures, and components have not been described in detail to avoid obscuring the disclosed embodiments. The description is not to be considered as limited to the scope of the embodiments shown and described herein.
The present disclosure relates to a method and apparatus for stylus input to a host electronic device using a virtual ruler. The virtual ruler comprises a rendering of a ruler on the display of the host electronic device. Host software, executed on the electronic device or a networked processor, interprets stylus input dependent upon the position of the stylus relative to the virtual ruler.
In one embodiment, a user can manipulate and move the ruler around the screen using single and multi-touch gestures. In a further embodiment, the user can manipulate the ruler using the stylus.
Once the ruler is aligned, the stylus may be used for drawing. In one embodiment, the user moves the stylus along, or close to, the ruler's edge as would be done on paper. The host software autocorrects the resulting “ripple” line and creates a straight line along the ruler's edge, as intended by the user. This is done by identifying a position at the edge of the ruler that is closest, in some sense, to the stylus position and then drawing a line to that position, so that the stylus position is relocated to the edge of the ruler.
One aspect of a physical ruler is that a user is prevented from drawing on a sheet of paper in the region covered by the ruler. In particular, an edge of the ruler provides a boundary to the drawing area. This aspect of a ruler may be used for purposes other than drawing straight lines. In some embodiments of the disclosure, this feature is implemented using a virtual ruler.
In one embodiment, stylus positions within the region of the screen where the virtual ruler is rendered are relocated to the edge of the ruler. In a further embodiment, stylus positions within the region of the screen where the virtual ruler is rendered are ignored. In both case, the virtual ruler provides a boundary.
Therefore in accordance with some aspects of the present disclosure, there is provide a method in which an image rendered on a display of an electronic device executing a drawing application is bounded by an edge of virtual ruler. In response to user input, a virtual ruler is rendered in a region of the display, the region being bounded by an edge of the virtual ruler. Responsive to a received stylus gesture, a line is rendered on the display outside of the region bounded by the edge of the virtual ruler.
In a first exemplary mode of operation of the drawing application, a pixel of the rendered line corresponds to a received stylus gesture position auto-corrected to the edge of the virtual.
In a second exemplary mode of operation of the drawing application, a pixel on the rendered line corresponds to a received stylus gesture position auto-corrected to the edge of the virtual ruler if the received stylus gesture position is inside the region bounded by the edge of the virtual ruler and to the received stylus gesture position if the received stylus gesture position is outside the region bounded by the edge of the virtual ruler.
In a third exemplary mode of operation of the drawing application, a pixel on the rendered line corresponds to no position if a received stylus gesture position is inside the region bounded by the edge of the virtual ruler and to the received stylus gesture position if the received stylus gesture position is outside of the region bounded by the edge of the virtual ruler.
The line is rendered outside of the first region if the received stylus gesture position is outside of the region bounded by the edge of the virtual ruler, and no line is rendered in the region bounded by the edge of the virtual ruler if the received stylus gesture position is inside of the region bounded by the edge of the virtual ruler.
In one exemplary embodiment, the length and orientation of the virtual ruler are adjusted in response to stylus input in a first control region of the virtual ruler, and the position of the virtual ruler is adjusted in response to stylus input in a second control region of the virtual ruler.
In a further illustrative embodiment, the length and orientation of the virtual ruler are adjusted in response to a multi-touch input in the first region of the virtual ruler, and the position of the virtual ruler is adjusted in response to a single touch input in the first region of the virtual ruler.
One or more additional virtual rulers may be rendered on the display, in which case the rendered line is further bounded by one or more edges of the additional virtual rulers.
In accordance with another aspect of the present disclosure, there is provided an electronic device having a display and a processor. The processor may be operated to render a virtual ruler in a region of the display, the region being bounded by an edge of the virtual ruler. In response to a received stylus gesture, a line is rendered on the display outside of the region bounded by the edge of the virtual ruler. The line may be curved or straight.
In accordance with certain aspects of the present disclosure, there is provided a non-transitory computer-readable medium having computer-executable instructions that, when executed by a processor, cause the processor to render a virtual ruler in a region of a display in response to user input to a touch screen. The region is bounded by an edge of the virtual ruler. The instruction also cause the processor to render a line on the display outside of the region bounded by the edge of the virtual ruler in response to a received stylus gesture.
The virtual ruler 110 may be rendered as an opaque object, or with various degrees of transparency. A ruler that is at least partially transparent allows the user to view lines or other objects beneath the ruler. This facilitates alignment of the ruler with previously drawn lines or objects.
The position and orientation of the virtual ruler 110 may be adjusted by user interaction with ruler control regions 404, 406 and 408 of the ruler. For example, a user may drag ruler control region 404 to a new location, using a stylus or a finger while the ruler pivots about ruler control region 406. This enables a user to alter the orientation or length of the ruler. Similarly, a user can alter the orientation or length of the ruler by dragging ruler control region 406 to a new location. Dragging ruler control region 408 moves the location of the ruler, but does not change its length. Together, these operations enable positioning of the ruler using the stylus, which is useful for single-handed operation.
In a further illustrative embodiment, position, orientation and length may be altered together by moving regions 404 and 406 at the same time using multi-touch, thereby allowing the ruler to be moved with one hand while the other hand holds the stylus.
In the mode of operation illustrated in
As an example, when points (x,y) on the edge satisfy the equation y=mx+c, the point on the edge, indicated by the arrow 602, that is closest to the stylus position (x0,y0) has coordinates:
the closest point having the same y coordinate, indicated by the arrow 604, has coordinates:
x
2=(yo−c)/m,y2=y2=y0 (2)
and the closest point having the same x coordinate, indicated by the arrow 606, has coordinates:
x
1
=x
0
,y
1
=mx
0
+c (3)
Other auto-correction approaches may be used.
In an illustrative embodiment, when a stylus trajectory begins outside the ruler and then enters the region of the ruler, the trajectory may be ignored even if it enters a ruler control region 404, 406 or 408.
The exemplary embodiments discussed above show how the behaviour of the virtual ruler is not limited to the drawing of straight lines.
Three exemplary modes of operation have been described above. An embodiment may use one or more of the modes. When more than one mode is used, the mode may be selected by the user. The modes of operation are summarized in the table below:
The length and/or angle of the ruler may be varied in a substantially continuously manner or by discrete amounts. For example, a user may select that the angle 1004 of the ruler be ‘snapped’ to the angle closest to a set of specified angles, such as 0°, ±30°, ±45°, ±60°, ±90°, etc. The angle may be measured from the vertical, the horizontal, or from an angled line specified by the user.
As previously described, the virtual ruler may be adjusted using a stylus or other touch input.
The implementations of the present disclosure described above are intended to be merely exemplary. It will be appreciated by those of skill in the art that alterations, modifications and variations to the illustrative embodiments disclosed herein may be made without departing from the scope of the present disclosure. Moreover, selected features from one or more of the above-described embodiments may be combined to create alternative embodiments not explicitly shown and described herein.
It will be appreciated that any module or component disclosed herein that executes instructions may include or otherwise have access to non-transient and tangible computer readable media such as storage media, computer storage media, or data storage devices (removable or non-removable) such as, for example, magnetic disks, optical disks, or tape data storage. Computer storage media may include volatile and non-volatile, removable and non-removable media implemented in any method or technology for storage of information, such as computer readable instructions, data structures, program modules, or other data. Examples of computer storage media include RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disks (DVD) or other optical storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other medium which can be used to store the desired information and which can be accessed by an application, module, or both. Any such computer storage media may be part of the server, any component of or related to the network, backend, etc., or accessible or connectable thereto. Any application or module herein described may be implemented using computer readable/executable instructions that may be stored or otherwise held by such computer readable media.
The implementations of the present disclosure described above are intended to be merely exemplary. It will be appreciated by those of skill in the art that alterations, modifications and variations to the illustrative embodiments disclosed herein may be made without departing from the scope of the present disclosure. Moreover, selected features from one or more of the above-described embodiments may be combined to create alternative embodiments not explicitly shown and described herein.
The present disclosure may be embodied in other specific forms without departing from its spirit or essential characteristics. The described embodiments are to be considered in all respects only as illustrative and not restrictive. The scope of the disclosure is, therefore, indicated by the appended claims rather than by the foregoing description. All changes that come within the meaning and range of equivalency of the claims are to be embraced within their scope.