WO2015196825A1 - Virtual window rotating method, terminal and storage medium - Google Patents

Virtual window rotating method, terminal and storage medium Download PDF

Info

Publication number
WO2015196825A1
WO2015196825A1 PCT/CN2015/073296 CN2015073296W WO2015196825A1 WO 2015196825 A1 WO2015196825 A1 WO 2015196825A1 CN 2015073296 W CN2015073296 W CN 2015073296W WO 2015196825 A1 WO2015196825 A1 WO 2015196825A1
Authority
WO
WIPO (PCT)
Prior art keywords
rotated
virtual window
terminal
angle value
rotation angle
Prior art date
Application number
PCT/CN2015/073296
Other languages
French (fr)
Chinese (zh)
Inventor
樊祥阔
Original Assignee
中兴通讯股份有限公司
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 中兴通讯股份有限公司 filed Critical 中兴通讯股份有限公司
Publication of WO2015196825A1 publication Critical patent/WO2015196825A1/en

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/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0484Interaction techniques based on graphical user interfaces [GUI] for the control of specific functions or operations, e.g. selecting or manipulating an object, an image or a displayed text element, setting a parameter value or selecting a range

Definitions

  • the present invention relates to the field of terminal display, and in particular, to a method for rotating a virtual view, a terminal, and a storage medium.
  • the normal display direction of the screens of these smart terminals is a vertical screen display, but because of the particularity of the product form and its special application scenarios, sometimes the screen must be displayed horizontally.
  • the general practice is to force the operating system to compile into the flat panel display mode, but this will cause the problem that either the screen display interface is too small, or the compatibility is poor, the operating system cannot be started, and replacing the high resolution screen will increase the product cost.
  • embodiments of the present invention are directed to a method, a terminal, and a storage medium for rotating a virtual window.
  • an embodiment of the present invention provides a method for rotating a virtual window, which is applied to a terminal, where the method includes: obtaining a rotation angle value of a virtual window to be rotated in the terminal; and passing the obtained rotation angle value, The proportional transformation transforms the virtual window to be rotated The virtual window after rotation.
  • the embodiment of the present invention provides a terminal, where the terminal includes: an obtaining unit and a rotating unit; wherein the obtaining unit is configured to obtain a rotation angle value of the virtual window to be rotated in the terminal; And a unit configured to rotate the virtual window to be rotated by a proportional transformation based on the obtained rotation angle value to obtain a rotated virtual window.
  • an embodiment of the present invention provides a computer storage medium, wherein a computer program is stored, the computer program configured to execute the method of rotating a virtual window.
  • the terminal rotates the virtual window to be rotated according to the rotation angle of the virtual window to be rotated, and obtains the rotated virtual window, and rotates in this way.
  • the virtual window afterwards is consistent with the size of the virtual window to be rotated, so that the proportional switching between the horizontal screen and the vertical screen can be realized, which effectively solves the problem that the display interface existing in the prior art is too small, and is convenient for the user to operate.
  • the terminal since the terminal only needs to perform a proportional conversion on the rotating virtual window, regardless of any hardware factors, the problem of poor compatibility existing in the prior art is effectively solved, and the operating system cannot be started.
  • FIG. 1 is a schematic flow chart of a method for rotating a virtual window according to an embodiment of the present invention
  • FIGS. 2A to 2D are schematic views of windows of various angles in an embodiment of the present invention.
  • FIG. 3 is a schematic structural diagram of a terminal according to an embodiment of the present invention.
  • the embodiment of the invention provides a method for rotating a virtual window (ViewPort), which is applied to a terminal, and the terminal can be a smart phone, a tablet computer, a multimedia device, or the like.
  • the terminals can be safe Installed an operating system, such as the Android operating system.
  • FIG. 1 is a schematic flowchart of a method for rotating a virtual window according to an embodiment of the present invention. Referring to FIG. 1, the method includes:
  • the value of the rotation angle refers to the angle value at which the virtual window needs to be rotated
  • the virtual window to be rotated can be limited to the following situations:
  • the method is applied to the terminal initialization process.
  • the virtual window to be rotated may be a reference window preset by the operating system.
  • the operating system of the general terminal presets a virtual window of an angle as a reference window, which is usually a 0° window as shown in FIG. 2A, with the upper left corner of the window as the coordinate origin, and the four vertices of the window are respectively A. , B, C, D.
  • a parameter that is, a rotation angle value
  • the terminal manufacturer can also add a parameter, that is, a rotation angle value, to change the reference window of the terminal. For example, if the rotation angle value is set to 270°, then when the terminal obtains the angle value during the initialization process, it is considered that the reference window needs to be rotated by 270°, and the rotated reference window is the initial window.
  • the reference window may be a 90° window as shown in FIG. 2B (the terminal is displayed horizontally), and the window is a window after the window is rotated 90° clockwise; or may be 180 as shown in FIG. 2C.
  • ° window (the terminal is displayed in vertical position), the window is the window after the window is 0° and the window is rotated 180° clockwise; it can also be 270° as shown in Figure 2D (the terminal is displayed horizontally)
  • the window is a window in which the window is 0° and the window is rotated clockwise by 270°, which is not specifically limited in the present invention.
  • the method is applied to the normal use of the terminal.
  • the virtual window to be rotated may be the initial window after the terminal is initialized.
  • the virtual window is also set according to the operating system.
  • the setting of the terminal or terminal manufacturer is initialized to the initial window, then the virtual window is the initial window.
  • the angle value is determined as the rotation angle value of the virtual window to be rotated to change the initial window of the terminal; where the detecting device may be a gravity sensor, a gyroscope, an acceleration sensor
  • the detecting device may be a gravity sensor, a gyroscope, an acceleration sensor
  • the device for example, the direction of the direction of the gravity sensor reporting terminal is 180°, and the terminal determines the direction angle as the rotation angle value.
  • the initial window needs to be rotated by 180°, and the initial window after the rotation is the previous rotation. Windows.
  • the terminal may also read the preset window angle of the application when the user starts an application, and confirm the angle value as the rotation angle value; the terminal may also select the user after the user selects the display mode. The window angle value corresponding to the display mode is confirmed as the rotation angle value.
  • the rotation angle value may be obtained by other ways of obtaining the rotation angle value, which is not specifically limited in the present invention.
  • the method is applied to the normal use of the terminal.
  • the virtual window to be rotated may be the previous window after the last rotation of the terminal.
  • the terminal can rotate the terminal multiple times. Then, for the current rotation, the virtual window to be rotated is the previous window.
  • the terminal can obtain the rotation angle value in several ways. For example, if the direction of the direction of the gravity sensor reporting terminal is 180°, and the terminal determines the direction angle as the rotation angle value, then the previous window needs to be rotated by 180° again.
  • the method of the embodiment of the present invention further includes: obtaining a power-on initialization signal. Specifically, when the user turns on the terminal, for example, when the control terminal is powered on, the terminal obtains the boot initialization signal, enters the boot initialization process, and executes S101.
  • the method of the embodiment of the present invention further includes: obtaining a rotation trigger signal. Specifically, when the terminal obtains the direction angle reported by the detecting device, obtains the application opening command, or obtains the display mode adjusting command, the terminal generates a rotation trigger signal, and executes S101.
  • S102 may be: rotating the virtual window to be rotated by using a first equal-scale transformation template to obtain a rotated virtual window.
  • the terminal manufacturer may pre-store a proportional conversion template corresponding to at least one preset angle value in the terminal, that is, store at least one proportional conversion template; then, in S101.
  • the method of the embodiment of the present invention may further include: determining, from all the equal-scale transformation templates, a first proportional transformation template corresponding to the rotation angle value;
  • S102 is executed again, that is, the virtual window to be rotated is rotated by using the first equal-scale template to obtain a rotated virtual window.
  • the above-mentioned proportional transformation template may be an equal-scale transformation matrix A, and the preset angle values may be 0°, 90°, 180°, and 270°, then the corresponding matrix A may be as shown in formulas (1) to (4). Show.
  • is a preset angle value
  • d Width is the number of pixels on the horizontal line of the terminal screen
  • d Height is the number of pixels on the vertical line of the terminal screen.
  • the fourth template may be determined as the first equal-scale transformation template in the above four equal-scale transformation templates.
  • the rotating virtual window is changed in proportion, that is, the rotating virtual window is rotated to obtain a rotated virtual window.
  • x' is the horizontal coordinate of the pixel in the virtual window after rotation
  • y' is the vertical coordinate of the pixel in the virtual window after rotation
  • x is the horizontal coordinate of the pixel in the virtual window to be rotated
  • y is the vertical of the pixel in the virtual window to be rotated coordinate
  • the terminal manufacturer can also preset a common proportional conversion template in the terminal. Then, after S101, and between S102, the method of the embodiment of the present invention may further include: according to the rotation angle value And generating a first equal-scale transformation template corresponding to the rotation angle value, and then executing S102, that is, rotating the virtual window to be rotated by using the first equal-scale template to obtain the rotated virtual window.
  • the above general proportional transformation template may be an equal-scale transformation matrix B as shown in equation (6).
  • is the rotation angle value
  • t x is the offset amount in the horizontal direction
  • t y is the offset amount in the vertical direction.
  • the values of t x and t y are also different.
  • equation (4) can be generated.
  • the rotating virtual window is rotated to obtain a rotated virtual window.
  • the virtual window to be rotated is defaulted to a 0° window.
  • the virtual window to be rotated can also be a window of other angles.
  • the virtual window to be rotated is the initial window.
  • the rotation is 270° window.
  • the rotation angle of the virtual window to be rotated is 90°, that is, the 270° window needs to be rotated by 90°, then , scaling and other templates may be proportional transformation matrix H, as shown in the following equation (7).
  • the operating system of the terminal may have a rotating window function. Then, when the user turns on the function, when the virtual window is rotated based on the above process, the rotated virtual window appears and the terminal If the current posture does not match, then the equal-scale transformation process needs to be corrected.
  • the method of the embodiment of the present invention further includes: obtaining a screen orientation value according to the current posture of the terminal; It can be said that the terminal can detect the posture of the current terminal through the above detecting device, and obtain the screen direction value.
  • S102 may be: rotating the virtual window to be rotated by a proportional transformation based on the screen direction value and the rotation angle value to obtain a rotated virtual window.
  • the terminal turns on the gravity sensor, detects the current posture of the terminal, and obtains the original data of the space coordinate reported by the gravity sensor, and the operating system converts the data into a screen orientation value, for example, 90°, and then, the screen is passed through the following formula (8).
  • the direction value is corrected.
  • each angle value can be counted, for example, 0° is recorded as 0, 90° is recorded as 1, and 180° is recorded as 2, and 270° is recorded as 3.
  • the terminal respectively determines the proportional conversion templates corresponding to the h correction and rotation angle values, that is, the two matrices as shown in the formula (1) and the formula (4).
  • the terminal rotates the virtual window to be rotated according to the following formula (9) to obtain a rotated virtual window.
  • the touch screen is set on the terminal, since the coordinate conversion of the physical coordinates of the touch screen to the screen pixel is the same as the virtual window rotation, the five points can be obtained by touching the four corners and the center on the touch screen. Physical coordinates; then, according to Cramer's law, the matrix transformation equation is solved, and a set of calibration coefficients is obtained. Then, the physical coordinates reported by the touch display screen are calibrated according to the calibration coefficient, and the exact corresponding pixel coordinates of the screen are obtained, of course, Calibration can also be performed using an open source calibration tool that is currently well established, and the invention is not specifically limited. In practical applications, because of the working characteristics of the touch screen, for the capacitive screen, it is only necessary to perform one calibration at the factory, and for the resistive screen, multiple calibrations are required.
  • the operating system After the virtual window is rotated, the operating system writes the rotated virtual window data to the framebuffer, and the terminal driver controls its display on the hardware screen.
  • the terminal rotates the virtual window to be rotated according to the rotation angle of the virtual window to be rotated, and obtains the rotated virtual window, and thus rotates.
  • the subsequent virtual window is consistent with the size of the virtual window to be rotated, thereby achieving equal-scale switching between the horizontal screen and the vertical screen, which is convenient for the user to operate; preferably, since the terminal only needs to transform the virtual window to be rotated, instead of Consider any hardware factors that prevent the operating system from starting.
  • FIG. 3 is a schematic structural diagram of a terminal according to an embodiment of the present invention. As shown in FIG. 3, the terminal includes: an obtaining unit 31 and a rotating unit 32;
  • the obtaining unit 31 is configured to obtain a rotation angle value of the virtual window to be rotated in the terminal;
  • the rotation unit 32 is configured to rotate the virtual window to be rotated by the proportional transformation based on the obtained rotation angle value to obtain a rotated virtual window.
  • the terminal further comprises: a determining unit 33 configured to determine, after the obtaining unit 31 obtains the rotation angle value, and before the rotation unit 32 rotates the virtual window to be rotated, in the preset at least one proportional transformation template And a first equal-scale transformation template corresponding to the rotation angle value, wherein the proportional transformation template has a one-to-one correspondence with the preset angle value.
  • a determining unit 33 configured to determine, after the obtaining unit 31 obtains the rotation angle value, and before the rotation unit 32 rotates the virtual window to be rotated, in the preset at least one proportional transformation template And a first equal-scale transformation template corresponding to the rotation angle value, wherein the proportional transformation template has a one-to-one correspondence with the preset angle value.
  • the determining unit 33 is further configured to generate a first proportional conversion template corresponding to the rotation angle value according to the rotation angle value and the preset general proportional transformation template before the rotation unit 32 rotates the virtual window to be rotated.
  • the rotating unit 32 is configured to rotate the virtual window to be rotated by using the first equal-scale transformation template to obtain a rotated virtual window.
  • the terminal further includes: a correction unit 34 configured to obtain a screen orientation value according to a current posture of the terminal before the rotation unit 32 rotates the virtual window to be rotated; the rotation unit 32 is specifically configured to pass the rotation angle value The proportional transformation transforms the rotating virtual window to obtain a virtual window to be corrected; the virtual window to be corrected is corrected by the screen direction value to obtain a rotated virtual window.
  • a correction unit 34 configured to obtain a screen orientation value according to a current posture of the terminal before the rotation unit 32 rotates the virtual window to be rotated
  • the rotation unit 32 is specifically configured to pass the rotation angle value
  • the proportional transformation transforms the rotating virtual window to obtain a virtual window to be corrected
  • the virtual window to be corrected is corrected by the screen direction value to obtain a rotated virtual window.
  • the obtaining unit 31, the rotating unit 32, the determining unit 33, and the correcting unit 34 can be set. It can be placed in a processor such as a CPU or an ARM, and can also be set in a single-chip microcomputer or a system-on-chip (SoC), which is not specifically limited in the present invention.
  • a processor such as a CPU or an ARM
  • SoC system-on-chip
  • embodiments of the present invention can be provided as a method, system, or computer program product. Accordingly, the present invention can take the form of a hardware embodiment, a software embodiment, or a combination of software and hardware. Moreover, the invention can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage and optical storage, etc.) including computer usable program code.
  • the computer program instructions can also be stored in a computer readable memory that can direct a computer or other programmable data processing device to operate in a particular manner, such that the instructions stored in the computer readable memory produce an article of manufacture comprising the instruction device.
  • the apparatus implements the functions specified in one or more blocks of a flow or a flow and/or block diagram of the flowchart.
  • These computer program instructions can also be loaded onto a computer or other programmable data processing device such that a series of operational steps are performed on a computer or other programmable device to produce computer-implemented processing for execution on a computer or other programmable device.
  • the instructions provide steps for implementing the functions specified in one or more of the flow or in a block or blocks of a flow diagram.
  • an embodiment of the present invention further provides a computer storage medium, where a calculation is stored
  • a computer program configured to perform the method of rotating a virtual window of an embodiment of the present invention.
  • the terminal rotates the rotating virtual window by proportional transformation to obtain a rotated virtual window, and the virtual window after the rotation is consistent with the size of the virtual window to be rotated, and the horizontal screen and the horizontal screen can be realized.
  • the proportional switching between the vertical screens effectively solves the problem of too small display interface existing in the prior art, and is convenient for the user to operate; preferably, since the terminal only needs to perform proportional conversion on the rotating virtual window, regardless of any hardware. Therefore, the problem of poor compatibility existing in the prior art is effectively solved, and the operating system cannot be started.

