| 1 | <!doctype html public "-//w3c//dtd html 4.0 transitional//en"> |
| 2 | <html> |
| 3 | <head> |
| 4 | <meta http-equiv="Content-Type" content="text/html; charset=euc-jp"> |
| 5 | <meta name="GENERATOR" content="emacs"> |
| 6 | <meta name="Author" content="kacchan"> |
| 7 | <title>KXL_LoadBitmap</title> |
| 8 | </head> |
| 9 | <body text="#000000" bgcolor="#f0f0dc" link="#3366FF" vlink="#3366FF" alink="#FF0000"> |
| 10 | |
| 11 | <a href="kxldrawpolygon.html">Prev</a> |
| 12 | <a href="KXL.html">Top</a> |
| 13 | <a href="kxlcopyimagerect.html">Next</a> |
| 14 | <hr> |
| 15 | |
| 16 | <b>Name</b><br><br> |
| 17 | <font size=+2>KXL_LoadBitmap</font><br><br> |
| 18 | |
| 19 | <b>Synopsis</b><br> |
| 20 | <pre>KXL_LoadBitmap -- An image is created from a bitmap file. |
| 21 | The bitmap file must be saved in 4bpp(16 colors) or 8bpp(256 colors) color. |
| 22 | </pre><br> |
| 23 | |
| 24 | <b>Description</b><br> |
| 25 | <pre>KXL_Image *KXL_LoadBitmap(Uint8 *filename, Uint8 maskno);</pre><br> |
| 26 | |
| 27 | <b>Arguments</b><br><br> |
| 28 | <table border="1"> |
| 29 | <tr><td>filename</td><td>Bitmap file name.</td> |
| 30 | <tr><td>maskno</td><td>The color number of a transparent color.<br> |
| 31 | </td> |
| 32 | </table> |
| 33 | <br><br> |
| 34 | |
| 35 | <b>Return Value</b><br><br> |
| 36 | Pointer of KXL_Image structure. |
| 37 | <br><br><br> |
| 38 | |
| 39 | <b>Exsample</b><br> |
| 40 | <pre> |
| 41 | <a href="./sample.bmp">sample.bmp</a> - 131 colors. |
| 42 | <img src="./sample.gif"> |
| 43 | 0 number is black. |
| 44 | |
| 45 | #include <KXL.h> |
| 46 | int main(void) |
| 47 | { |
| 48 | <b>KXL_Image *mask_img, *nomask_img;</b> |
| 49 | |
| 50 | KXL_CreateWindow(100, 100, "sample", 0); |
| 51 | <b>mask_img = KXL_LoadBitmap("sample.bmp", 0); |
| 52 | nomask_img = KXL_LoadBitmap("sample.bmp", 255);</b> |
| 53 | |
| 54 | KXL_SetDrawColor(0x00, 0x00, 0xff); |
| 55 | KXL_ClearFrameImm(0, 0, 100, 100); |
| 56 | KXL_PutImage(nomask_img, 10, 10); |
| 57 | KXL_PutImage(mask_img, 50, 50); |
| 58 | KXL_UpDateImm(0, 0, 100, 100); |
| 59 | getchar(); |
| 60 | KXL_DeleteImage(mask_img); |
| 61 | KXL_DeleteImage(nomask_img); |
| 62 | KXL_DeleteWindow(); |
| 63 | return 0; |
| 64 | } |
| 65 | </pre> |
| 66 | |
| 67 | </body> |
| 68 | </html> |