File: kxlloadbitmap.html

package info (click to toggle)
kxl 1.2.4-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 596 kB
  • sloc: sh: 2,114; ansic: 1,287; makefile: 15
file content (68 lines) | stat: -rw-r--r-- 1,737 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<head>
   <meta http-equiv="Content-Type" content="text/html; charset=euc-jp">
   <meta name="GENERATOR" content="emacs">
   <meta name="Author" content="kacchan">
   <title>KXL_LoadBitmap</title>
</head>
<body text="#000000" bgcolor="#f0f0dc" link="#3366FF" vlink="#3366FF" alink="#FF0000">

<a href="kxldrawpolygon.html">Prev</a>
<a href="KXL.html">Top</a>
<a href="kxlcopyimagerect.html">Next</a>
<hr>

<b>Name</b><br><br>
<font size=+2>KXL_LoadBitmap</font><br><br>

<b>Synopsis</b><br>
<pre>KXL_LoadBitmap -- An image is created from a bitmap file.
The bitmap file must be saved in 4bpp(16 colors) or 8bpp(256 colors) color.
</pre><br>

<b>Description</b><br>
<pre>KXL_Image *KXL_LoadBitmap(Uint8 *filename, Uint8 maskno);</pre><br>

<b>Arguments</b><br><br>
<table border="1">
<tr><td>filename</td><td>Bitmap file name.</td>
<tr><td>maskno</td><td>The color number of a transparent color.<br>
</td>
</table>
<br><br>

<b>Return Value</b><br><br>
Pointer of KXL_Image structure.
<br><br><br>

<b>Exsample</b><br>
<pre>
<a href="./sample.bmp">sample.bmp</a> - 131 colors.
<img src="./sample.gif">
0 number is black.

#include &lt;KXL.h&gt;
int main(void)
{
  <b>KXL_Image *mask_img, *nomask_img;</b>
  
  KXL_CreateWindow(100, 100, "sample", 0);
  <b>mask_img = KXL_LoadBitmap("sample.bmp", 0);
  nomask_img = KXL_LoadBitmap("sample.bmp", 255);</b>
  
  KXL_SetDrawColor(0x00, 0x00, 0xff);
  KXL_ClearFrameImm(0, 0, 100, 100);
  KXL_PutImage(nomask_img, 10, 10);
  KXL_PutImage(mask_img, 50, 50);
  KXL_UpDateImm(0, 0, 100, 100);
  getchar();
  KXL_DeleteImage(mask_img);
  KXL_DeleteImage(nomask_img);
  KXL_DeleteWindow();
  return 0;
}
</pre>

</body>
</html>