Abstract

Disclosed in an embodiment of the present invention is a virtual window rotating method applied to a terminal, the method comprising: acquiring the rotation angle value of a virtual window to be rotated in a terminal; and based on the obtained rotation angle value, rotating the virtual window to be rotated via proportional conversion to obtain a rotated virtual window. Also disclosed in the embodiment of the present invention are a virtual window rotating device and storage medium.

Description

一种旋转虚拟视窗的方法及终端、存储介质Method for rotating virtual window and terminal, storage medium 技术领域Technical field
本发明涉及终端显示领域,尤其涉及一种旋转虚拟视图的方法及终端、存储介质。The present invention relates to the field of terminal display, and in particular, to a method for rotating a virtual view, a terminal, and a storage medium.
背景技术Background technique
随着科学技术的发展,越来越多形态的智能终端出现在人们的生活中,比如,智能手机、平板电脑、多媒体播放器、智能投影仪。这些终端均具有屏幕分辨率低,屏幕尺寸小的特性。With the development of science and technology, more and more forms of intelligent terminals appear in people's lives, such as smart phones, tablets, multimedia players, and smart projectors. These terminals have the characteristics of low screen resolution and small screen size.
目前,这些智能终端的屏幕正常显示方向是竖屏显示,但因为产品形态的特殊性以及其特殊的应用场景,有时候又要求屏幕必须要横屏显示。一般做法是将操作系统强制编译成平板显示模式,但这样就会存在要么屏幕显示界面过小,或者兼容性差导致操作系统无法启动的问题,而更换高分辨率屏幕又会增加产品成本。At present, the normal display direction of the screens of these smart terminals is a vertical screen display, but because of the particularity of the product form and its special application scenarios, sometimes the screen must be displayed horizontally. The general practice is to force the operating system to compile into the flat panel display mode, but this will cause the problem that either the screen display interface is too small, or the compatibility is poor, the operating system cannot be started, and replacing the high resolution screen will increase the product cost.
所以,在现有技术中还并不存在一种较为合理的横屏与竖屏相互切换显示的技术方案。Therefore, in the prior art, there is no more reasonable technical solution for switching display between horizontal screen and vertical screen.
发明内容Summary of the invention
有鉴于此,本发明实施例期望提供一种旋转虚拟视窗的方法及终端、存储介质。In view of this, embodiments of the present invention are directed to a method, a terminal, and a storage medium for rotating a virtual window.
本发明实施例的技术方案是这样实现的:The technical solution of the embodiment of the present invention is implemented as follows:
第一方面,本发明实施例提供一种旋转虚拟视窗的方法,应用于终端,所述方法包括:获得所述终端中待旋转虚拟视窗的旋转角度值;基于获得的所述旋转角度值,通过等比例变换对所述待旋转虚拟视窗进行旋转,获 得旋转后的虚拟视窗。In a first aspect, an embodiment of the present invention provides a method for rotating a virtual window, which is applied to a terminal, where the method includes: obtaining a rotation angle value of a virtual window to be rotated in the terminal; and passing the obtained rotation angle value, The proportional transformation transforms the virtual window to be rotated The virtual window after rotation.
第二方面,本发明实施例提供一种终端,所述终端包括:获得单元和旋转单元;其中,所述获得单元,配置为获得所述终端中待旋转虚拟视窗的旋转角度值;所述旋转单元,配置为基于获得的所述旋转角度值,通过等比例变换对所述待旋转虚拟视窗进行旋转,获得旋转后的虚拟视窗。In a second aspect, the embodiment of the present invention provides a terminal, where the terminal includes: an obtaining unit and a rotating unit; wherein the obtaining unit is configured to obtain a rotation angle value of the virtual window to be rotated in the terminal; And a unit configured to rotate the virtual window to be rotated by a proportional transformation based on the obtained rotation angle value to obtain a rotated virtual window.
第三方面,本发明实施例提供一种计算机存储介质,其中存储有计算机程序,所述计算机程序配置为执行上述的旋转虚拟视窗的方法。In a third aspect, an embodiment of the present invention provides a computer storage medium, wherein a computer program is stored, the computer program configured to execute the method of rotating a virtual window.
本发明实施例所提供的旋转虚拟视窗的方法及终端、存储介质中,终端按照待旋转虚拟视窗的旋转角度,通过等比例变换对待旋转虚拟视窗进行旋转,得到旋转后的虚拟视窗,经过这样旋转之后的虚拟视窗与待旋转虚拟视窗的大小是一致的,如此,就能实现横屏和竖屏之间的等比例切换,有效解决现有技术中存在的显示界面过小的问题,方便用户操作;优选地,由于终端仅需要对待旋转虚拟视窗进行等比例变换,而不用考虑任何硬件上的因素,所以,有效地解决了现有技术中存在的兼容性差的问题,避免了操作系统无法启动。In the method for rotating a virtual window and the terminal and the storage medium provided by the embodiment of the present invention, the terminal rotates the virtual window to be rotated according to the rotation angle of the virtual window to be rotated, and obtains the rotated virtual window, and rotates in this way. The virtual window afterwards is consistent with the size of the virtual window to be rotated, so that the proportional switching between the horizontal screen and the vertical screen can be realized, which effectively solves the problem that the display interface existing in the prior art is too small, and is convenient for the user to operate. Preferably, since the terminal only needs to perform a proportional conversion on the rotating virtual window, regardless of any hardware factors, the problem of poor compatibility existing in the prior art is effectively solved, and the operating system cannot be started.
附图说明DRAWINGS
图1为本发明实施例中的旋转虚拟视窗的方法的流程示意图;1 is a schematic flow chart of a method for rotating a virtual window according to an embodiment of the present invention;
图2A至图2D为本发明实施例中的各角度的视窗的示意图;2A to 2D are schematic views of windows of various angles in an embodiment of the present invention;
图3为本发明实施例中的终端的结构示意图。FIG. 3 is a schematic structural diagram of a terminal according to an embodiment of the present invention.
具体实施方式detailed description
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述。The technical solutions in the embodiments of the present invention will be clearly and completely described in the following with reference to the accompanying drawings.
本发明实施例提供一种旋转虚拟视窗(ViewPort)的方法,应用于终端,该终端可以为智能手机、平板电脑、多媒体设备等。在这些终端中可以安 装有操作系统,如Android操作系统。The embodiment of the invention provides a method for rotating a virtual window (ViewPort), which is applied to a terminal, and the terminal can be a smart phone, a tablet computer, a multimedia device, or the like. In these terminals can be safe Installed an operating system, such as the Android operating system.
图1为本发明实施例中的旋转虚拟视窗的方法的流程示意图,参考图1所示,该方法包括:1 is a schematic flowchart of a method for rotating a virtual window according to an embodiment of the present invention. Referring to FIG. 1, the method includes:
S101:获得终端中待旋转虚拟视窗的旋转角度值;S101: Obtain a rotation angle value of the virtual window to be rotated in the terminal;
这里,所说的旋转角度值就是指虚拟视窗需要旋转的角度值;Here, the value of the rotation angle refers to the angle value at which the virtual window needs to be rotated;
在具体实施过程中,由于该方法应用的时机不同,待旋转虚拟视窗可以且不限有以下几种情况:In the specific implementation process, due to the different timing of the application, the virtual window to be rotated can be limited to the following situations:
第一种情况,该方法应用于终端初始化过程中,此时,待旋转虚拟视窗可以为操作系统预置的基准视窗。In the first case, the method is applied to the terminal initialization process. At this time, the virtual window to be rotated may be a reference window preset by the operating system.
具体来说,一般终端的操作系统都会预置一个角度的虚拟视窗作为基准视窗,通常为如图2A所示的0°视窗,以视窗的左上角为坐标原点,视窗的四个顶点分别为A、B、C、D。但是,为了满足用户日渐增长的需求和个性化要求,终端制造商也可以增加一个参数,也就是旋转角度值,来改变终端的基准视窗。比如,旋转角度值设置为270°,那么,在终端在进行初始化过程中,获得该角度值,就认为基准视窗需要旋转270°,旋转后的基准视窗就是初始视窗。Specifically, the operating system of the general terminal presets a virtual window of an angle as a reference window, which is usually a 0° window as shown in FIG. 2A, with the upper left corner of the window as the coordinate origin, and the four vertices of the window are respectively A. , B, C, D. However, in order to meet the increasing user demand and individualization requirements, the terminal manufacturer can also add a parameter, that is, a rotation angle value, to change the reference window of the terminal. For example, if the rotation angle value is set to 270°, then when the terminal obtains the angle value during the initialization process, it is considered that the reference window needs to be rotated by 270°, and the rotated reference window is the initial window.
当然,上述基准视窗可以为如图2B所示的90°视窗(此时终端横屏显示),该视窗为0°视窗顺时针旋转90°后的视窗;也可以为如图2C所示的180°视窗(此时终端竖屏显示),该视窗为该视窗为0°视窗顺时针旋转180°后的视窗;还可以为如图2D所示的270°(此时终端横屏显示),该视窗为该视窗为0°视窗顺时针旋转270°后的视窗,本发明不做具体限定。Of course, the reference window may be a 90° window as shown in FIG. 2B (the terminal is displayed horizontally), and the window is a window after the window is rotated 90° clockwise; or may be 180 as shown in FIG. 2C. ° window (the terminal is displayed in vertical position), the window is the window after the window is 0° and the window is rotated 180° clockwise; it can also be 270° as shown in Figure 2D (the terminal is displayed horizontally) The window is a window in which the window is 0° and the window is rotated clockwise by 270°, which is not specifically limited in the present invention.
第二种情况,该方法应用于终端正常使用过程中,此时,待旋转虚拟视窗可以为终端初始化后的初始视窗。In the second case, the method is applied to the normal use of the terminal. At this time, the virtual window to be rotated may be the initial window after the terminal is initialized.
具体来说,在终端完成初始化过程后,虚拟视窗也按照操作系统的设 置或者终端制造商的设置初始化为初始视窗,那么,虚拟视窗就为初始视窗。当终端获得检测装置上报的当前终端的方向角度后,将该角度值确定为待旋转虚拟视窗的旋转角度值,来改变终端的初始视窗;这里,检测装置可以是重力传感器、陀螺仪、加速度传感器等设备,例如,重力传感器上报终端的方向角为180°,终端将该方向角确定为旋转角度值,那么,就需要将初始视窗旋转180°,旋转后的初始视窗就是下一次旋转的前次视窗。Specifically, after the terminal completes the initialization process, the virtual window is also set according to the operating system. The setting of the terminal or terminal manufacturer is initialized to the initial window, then the virtual window is the initial window. After the terminal obtains the direction angle of the current terminal reported by the detecting device, the angle value is determined as the rotation angle value of the virtual window to be rotated to change the initial window of the terminal; where the detecting device may be a gravity sensor, a gyroscope, an acceleration sensor The device, for example, the direction of the direction of the gravity sensor reporting terminal is 180°, and the terminal determines the direction angle as the rotation angle value. Then, the initial window needs to be rotated by 180°, and the initial window after the rotation is the previous rotation. Windows.
在实际应用中,终端也可以在用户开启一应用时,读取该应用预设的视窗角度,将该角度值确认为旋转角度值;终端还可以在用户选择显示模式之后,将用户所选的显示模式对应的视窗角度值确认为旋转角度值。当然,还可以有其它的获得旋转角度值的方式,本发明不做具体限定。In an actual application, the terminal may also read the preset window angle of the application when the user starts an application, and confirm the angle value as the rotation angle value; the terminal may also select the user after the user selects the display mode. The window angle value corresponding to the display mode is confirmed as the rotation angle value. Of course, there may be other ways of obtaining the rotation angle value, which is not specifically limited in the present invention.
第三种情况,该方法应用于终端正常使用过程中,此时,待旋转虚拟视窗可以为终端上一次旋转后的前次视窗。In the third case, the method is applied to the normal use of the terminal. At this time, the virtual window to be rotated may be the previous window after the last rotation of the terminal.
具体来说,终端在被用户使用的过程中,可以多次旋转终端,那么,对于本次旋转来说,待旋转虚拟视窗即为前次视窗。终端可以通过上述几种方式获得旋转角度值。例如,重力传感器上报终端的方向角为180°,终端将该方向角确定为旋转角度值,那么,就需要将前次视窗再次旋转180°。Specifically, in the process of being used by the user, the terminal can rotate the terminal multiple times. Then, for the current rotation, the virtual window to be rotated is the previous window. The terminal can obtain the rotation angle value in several ways. For example, if the direction of the direction of the gravity sensor reporting terminal is 180°, and the terminal determines the direction angle as the rotation angle value, then the previous window needs to be rotated by 180° again.
在另一实施例中,对于上述第一种情况,在S101之前,本发明实施例的方法还包括:获得开机初始化信号。具体来说就是,当用户开启终端,如控制终端上电开机时,终端获得开机初始化信号,进入开机初始化流程,执行S101。In another embodiment, for the first case, before S101, the method of the embodiment of the present invention further includes: obtaining a power-on initialization signal. Specifically, when the user turns on the terminal, for example, when the control terminal is powered on, the terminal obtains the boot initialization signal, enters the boot initialization process, and executes S101.
对于上述第二种情况和第三种情况,在S101之前,本发明实施例的方法还包括:获得旋转触发信号。具体来说就是,终端获得检测装置上报的方向角度、获得应用开启指令或者获得显示模式调整指令时,生成旋转触发信号,执行S101。 For the second case and the third case, before the S101, the method of the embodiment of the present invention further includes: obtaining a rotation trigger signal. Specifically, when the terminal obtains the direction angle reported by the detecting device, obtains the application opening command, or obtains the display mode adjusting command, the terminal generates a rotation trigger signal, and executes S101.
S102:基于获得的旋转角度值,通过等比例变换对待旋转虚拟视窗进行旋转,获得旋转后的虚拟视窗。S102: Rotate the virtual window to be rotated by an equal conversion according to the obtained rotation angle value, and obtain a rotated virtual window.
在具体实施过程中,S102可以为:采用第一等比例变换模板旋转待旋转虚拟视窗,获得旋转后的虚拟视窗。In a specific implementation process, S102 may be: rotating the virtual window to be rotated by using a first equal-scale transformation template to obtain a rotated virtual window.
具体来说,在终端出厂前,终端制造商可以在终端中预先存储与至少一个预置角度值一一对应的等比例变换模板,也就是说,存储至少一个等比例变换模板;那么,在S101之后,且在S102之前,本发明实施例的方法还可以包括:从所有等比例变换模板中确定出与旋转角度值对应的第一等比例变换模板;Specifically, before the terminal leaves the factory, the terminal manufacturer may pre-store a proportional conversion template corresponding to at least one preset angle value in the terminal, that is, store at least one proportional conversion template; then, in S101. After the method, the method of the embodiment of the present invention may further include: determining, from all the equal-scale transformation templates, a first proportional transformation template corresponding to the rotation angle value;
然后,再执行S102,即采用第一等比例模板旋转待旋转虚拟视窗,获得旋转后的虚拟视窗。Then, S102 is executed again, that is, the virtual window to be rotated is rotated by using the first equal-scale template to obtain a rotated virtual window.
例如,上述等比例变换模板可以为等比例变换矩阵A,预置角度值可以为0°、90°、180°及270°,那么,对应的矩阵A可以如公式(1)至(4)所示。For example, the above-mentioned proportional transformation template may be an equal-scale transformation matrix A, and the preset angle values may be 0°, 90°, 180°, and 270°, then the corresponding matrix A may be as shown in formulas (1) to (4). Show.
Figure PCTCN2015073296-appb-000001
Figure PCTCN2015073296-appb-000001
Figure PCTCN2015073296-appb-000002
Figure PCTCN2015073296-appb-000002
Figure PCTCN2015073296-appb-000003
Figure PCTCN2015073296-appb-000003
Figure PCTCN2015073296-appb-000004
Figure PCTCN2015073296-appb-000004
其中,α为预置角度值,dWidth为终端屏幕的水平线上具有的像素数,dHeight为终端屏幕的垂线上具有的像素数。Where α is a preset angle value, d Width is the number of pixels on the horizontal line of the terminal screen, and d Height is the number of pixels on the vertical line of the terminal screen.
那么,当终端通过S101获得待旋转虚拟视窗的旋转角度值之后,可以在上述四个等比例变换模板中确定第四个模板为第一等比例变换模板。Then, after the terminal obtains the rotation angle value of the virtual window to be rotated through S101, the fourth template may be determined as the first equal-scale transformation template in the above four equal-scale transformation templates.
接下来,按照以下公式(5)对待旋转虚拟视窗进行等比例变化,即对待旋转虚拟视窗进行旋转,获得旋转后的虚拟视窗。Next, according to the following formula (5), the rotating virtual window is changed in proportion, that is, the rotating virtual window is rotated to obtain a rotated virtual window.
[x′ y′ 1]=[x y 1]×A|α=270°  (5)[x'y' 1]=[x y 1]×A| α=270° (5)
其中,x′为旋转后虚拟视窗中像素的水平坐标,y′为旋转后虚拟视窗中像素的垂直坐标;x为待旋转虚拟视窗中像素的水平坐标,y为待旋转虚拟视窗中像素的垂直坐标。Where x' is the horizontal coordinate of the pixel in the virtual window after rotation, y' is the vertical coordinate of the pixel in the virtual window after rotation; x is the horizontal coordinate of the pixel in the virtual window to be rotated, and y is the vertical of the pixel in the virtual window to be rotated coordinate.
当然,在终端出厂前,终端制造商还可以在终端中预先设置一个通用等比例变换模板,那么,在S101之后,且在S102之间,本发明实施例的方法还可以包括:根据旋转角度值和预先设置的通用等比例变换模板,生成与旋转角度值对应的第一等比例变换模板;然后,再执行S102,即采用第一等比例模板旋转待旋转虚拟视窗,获得旋转后的虚拟视窗。Of course, before the terminal leaves the factory, the terminal manufacturer can also preset a common proportional conversion template in the terminal. Then, after S101, and between S102, the method of the embodiment of the present invention may further include: according to the rotation angle value And generating a first equal-scale transformation template corresponding to the rotation angle value, and then executing S102, that is, rotating the virtual window to be rotated by using the first equal-scale template to obtain the rotated virtual window.
例如,上述通用等比例变换模板可以为等比例变换矩阵B,如公式(6)所示。For example, the above general proportional transformation template may be an equal-scale transformation matrix B as shown in equation (6).
Figure PCTCN2015073296-appb-000005
Figure PCTCN2015073296-appb-000005
其中,β为旋转角度值,tx为水平方向上的偏移量,ty为垂直方向上的 偏移量。在旋转角度值不同时,tx和ty的取值也不同。当β=0°时,tx=0ty=0;当β=90°时,tx=dHeight,ty=0;当β=180°时,tx=dwidth,ty=dHeight;当β=270°时,tx=0,ty=dWidthWhere β is the rotation angle value, t x is the offset amount in the horizontal direction, and t y is the offset amount in the vertical direction. When the values of the rotation angle are different, the values of t x and t y are also different. When β=0°, t x =0 , t y =0; when β=90°, t x =d Height , t y =0; when β=180°, t x =d width ,t y =d Height ; when β=270°, t x =0, t y =d Width .
那么,将β=270°、tx=0及ty=dWidth带入式(6)就可以生成公式(4)。Then, by introducing β = 270°, t x =0, and t y = d Width into equation (6), equation (4) can be generated.
最后,按照公式(5)对待旋转虚拟视窗进行旋转,得到旋转后的虚拟视窗。Finally, according to the formula (5), the rotating virtual window is rotated to obtain a rotated virtual window.
在上述旋转过程中,均默认待旋转虚拟视窗为0°视窗。而在实际应用中,待旋转虚拟视窗也可以为其它角度的视窗。During the above rotation process, the virtual window to be rotated is defaulted to a 0° window. In practical applications, the virtual window to be rotated can also be a window of other angles.
举例来说,待旋转虚拟视窗为初始视窗,在初始化过程中,旋转为270°视窗,此时,待旋转虚拟视窗的旋转角度值为90°,也就是270°视窗需要再旋转90°,那么,等比例变换模板可以为等比例变换矩阵H如以下公式(7)所示。For example, the virtual window to be rotated is the initial window. During the initialization process, the rotation is 270° window. At this time, the rotation angle of the virtual window to be rotated is 90°, that is, the 270° window needs to be rotated by 90°, then , scaling and other templates may be proportional transformation matrix H, as shown in the following equation (7).
H=A|α=270°·A|α=90°  (7)H=A| α=270° ·A| α=90° (7)
接下来,用H替换公式(5)中的等比例变换矩阵A,获得旋转后的虚拟视窗,此时,旋转后的虚拟视窗为0°视窗。Next, replace the proportional transformation matrix A in the formula (5) with H to obtain a rotated virtual window. At this time, the rotated virtual window is a 0° window.
在另一实施例中,终端的操作系统可能自带有旋转视窗功能,那么,当用户开启该功能后,在基于上述过程对对虚拟视窗进行旋转时,旋转后的虚拟视窗就会出现与终端当前姿态不匹配的情况,那么,此时就需要对等比例变换过程进行校正,此时,在S102之前,本发明实施例的方法还包括:根据终端的当前姿态,获得屏幕方向值;也就是说,终端可以通过上述检测装置检测当前终端所处的姿态,获得屏幕方向值。In another embodiment, the operating system of the terminal may have a rotating window function. Then, when the user turns on the function, when the virtual window is rotated based on the above process, the rotated virtual window appears and the terminal If the current posture does not match, then the equal-scale transformation process needs to be corrected. At this time, before S102, the method of the embodiment of the present invention further includes: obtaining a screen orientation value according to the current posture of the terminal; It can be said that the terminal can detect the posture of the current terminal through the above detecting device, and obtain the screen direction value.
在这种情况下,S102可以为:基于屏幕方向值及旋转角度值,通过等比例变换对待旋转虚拟视窗进行旋转,获得旋转后的虚拟视窗。In this case, S102 may be: rotating the virtual window to be rotated by a proportional transformation based on the screen direction value and the rotation angle value to obtain a rotated virtual window.
举例来说,假设终端的待旋转虚拟视窗为0°视窗,预置的旋转角度值 为270°。首先,终端打开重力传感器,检测得到终端的当前姿态,获得重力传感器上报空间坐标原始数据,操作系统会把这些数据换算成屏幕方向值,比如,90°,接着,通过以下公式(8)对屏幕方向值进行校正。这里,可以对各个角度值进行记数,如将0°记为0,90°记为1,将180°记为2,将270°记为3。For example, suppose the virtual window of the terminal to be rotated is a 0° window, and the preset rotation angle value is It is 270°. First, the terminal turns on the gravity sensor, detects the current posture of the terminal, and obtains the original data of the space coordinate reported by the gravity sensor, and the operating system converts the data into a screen orientation value, for example, 90°, and then, the screen is passed through the following formula (8). The direction value is corrected. Here, each angle value can be counted, for example, 0° is recorded as 0, 90° is recorded as 1, and 180° is recorded as 2, and 270° is recorded as 3.
h校正=(h+4-3)%4  (8)h correction = (h+4-3)%4 (8)
其中,h校正为校正后的记数,h为屏幕方向值的记数;那么,对应于屏幕方向值h=90°,可以得到h校正=2。Where h is corrected to the corrected count and h is the count of the screen orientation value; then, corresponding to the screen orientation value h=90°, h correction =2 can be obtained.
下一步,终端分别确定与h校正和旋转角度值对应的等比例变换模板,即如公式(1)和公式(4)所示的两个矩阵。Next, the terminal respectively determines the proportional conversion templates corresponding to the h correction and rotation angle values, that is, the two matrices as shown in the formula (1) and the formula (4).
最后,终端按照以下公式(9),对待旋转虚拟视窗进行旋转,获得旋转后的虚拟视窗。Finally, the terminal rotates the virtual window to be rotated according to the following formula (9) to obtain a rotated virtual window.
[x′ y′ 1]=[x y 1]×H  (9)[x' y' 1]=[x y 1]×H (9)
优选地,如果终端上设置的是触摸显示屏的话,由于触摸屏的物理坐标到屏幕像素的坐标转换和虚拟视窗旋转一样,因此,可以通过触摸触摸显示屏上的四角及中心得到这五个点的物理坐标;然后,根据克莱姆法则求解矩阵变换方程,得出一组校准系数,那么,之后触摸显示屏上报的物理坐标都根据该校准系数进行校准,得到精确对应的屏幕像素坐标,当然,也可以使用当前已经很成熟的开源校准工具进行校准,本发明不做具体限定。在实际应用中,因为触摸屏的工作特性,对于电容屏来说,只需在出厂时进行一次校准即可,而对于电阻屏来说,则要进行多次校准。Preferably, if the touch screen is set on the terminal, since the coordinate conversion of the physical coordinates of the touch screen to the screen pixel is the same as the virtual window rotation, the five points can be obtained by touching the four corners and the center on the touch screen. Physical coordinates; then, according to Cramer's law, the matrix transformation equation is solved, and a set of calibration coefficients is obtained. Then, the physical coordinates reported by the touch display screen are calibrated according to the calibration coefficient, and the exact corresponding pixel coordinates of the screen are obtained, of course, Calibration can also be performed using an open source calibration tool that is currently well established, and the invention is not specifically limited. In practical applications, because of the working characteristics of the touch screen, for the capacitive screen, it is only necessary to perform one calibration at the factory, and for the resistive screen, multiple calibrations are required.
在虚拟视窗旋转之后,操作系统将旋转后的虚拟视窗数据写入framebuffer,终端驱动程序控制其在硬件屏幕上的显示。After the virtual window is rotated, the operating system writes the rotated virtual window data to the framebuffer, and the terminal driver controls its display on the hardware screen.
由此可以看出,终端按照待旋转虚拟视窗的旋转角度,通过等比例变换对待旋转虚拟视窗进行旋转,得到旋转后的虚拟视窗,经过这样旋转之 后的虚拟视窗与待旋转虚拟视窗的大小是一致的,从而实现了横屏和竖屏之间的等比例切换,方便用户操作;优选地,由于终端仅需要对待旋转虚拟视窗进行变换,而不用考虑任何硬件上的因素,避免了操作系统无法启动。It can be seen that the terminal rotates the virtual window to be rotated according to the rotation angle of the virtual window to be rotated, and obtains the rotated virtual window, and thus rotates. The subsequent virtual window is consistent with the size of the virtual window to be rotated, thereby achieving equal-scale switching between the horizontal screen and the vertical screen, which is convenient for the user to operate; preferably, since the terminal only needs to transform the virtual window to be rotated, instead of Consider any hardware factors that prevent the operating system from starting.
基于同一发明构思,本发明实施例还提供一种终端,图3为本发明实施例中的终端的结构示意图,如图3所示,该终端包括:获得单元31和旋转单元32;其中,Based on the same inventive concept, the embodiment of the present invention further provides a terminal. FIG. 3 is a schematic structural diagram of a terminal according to an embodiment of the present invention. As shown in FIG. 3, the terminal includes: an obtaining unit 31 and a rotating unit 32;
获得单元31,配置为获得终端中待旋转虚拟视窗的旋转角度值;The obtaining unit 31 is configured to obtain a rotation angle value of the virtual window to be rotated in the terminal;
旋转单元32,配置为基于获得的旋转角度值,通过等比例变换对待旋转虚拟视窗进行旋转,获得旋转后的虚拟视窗。The rotation unit 32 is configured to rotate the virtual window to be rotated by the proportional transformation based on the obtained rotation angle value to obtain a rotated virtual window.
优选地,该终端还包括:确定单元33,配置为在获得单元31获得旋转角度值之后,且在旋转单元32对待旋转虚拟视窗进行旋转之前,在预置的至少一个等比例变换模板中确定出与旋转角度值对应的第一等比例变换模板,其中,等比例变换模板与预置角度值一一对应。Preferably, the terminal further comprises: a determining unit 33 configured to determine, after the obtaining unit 31 obtains the rotation angle value, and before the rotation unit 32 rotates the virtual window to be rotated, in the preset at least one proportional transformation template And a first equal-scale transformation template corresponding to the rotation angle value, wherein the proportional transformation template has a one-to-one correspondence with the preset angle value.
优选地,确定单元33,还配置为在旋转单元32对待旋转虚拟视窗进行旋转之前,根据旋转角度值和预先设置的通用等比例变换模板,生成与旋转角度值对应的第一等比例变换模板。Preferably, the determining unit 33 is further configured to generate a first proportional conversion template corresponding to the rotation angle value according to the rotation angle value and the preset general proportional transformation template before the rotation unit 32 rotates the virtual window to be rotated.
优选地,旋转单元32,具体配置为采用第一等比例变换模板旋转待旋转虚拟视窗,获得旋转后的虚拟视窗。Preferably, the rotating unit 32 is configured to rotate the virtual window to be rotated by using the first equal-scale transformation template to obtain a rotated virtual window.
优选地,该终端还包括:校正单元34,配置为在旋转单元32对待旋转虚拟视窗进行旋转之前,根据终端的当前姿态,获得屏幕方向值;旋转单元32,具体配置为基于旋转角度值,通过等比例变换对待旋转虚拟视窗进行旋转,获得待校正虚拟视窗;通过屏幕方向值校正待校正虚拟视窗,获得旋转后的虚拟视窗。Preferably, the terminal further includes: a correction unit 34 configured to obtain a screen orientation value according to a current posture of the terminal before the rotation unit 32 rotates the virtual window to be rotated; the rotation unit 32 is specifically configured to pass the rotation angle value The proportional transformation transforms the rotating virtual window to obtain a virtual window to be corrected; the virtual window to be corrected is corrected by the screen direction value to obtain a rotated virtual window.
上述获得单元31、旋转单元32、确定单元33及校正单元34均可以设 置在如CPU、ARM等处理器中,还可以设置在单片机或者系统级芯片(SoC,System on Chip)中,本发明不做具体限定。The obtaining unit 31, the rotating unit 32, the determining unit 33, and the correcting unit 34 can be set. It can be placed in a processor such as a CPU or an ARM, and can also be set in a single-chip microcomputer or a system-on-chip (SoC), which is not specifically limited in the present invention.
本领域内的技术人员应明白,本发明的实施例可提供为方法、系统、或计算机程序产品。因此,本发明可采用硬件实施例、软件实施例、或结合软件和硬件方面的实施例的形式。而且,本发明可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器和光学存储器等)上实施的计算机程序产品的形式。Those skilled in the art will appreciate that embodiments of the present invention can be provided as a method, system, or computer program product. Accordingly, the present invention can take the form of a hardware embodiment, a software embodiment, or a combination of software and hardware. Moreover, the invention can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage and optical storage, etc.) including computer usable program code.
本发明是参照根据本发明实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。The present invention has been described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (system), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flowchart illustrations and/or FIG. These computer program instructions can be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing device to produce a machine for the execution of instructions for execution by a processor of a computer or other programmable data processing device. Means for implementing the functions specified in one or more of the flow or in a block or blocks of the flow chart.
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。The computer program instructions can also be stored in a computer readable memory that can direct a computer or other programmable data processing device to operate in a particular manner, such that the instructions stored in the computer readable memory produce an article of manufacture comprising the instruction device. The apparatus implements the functions specified in one or more blocks of a flow or a flow and/or block diagram of the flowchart.
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。These computer program instructions can also be loaded onto a computer or other programmable data processing device such that a series of operational steps are performed on a computer or other programmable device to produce computer-implemented processing for execution on a computer or other programmable device. The instructions provide steps for implementing the functions specified in one or more of the flow or in a block or blocks of a flow diagram.
相应的,本发明实施例还提供一种计算机存储介质,其中存储有计算 机程序,该计算机程序配置为执行本发明实施例的旋转虚拟视窗的方法。Correspondingly, an embodiment of the present invention further provides a computer storage medium, where a calculation is stored A computer program configured to perform the method of rotating a virtual window of an embodiment of the present invention.
以上所述,仅为本发明的较佳实施例而已,并非用于限定本发明的保护范围。The above is only the preferred embodiment of the present invention and is not intended to limit the scope of the present invention.
工业实用性Industrial applicability
综合本发明的各实施例,终端通过等比例变换对待旋转虚拟视窗进行旋转,得到旋转后的虚拟视窗,经过这样旋转之后的虚拟视窗与待旋转虚拟视窗的大小是一致的,能实现横屏和竖屏之间的等比例切换,有效解决现有技术中存在的显示界面过小的问题,方便用户操作;优选地,由于终端仅需要对待旋转虚拟视窗进行等比例变换,而不用考虑任何硬件上的因素,所以,有效地解决了现有技术中存在的兼容性差的问题,避免了操作系统无法启动。 According to various embodiments of the present invention, the terminal rotates the rotating virtual window by proportional transformation to obtain a rotated virtual window, and the virtual window after the rotation is consistent with the size of the virtual window to be rotated, and the horizontal screen and the horizontal screen can be realized. The proportional switching between the vertical screens effectively solves the problem of too small display interface existing in the prior art, and is convenient for the user to operate; preferably, since the terminal only needs to perform proportional conversion on the rotating virtual window, regardless of any hardware. Therefore, the problem of poor compatibility existing in the prior art is effectively solved, and the operating system cannot be started.

