mirror of
https://github.com/VincentWei/MiniGUI.git
synced 2026-09-26 11:44:16 +08:00
116 lines
4.9 KiB
Plaintext
116 lines
4.9 KiB
Plaintext
.\" This manpage is Copyright (C) 2000 Wei Yongming
|
|
.\" 2000 BluePoint Software
|
|
.\"
|
|
.\" Permission is granted to make and distribute verbatim copies of this
|
|
.\" manual provided the copyright notice and this permission notice are
|
|
.\" preserved on all copies.
|
|
.\"
|
|
.\" Permission is granted to copy and distribute modified versions of this
|
|
.\" manual under the conditions for verbatim copying, provided that the
|
|
.\" entire resulting derived work is distributed under the terms of a
|
|
.\" permission notice identical to this one.
|
|
.\"
|
|
.\" Since MiniGUI is constantly changing, this
|
|
.\" manual page may be incorrect or out-of-date. The author(s) assume no
|
|
.\" responsibility for errors or omissions, or for damages resulting from
|
|
.\" the use of the information contained herein. The author(s) may not
|
|
.\" have taken the same level of care in the production of this manual,
|
|
.\" which is licensed free of charge, as they might when working
|
|
.\" professionally.
|
|
.\"
|
|
.\" Formatted or processed versions of this manual, if unaccompanied by
|
|
.\" the source, must acknowledge the copyright and authors of this work.
|
|
.TH "Mapping" "3" "August 2000" "MiniGUI"
|
|
|
|
.SH "NAME"
|
|
Mapping \- coordinates mapping functions.
|
|
|
|
.SH "SYNOPSIS"
|
|
.B #include <minigui/gdi.h>
|
|
.br
|
|
|
|
.PP
|
|
.BI "int GUIAPI GetMapMode" "(HDC hdc);"
|
|
.br
|
|
.BI "void GUIAPI GetViewportExt" "(HDC hdc, POINT* pPt);"
|
|
.br
|
|
.BI "void GUIAPI GetViewportOrg" "(HDC hdc, POINT* pPt);"
|
|
.br
|
|
.BI "void GUIAPI GetWindowExt" "(HDC hdc, POINT* pPt);"
|
|
.br
|
|
.BI "void GUIAPI GetWindowOrg" "(HDC hdc, POINT* pPt);"
|
|
.PP
|
|
.BI "void GUIAPI SetMapMode" "(HDC hdc, int mapmode);"
|
|
.br
|
|
.BI "void GUIAPI SetViewportExt" "(HDC hdc, POINT* pPt);"
|
|
.br
|
|
.BI "void GUIAPI SetViewportOrg" "(HDC hdc, POINT* pPt);"
|
|
.br
|
|
.BI "void GUIAPI SetWindowExt" "(HDC hdc, POINT* pPt);"
|
|
.br
|
|
.BI "void GUIAPI SetWindowOrg" "(HDC hdc, POINT* pPt);"
|
|
.SH "DESCRIPTION"
|
|
.PP
|
|
\fBGetMapMode\fP function retrives the current mapping mode. So far, MiniGUI support two mapping modes:
|
|
.PP
|
|
.IP \fBMM_TEXT\fP
|
|
Each logical unit is mapped to on device pixel. Positive x is to the right; positive y is down.
|
|
.IP \fBMM_ANISOTROPIC\fP
|
|
Logical units are mapped to arbitrary units with arbitrarily scaled axes; Use \fBSetWindowExt\fP and \fBSetViewportExt\fP functions to specify the units, orientation, and scaling required.
|
|
.PP
|
|
\fBGetViewportExt\fP function retrieves the x-extents and y-extents of the current viewport for the specified display context \fBhdc\fP. the x- and y-extents, in device units, are placed in \fBpPt\fP struct.
|
|
.PP
|
|
\fBGetViewportOrg\fP function retrieves the x-coordinates and y-coordinates of the viewport orgin for the specified display context. The \fBpPt\fP struct will receive the viewport origin.
|
|
.PP
|
|
\fBGetWindowExt\fP function retrives the x-extents and y-extents of the window for the specified display context. The x- and y-extents in page space units (as known as logical units) are placed int \fBpPt\fP struct.
|
|
.PP
|
|
\fBGetWindowOrg\fP function retrives the x-coordinates and y-coordinates of the window origin for the specified device context. The \fBpPt\fP struct will receive the window origin.
|
|
.PP
|
|
\fBSetMapMode\fP function sets the mapping mode of the specified display context. The mapping mode defines the unit of measure used to transform page-space units into device-space units, and also defines the orientation of the device's x and y axes. So far, MiniGUI support only two mapping mode: \fBMM_TEXT\fP and \fBMM_ANISOTROPIC\fP.
|
|
.PP
|
|
\fBSetViewportExt\fP function sets the horizontal and vertical extents of the viewport for a display context by using the specified values in struct \fBpPt\fP.
|
|
.PP
|
|
\fBSetViewportOrg\fP function sets the viewport origin of a display context by using the specified coordinates in struct \fBpPt\fP.
|
|
.PP
|
|
\fBSetWindowExt\fP function sets the horizontal and vertical extents of the window for a display context by using the specified values in struct \fBpPt\fP.
|
|
.PP
|
|
\fBSetWindowOrg\fP function sets the window origin of the display context by using the specified coordinates in struct \fBpPt\fP.
|
|
.SH "NOTE"
|
|
.PP
|
|
The following formula shows the math involved in converting a point from page space to device space.
|
|
.PP
|
|
Dx = ((Lx - WOx) * VEx / WEx) + VOx
|
|
.PP
|
|
The following variables are involved:
|
|
.PP
|
|
.I Dx
|
|
x value in device units
|
|
.br
|
|
.I Lx
|
|
x value in logical units (also known as page space units)
|
|
.br
|
|
.I WOx
|
|
window x origin
|
|
.br
|
|
.I VOx
|
|
viewport x origin
|
|
.br
|
|
.I WEx
|
|
window x-extent
|
|
.br
|
|
.I VEx
|
|
viewport x-extent
|
|
.PP
|
|
The same equation with y replacing x transforms the y component of a point.
|
|
.PP
|
|
The formula first offsets the point from its coordinate origin. This value, no longer biased by the origin, is then scaled into the destination coordinate system by the ratio of the extents. Finally, the scaled value is offset by the destination origin to its final mapping.
|
|
|
|
.SH "SEE ALSO"
|
|
.BR LPtoDP (3),
|
|
.BR DPtoLP (3)
|
|
|
|
.SH "AUTHOR"
|
|
.PP
|
|
This manual page was edited by WEI Yongming <ymwei@minigui.org>.
|
|
If you have any problems, comments or found some bugs, please send messages to me.
|