Files
MiniGUI/doc/man3/miniguiDrawing.3
2017-05-29 12:20:05 +08:00

142 lines
4.2 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 "Drawing" "3" "August 2000" "MiniGUI"
.SH "NAME"
Drawing \- general drawing functions.
.SH "SYNOPSIS"
.B #include <minigui/gdi.h>
.br
.PP
.BI "gal_pixel GUIAPI GetPixel" "(HDC hdc, int x, int y);"
.br
.BI "void GUIAPI SetPixel" "(HDC hdc, int x, int y, gal_pixel c);"
.br
.BI "void GUIAPI GetPixelRGB" "(HDC hdc, int x, int y, int* r, int* g, int* b);"
.br
.BI "void GUIAPI SetPixelRGB" "(HDC hdc, int x, int y, int r, int g, int b);"
.br
.BI "gal_pixel GUIAPI RGB2Pixel" "(HDC hdc, int r, int g, int b);"
.br
.BI "void GUIAPI MoveTo" "(HDC hdc, int x, int y);"
.br
.BI "void GUIAPI LineTo" "(HDC hdc, int x, int y);"
.br
.BI "void GUIAPI Circle" "(HDC hdc, int x, int y, int r);"
.br
.BI "void GUIAPI Rectangle" "(HDC hdc, int x0, int y0, int x1, int y1);"
.br
.BI "void GUIAPI FocusRect" "(HDC hdc, int x0, int y0, int x1, int y1);"
.SH "DESCRIPTION"
.PP
\fBGetPixel\fP function gets pixel at the position \fB(x, y)\fP on the DC \fBhdc\fP.
.PP
\fBSetPixel\fP function sets pixel at the position \fB(x, y)\fP on the DC. You can use pre-defined standard pixel values:
.PP
.I PIXEL_black
black
.br
.I PIXEL_darkred
dark red
.br
.I PIXEL_darkgreen
dark green
.br
.I PIXEL_darkyellow
dark yellow
.br
.I PIXEL_darkblue
dark blue
.br
.I PIXEL_darkmagenta
dark magenta
.br
.I PIXEL_darkcyan
dark cyan
.br
.I PIXEL_lightgray
light gray
.br
.I PIXEL_darkgray
dark gray
.br
.I PIXEL_red
red
.br
.I PIXEL_green
green
.br
.I PIXEL_yellow
yellow
.br
.I PIXEL_blue
blue
.br
.I PIXEL_magenta
magenta
.br
.I PIXEL_cyan
cyan
.br
.I PIXEL_lightwhite
light white
.PP
\fBGetPixelRGB\fP function gets pixel's RGB values at the position \fB(x, y)\fP on the DC.
.PP
\fBSetPixelRGB\fP function sets pixle at the position \fB(x, y)\fP with RGB value on the DC.
.PP
\fBRGB2Pixel\fP function converts RGB value to pixel value. Note that the range of a RGB value is 0~0xFF.
.PP
\fBMoveTo\fP function moves the current position to \fB(x, y)\fP.
.PP
\fBLineTo\fP function draws a line from the current position to \fB(x, y)\fP with current pen color. You can use \fBMoveTo\fP tochange the current position.
.PP
\fBCircle\fP function draws a circle with current pen color. The center of the circle is at \fB(x, y)\fP, and the radius is \fBr\fP.
.PP
\fBRectangle\fP function draws a rectangle with current pen color. The upper-left corner of the rectangle is \fB(x0, y0)\fP, and the lower-right corner of the rectangle is \fB(x1, y1)\fP.
.PP
\fBFocusRect\fP function draws a focus rectanglt with current pen color. The upper-left corner of the rectangle is \fB(x0, y0)\fP, and the lower-right corner of the rectangle is \fB(x1, y1)\fP. Focus rectangle is composed with dashed lines.
.PP
All coordinates are in logical units.
.SH "RETURN VALUE"
.PP
The \fBGet...\fP functions return the value you want.
.SH "NOTE"
.PP
Internally, MiniGUI uses pixel value to present a point in DC. You can use \fBRGB2Pixel\fP to convert RGB value to pixel value. Note that the range of a RGB value is 0~0xFF in MiniGUI.
.SH "SEE ALSO"
.BR SetMapMode (3)
.BR SetPenColor (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.