Claims (11)

  1. 一种旋转虚拟视窗的方法,应用于终端,所述方法包括:A method for rotating a virtual window is applied to a terminal, and the method includes:
    获得所述终端中待旋转虚拟视窗的旋转角度值;Obtaining a rotation angle value of the virtual window to be rotated in the terminal;
    基于获得的所述旋转角度值,通过等比例变换对所述待旋转虚拟视窗进行旋转,获得旋转后的虚拟视窗。Based on the obtained rotation angle value, the virtual window to be rotated is rotated by a proportional transformation to obtain a rotated virtual window.
  2. 根据权利要求1所述的方法,其中,在所述获得所述终端中待旋转虚拟视窗的旋转角度值之后,且在所述基于获得的所述旋转角度值,通过等比例变换对所述待旋转虚拟视窗进行旋转之前,所述方法还包括:The method according to claim 1, wherein after said obtaining a rotation angle value of a virtual window to be rotated in said terminal, and said based on said obtained rotation angle value, said to Before rotating the virtual window for rotation, the method further includes:
    在预置的至少一个等比例变换模板中确定出与所述旋转角度值对应的第一等比例变换模板;其中,所述等比例变换模板与预置角度值一一对应。Determining, in the preset at least one equal-scale transformation template, a first proportional transformation template corresponding to the rotation angle value; wherein the proportional transformation template has a one-to-one correspondence with the preset angle value.
  3. 根据权利要求1所述的方法,其中,在所述基于获得的所述旋转角度值,通过等比例变换对所述待旋转虚拟视窗进行旋转之前,所述方法还包括:The method according to claim 1, wherein before the rotating the virtual window to be rotated by the proportional transformation based on the obtained rotation angle value, the method further comprises:
    根据所述旋转角度值和预先设置的通用等比例变换模板,生成与所述旋转角度值对应的第一等比例变换模板。And generating a first proportional conversion template corresponding to the rotation angle value according to the rotation angle value and a preset general proportional transformation template.
  4. 根据权利要求2或3所述的方法,其中,所述基于获得的所述旋转角度值,通过等比例变换对所述待旋转虚拟视窗进行旋转,获得旋转后的虚拟视窗,具体为:The method according to claim 2 or 3, wherein the rotating the virtual window to be rotated is rotated by a proportional transformation based on the obtained rotation angle value to obtain a rotated virtual window, specifically:
    采用所述第一等比例变换模板旋转所述待旋转虚拟视窗,获得所述旋转后的虚拟视窗。Rotating the virtual window to be rotated by using the first proportional transformation template to obtain the rotated virtual window.
  5. 根据权利要求1所述的方法,其中,所述方法还包括:The method of claim 1 wherein the method further comprises:
    根据所述终端的当前姿态,获得屏幕方向值;Obtaining a screen orientation value according to a current posture of the terminal;
    所述基于获得的所述旋转角度值,通过等比例变换对所述待旋转虚拟视窗进行旋转,获得旋转后的虚拟视窗,具体为:And rotating, according to the obtained rotation angle value, the virtual window to be rotated by a proportional transformation to obtain a rotated virtual window, specifically:
    基于所述屏幕方向值及所述旋转角度值,通过等比例变换对所述待旋 转虚拟视窗进行旋转,获得所述旋转后的虚拟视窗。Determining the to-be-rotated by proportional transformation based on the screen orientation value and the rotation angle value Rotate the virtual window to rotate to obtain the rotated virtual window.
  6. 一种终端,所述终端包括:获得单元和旋转单元;其中,A terminal, the terminal comprising: an obtaining unit and a rotating unit; wherein
    所述获得单元,配置为获得所述终端中待旋转虚拟视窗的旋转角度值;The obtaining unit is configured to obtain a rotation angle value of the virtual window to be rotated in the terminal;
    所述旋转单元,配置为基于获得的所述旋转角度值,通过等比例变换对所述待旋转虚拟视窗进行旋转,获得旋转后的虚拟视窗。The rotating unit is configured to rotate the virtual window to be rotated by a proportional transformation based on the obtained rotation angle value to obtain a rotated virtual window.
  7. 根据权利要求6所述的终端,其中,所述终端还包括:确定单元,配置为在所述获得单元获得所述旋转角度值之后,且在所述旋转单元对所述待旋转虚拟视窗进行旋转之前,在预置的至少一个等比例变换模板中确定出与所述旋转角度值对应的第一等比例变换模板;其中,所述等比例变换模板与预置角度值一一对应。The terminal according to claim 6, wherein the terminal further comprises: a determining unit configured to rotate the virtual window to be rotated after the obtaining unit obtains the rotation angle value The first proportional conversion template corresponding to the rotation angle value is determined in the preset at least one proportional transformation template; wherein the proportional transformation template has a one-to-one correspondence with the preset angle value.
  8. 根据权利要求6所述的终端,其中,所述终端还包括:确定单元,配置为在所述旋转单元对所述待旋转虚拟视窗进行旋转之前,根据所述旋转角度值和预先设置的通用等比例变换模板,生成与所述旋转角度值对应的第一等比例变换模板。The terminal according to claim 6, wherein the terminal further comprises: a determining unit configured to: before the rotating unit rotates the virtual window to be rotated, according to the rotation angle value and a preset universal The scale conversion template generates a first proportional transformation template corresponding to the rotation angle value.
  9. 根据权利要求7或8所述的终端,其中,所述旋转单元,配置为采用所述第一等比例变换模板旋转所述待旋转虚拟视窗,获得所述旋转后的虚拟视窗。The terminal according to claim 7 or 8, wherein the rotating unit is configured to rotate the virtual window to be rotated by using the first proportional conversion template to obtain the rotated virtual window.
  10. 根据权利要求6所述的终端,其中,所述终端还包括:校正单元,配置为在所述旋转单元对所述待旋转虚拟视窗进行旋转之前,根据所述终端的当前姿态,获得屏幕方向值;The terminal according to claim 6, wherein the terminal further comprises: a correction unit configured to obtain a screen orientation value according to a current posture of the terminal before the rotation unit rotates the virtual window to be rotated ;
    所述旋转单元,还配置为为:基于所述屏幕方向值及所述旋转角度值,通过等比例变换对所述待旋转虚拟视窗进行旋转,获得所述旋转后的虚拟视窗。The rotating unit is further configured to: rotate the virtual window to be rotated by a proportional transformation based on the screen direction value and the rotation angle value to obtain the rotated virtual window.
  11. 一种计算机存储介质,其中存储有计算机程序,所述计算机程序配置为执行权利要求1至5任一项所述的旋转虚拟视窗的方法。 A computer storage medium storing a computer program configured to perform the method of rotating a virtual window according to any one of claims 1 to 5.
