mirror of
https://github.com/VincentWei/MiniGUI.git
synced 2026-09-28 16:17:09 +08:00
101 lines
6.8 KiB
Plaintext
101 lines
6.8 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 "Bitmap" "3" "August 2000" "MiniGUI"
|
|
|
|
.SH "NAME"
|
|
Bitmap \- bitmap operations in MiniGUI.
|
|
|
|
.SH "SYNOPSIS"
|
|
.B #include <minigui/gdi.h>
|
|
.PP
|
|
.BI "int GUIAPI LoadBitmap" "(HDC hdc, PBITMAP pBitmap, const char* spFileName);"
|
|
.br
|
|
.BI "int GUIAPI CreateBitmapFromGIFFile" "(HDC hdc, PBITMAP pBitmap, const char* spFileName);"
|
|
.br
|
|
.BI "int GUIAPI CreateBitmapFromGIFMemory" "(HDC hdc, PBITMAP pBitmap, void* GIFBuff, int nSize);"
|
|
.br
|
|
.BI "int GUIAPI CreateBitmapFromJPGFile" "(HDC hdc, PBITMAP pBitmap, const char* spFileName);"
|
|
.br
|
|
.BI "int GUIAPI CreateBitmapFromJPGMemory" "(HDC hdc, PBITMAP pBitmap, void* JPGBuff, int nSize);"
|
|
.br
|
|
.BI "void GUIAPI UnloadBitmap" "(PBITMAP pBitmap);"
|
|
.PP
|
|
.BI "void GUIAPI ReplaceBitmapColor" "(HDC hdc, PBITMAP pBitmap, int iOColor, int iNColor);"
|
|
.PP
|
|
.BI "void GUIAPI FillBox" "(HDC hdc, int x, int y, int w, int h);"
|
|
.br
|
|
.BI "void GUIAPI FillBoxWithBitmap" "(HDC hdc, int x, int y, int w, int h, PBITMAP pBitmap);"
|
|
.br
|
|
.BI "void GUIAPI FillBoxWithBitmapPart" "(HDC hdc, int x, int y, int w, int h, int bw, int bh, PBITMAP pBitmap, int xo, int yo);"
|
|
.br
|
|
.BI "void GUIAPI BitBlt" "(HDC hsdc, int sx, int sy, int sw, int sh, HDC hddc, int dx, int dy, DWORD dwRop);"
|
|
.br
|
|
.BI "void GUIAPI StretchBlt" "(HDC hsdc, int sx, int sy, int sw, int sh, HDC hddc, int dx, int dy, int dw, int dh, DWORD dwRop);"
|
|
.br
|
|
.SH "DESCRIPTION"
|
|
.PP
|
|
\fBLoadBitmap\fP function loads a bitmap from a bitmap file named \fBspFileName\fP into a BITMAP struct pointed to by \fBpBitmap\fP. This function will create a compiled bitmap compatible with the DC \fBhdc\fP. You can load BMP, PCX, TGA, GIF, JPG, PNG bitmap files by using this function. Note that you should specify correct extenstion name of the file.
|
|
.PP
|
|
\fBCreateBitmapFromGIFFile\fP function create a bitmap from a GIF image file named \fBspFileName\fP. This function will create a compiled bitmap compatible with the DC \fBhdc\fP. This function is the old interface to load GIF file, and reserved only for compatibility. New application should use \fBLoadBitmap\fP to load GIF file.
|
|
.PP
|
|
\fBCreateBitmapFromGIFMemory\fP function create a bitmap from a buffer filled with data from a GIF image file. \fBnSize\fP specifies the size of the buffer pointed to by \fBGIFBuf\fP. This function will create a compiled bitmap compatible with the DC \fBhdc\fP. This function is the old interface to load JPG file, and reserved only for compatibility. New application should use \fBLoadBitmap\fP to load JPG file.
|
|
.PP
|
|
\fBCreateBitmapFromJPGFile\fP function is similar with \fBCreateBitmapFromGIFFile\fP, but this function used to create bitmap from a JPG image file. This function is a obsoleted one, new application should use \fBLoadBitmap\fP instead.
|
|
.PP
|
|
\fBCreateBitmapFromJPGMemory\fP function is similar with \fBCreateBitmapFromGIFMemory\fP, but the buffer is filled with data from a JPG image file. This function is a obsoleted one, new application should use \fBLoadBitmap\fP instead.
|
|
.PP
|
|
\fBUnloadBitmap\fP function frees the memory used by the bitmap object pointed to by \fBpBitmap\fP.
|
|
.PP
|
|
\fBReplaceBitmapColor\fP function replaces a color \fB(nOColor)\fP with a new color \fB(nNColor)\fP in the bitmap object pointed to by \fBpBitmap\fP.
|
|
.PP
|
|
\fBFillBox\fP function fills a box with the current brush in the DC \fBhdc\fP. Note that MiniGUI only defined the color property for the brush objects.
|
|
.PP
|
|
\fBFillBoxWithBitmap\fP function fills a box with a bitmap object pointed to by \fBpBitmap\fP. \fB(x, y)\fP is the upper-left corner of the box, and \fBw, h\fP are the width and the height of the box respectively. This function will scale the bitmap when necessary; that is, the width or the height of the box are not equal to the with or the height of the bitmap object.
|
|
.PP
|
|
\fBFillBoxWithBitmapPart\fP function fills a box with a part of a bitmap oject pointed to by \fBpBitmap\fP. \fB(x, y)\fP is the upper-left corner of the box, and \fBw, h\fP are the width and the height of the box respectively. \fB(xo, yo)\fP is the start position of the part box in the bitmap relative to upper-left corner of the bitmap, and \fBbw, bh\fP are the width and the height of the full bitmap you want. If \fBbw\fP or \fBbh\fP is less than or equal to zero, this function will use the original width and height of the bitmap, else it will scale the bitmap first when necessary.
|
|
.PP
|
|
\fBBitBlt\fP function performs a bit-block transfer of the color data cooresponding to a rectangle of pixels from the specfied source dispaly context \fBhsdc\fP into a destination display context \fBhddc\fP. \fB(sx, sy, sw, sh)\fP specifies the rectangle in the source DC, and \fB(dx, dy)\fP specifies the position of the rectangle in the destination DC. Note that the size of the two rectangles are identical.
|
|
.PP
|
|
\fBStretchBlt\fP function copies a bitmap from a source rectangle into a destination rectangle, streching or compressing the bitmap to fit the dimension of the destination rectangle, if necessary. This function is similar with \fBBitBlt\fP function except the former scaling the bitmap. \fB(dw, dh)\fP specifies the size of the destination rectangle.
|
|
|
|
.SH "RETURN VALUE"
|
|
.PP
|
|
For the functions creating bitmap objects, they will return non-zero values to indicate errors.
|
|
|
|
.SH "NOTE"
|
|
.PP
|
|
\fBLoadBitmap\fP function only supports bitmap files with less than 256 colors, and without RLE encoding. The GIF and JPG functions only support some formats, and the GIF functions can not support the GIF animation.
|
|
|
|
.SH "SEE ALSO"
|
|
.BR SetBrushColor (3)
|
|
|
|
.SH "TODO"
|
|
.PP
|
|
A \fBMaskBlt\fP function which combines the color data for the source and destination bitmaps using the specified mask is needed.
|
|
|
|
.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.
|
|
|