PCT/CN2015/073296 2014-06-27 2015-02-26 Virtual window rotating method, terminal and storage medium WO2015196825A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201410305777.9 2014-06-27
CN201410305777.9A CN104111779A (en) 2014-06-27 2014-06-27 Method and terminal for rotating virtual window

Publications (1)

Publication Number Publication Date
WO2015196825A1 true WO2015196825A1 (en) 2015-12-30

Family

ID=51708592

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2015/073296 WO2015196825A1 (en) 2014-06-27 2015-02-26 Virtual window rotating method, terminal and storage medium

Country Status (2)

Country Link
CN (1) CN104111779A (en)
WO (1) WO2015196825A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113050858A (en) * 2021-03-31 2021-06-29 联想(北京)有限公司 Information processing method and electronic equipment

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104111779A (en) * 2014-06-27 2014-10-22 中兴通讯股份有限公司 Method and terminal for rotating virtual window
CN108574806B (en) * 2017-03-09 2022-05-17 腾讯科技(深圳)有限公司 Video playing method and device

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101644987A (en) * 2008-08-08 2010-02-10 深圳富泰宏精密工业有限公司 Mobile terminal and menu selection method thereof
CN102098373A (en) * 2009-12-10 2011-06-15 Tcl集团股份有限公司 Mobile terminal, screen display method and device thereof
CN104111779A (en) * 2014-06-27 2014-10-22 中兴通讯股份有限公司 Method and terminal for rotating virtual window

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101877736A (en) * 2009-04-30 2010-11-03 深圳富泰宏精密工业有限公司 Automatic adjusting system and method for user interface of mobile terminal
CN103246476B (en) * 2013-04-27 2016-12-28 华为技术有限公司 The spinning solution of a kind of screen content, device and terminal unit
CN103294358B (en) * 2013-05-17 2016-12-28 小米科技有限责任公司 A kind of control the method for screen rotation, device and equipment

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101644987A (en) * 2008-08-08 2010-02-10 深圳富泰宏精密工业有限公司 Mobile terminal and menu selection method thereof
CN102098373A (en) * 2009-12-10 2011-06-15 Tcl集团股份有限公司 Mobile terminal, screen display method and device thereof
CN104111779A (en) * 2014-06-27 2014-10-22 中兴通讯股份有限公司 Method and terminal for rotating virtual window

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113050858A (en) * 2021-03-31 2021-06-29 联想(北京)有限公司 Information processing method and electronic equipment

Also Published As

Publication number Publication date
CN104111779A (en) 2014-10-22

Similar Documents

Publication Publication Date Title
JP6286442B2 (en) Method, apparatus, facility, program and recording medium for controlling rotation of screen screen
US8908098B2 (en) Method and apparatus for interacting with television screen
WO2019136961A1 (en) User interface display identification method, terminal device, storage medium and apparatus
US20150084881A1 (en) Data processing method and electronic device
CN103414844A (en) Video dithering correction method and device
CN107562335B (en) Display area adjusting method and mobile terminal
JP2015219590A5 (en)
WO2017054334A1 (en) Projection method, device, terminal, and computer storage medium
CN111163303B (en) Image display method, device, terminal and storage medium
WO2015196825A1 (en) Virtual window rotating method, terminal and storage medium
TW201435710A (en) Electronic device capable of correcting touch position, touch position correcting system and method
JP2013024908A5 (en)
US20170262123A1 (en) Device, method and computer program product for display of electronic information
CN115409687A (en) Rendering difference detection method based on display buffer area synthesis
WO2019113943A1 (en) Chinese character handwriting processing method and related apparatus
US20170188081A1 (en) Method and apparatus for interacting with display screen
CN108475412B (en) Image processor for wearable device
CN112181332A (en) Display method of any resolution ratio picture of LED cloud spliced wall and LED cloud spliced wall
US20210326028A1 (en) System for controlling a rotation of an object on a touch screen and method thereof
EP3373250A1 (en) Method and portable electronic device for changing graphics processing resolution based on scenario
TWI690825B (en) Electronic device and method with myopia prevention function
US9232201B2 (en) Dynamic projected image color correction based on projected surface coloration
US20150015510A1 (en) Electronic device and method for drawing pictures
WO2016033934A1 (en) Projection method, projection device and computer storage medium
WO2016157418A1 (en) Display control device, information processing device, display control method, display control program, and recording medium

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 15811124

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 15811124

Country of ref document: EP

Kind code of ref document: A1