functions.html
来自「palm的pocketc」· HTML 代码 · 共 1,088 行 · 第 1/5 页
HTML
1,088 行
not filled. background[0], foreground[1], dotted[2], XOR[3].</li>
<li><i>frame2(int col, int x1, int y1, int x2, int y2, int radius, int width)</i> - same as
frame() but allows specification of width (1-3 <em>only</em>).</li>
<li><i>bitmap(int x, int y, string bits)</i> - draw a bitmap at (x,y). The bits string is a
list of hexadecimal digits in the following form: "wwxxxxxxxx..." where 'ww' is
the width of the bitmap (i.e. '0a' is a 10-pixel wide bitmap), and 'xxx...' are the bits
of the bitmap, each character representing 4 pixels. So, "0affc804804ffc" is a
10x4 bitmap of a rectangle ('ffc' is a solid line, '804' represents a left and right
edge.) <b>Note:</b> there are several <a href="http://www.orbworks.com/palmres.html"> PocketC utilities</a> available that will
generate these strings for you.<pre>Example:
A 10x4 rectangle "0affc804804ffc"
8 4 2 1 8 4 2 1 8 4 2 1
X X X X X X X X X X 0 0 = ffc
X 0 0 0 0 0 0 0 0 X 0 0 = 804
X 0 0 0 0 0 0 0 0 X 0 0 = 804
X X X X X X X X X X 0 0 = ffc</pre>
</li>
</ul>
</li>
<li><b>Color</b>
- only available on OS 3.5+
<ul>
<li><i>getcolordepth()</i> - get the current color depth in bits per
pixel.</li>
<li><i>setcolordepth()</i> - set the current color depth. Returns 1 if
successful, 0 otherwise. This function will only succeed on OS 3.5+.</li>
<li><i>setfgi(int index)</i> - set the current foreground color to the
given index (see color table below). Returns the previous index. This
function does nothing on OS < 3.5.</li>
<li><i>setfg(int r, int g, int b)</i> - set the current foreground
color to (r,g,b). The nearest color available at the current color
depth is used. This function does nothing on OS < 3.5. </li>
<li><i>setbgi(int index)</i> - set the current background color to the
given index (see color table below). Returns the previous index. This
function does nothing on OS < 3.5.</li>
<li><i>setbg(int r, int g, int b)</i> - set the current background
color to (r,g,b). The nearest color available at the current color
depth is used. This function does nothing on OS < 3.5.</li>
<li><i>settextcolori(int index)</i> - set the current text color to the
given index (see color table below). Returns the previous index. This
function does nothing on OS < 3.5.</li>
<li><i>settextcolor(int r, int g, int b)</i> - set the current text
color to (r,g,b). The nearest color available at the current color
depth is used. This function does nothing on OS < 3.5.</li>
<li><i>rgbtoi(int r, int g, int b)</i> - return the index of the color nearest (r,g,b)
at the current color depth. Returns 0 on OS < 3.5.</li>
<li><i>getuicolor(int item)</i> - return the system color for a given UI
item. Returns 0 on OS < 3.5. Available items are ObjectFrame[0], ObjectFill[1], ObjectFG[2],
ObjectSelFill[3], ObjectSelFG[4], MenuFrame[5], MenuFill[6], MenuFG[7],
MenuSelFill[8], MenuSelFG[9], FieldBG[10], FieldText[11],
FieldTextLines[12], FieldCaret[13], FieldTextHighlightBG[14],
FieldTextHighlightFG[15], FieldFepRawText[16], FieldFepRawBG[17],
FieldFepConvText[18], FieldFepConvBG[19],
FieldFepUnderline[20], FormFrame[21], FormFill[22], DialogFrame[23],
DialogFill[24], AlertFrame[25], AlertFill[26],
OK[27], Caution[28], Warning[29]</li>
<li><i>choosecolori(string title, pointer pIndex)</i> - displays a color
selection dialog where <i>pIndex</i> is a pointer to an int that
contains the initially selected color index and is set to the selected
color index. Returns 0 if the user selects cancel, 1 otherwise. Returns
0 on OS < 3.5.</li>
</ul>
<li><b>Offscreen Buffers</b></li>
<ul>
<li><i>bucreate(int width, int height)</i> - create an offscreen buffer of
the specified width and height (in standard coordinates). Returns the buffer id on
success, 0 on failure.</li>
<li><i>budelete(int id)</i> - delete the given buffer.</li>
<li><i>buset(int id)</i> - set the current drawing buffer where <i>id</i>
is a previously created buffer or 0 to specify the screen. All the text,
primitive, and bitmap operations will be drawn into the selected buffer.</li>
<li><i>bucopy(int sid, int did, int x, int y, int mode)</i> - copy all of
buffer <i>sid</i> to buffer <i>did</i> (or 0 for screen) at (x,y), using
the specified drawing mode. Available drawing modes are paint[0],
erase[1], mask[2], invert[3], overlay[4], paintInverse[5], swap[6].</li>
<li><i>bucopyrect(int sid, int xs, int ys, int w, int h, int did, int xd,
int yd, int mode)</i> - copy the rectangle at (xs,ys) with the given
width and height from buffer <i>sid</i> to buffer <i>did</i> (or 0 for
screen) at (xd,yd), using the specified drawing mode. Available drawing
modes are paint[0], erase[1], mask[2], invert[3], overlay[4],
paintInverse[5], swap[6].</li>
</ul>
<li><b>Resource Bitmaps</b>
<ul>
<li><i>resopen(string dbname)</i> - open the given resource database.
Returns the database id on success or 0 on failure.</li>
<li><i>resclose(int id)</i> - close the given resource database.</li>
<li><i>bitmapr(int bmpid, int x, int y)</i> - draw the bitmap with resource id <i>bmpid</i>
at (x,y). The current app .prc database (if compiled as a .prc file with
PocketC Dekstop Edition) is searched, along with any resource databases
currently opened with resopen().</li>
<li><i>bitmaprm(int bmpid, int x, int y, int mode)</i> - draw the bitmap with resource id <i>bmpid</i>
at (x,y), using the specified <i>mode</i>. The current app .prc database (if compiled as a .prc file with
PocketC Dekstop Edition) is searched, along with any resource databases
currently opened with resopen(). Available drawing modes are paint[0],
erase[1], mask[2], invert[3], overlay[4], paintInverse[5], swap[6].</li>
</ul>
</li>
</ul>
<h3>Color Tables</h3>
<ul>
<li><b>8-bit Color Table:</b>
<table>
<tbody>
<tr>
<th>0</th>
<td width="24" bgColor="#ffffff"> </td>
<td width="24" bgColor="#ffccff"> </td>
<td width="24" bgColor="#ff99ff"> </td>
<td width="24" bgColor="#ff66ff"> </td>
<td width="24" bgColor="#ff33ff"> </td>
<td width="24" bgColor="#ff00ff"> </td>
<td width="24" bgColor="#ffffcc"> </td>
<td width="24" bgColor="#ffcccc"> </td>
<td width="24" bgColor="#ff99cc"> </td>
<td width="24" bgColor="#ff66cc"> </td>
<td width="24" bgColor="#ff33cc"> </td>
<td width="24" bgColor="#ff00cc"> </td>
<td width="24" bgColor="#ffff99"> </td>
<td width="24" bgColor="#ffcc99"> </td>
<td width="24" bgColor="#ff9999"> </td>
<td width="24" bgColor="#ff6699"> </td>
</tr>
<tr>
<th>16</th>
<td width="24" bgColor="#ff3399"> </td>
<td width="24" bgColor="#ff0099"> </td>
<td width="24" bgColor="#ccffff"> </td>
<td width="24" bgColor="#ccccff"> </td>
<td width="24" bgColor="#cc99ff"> </td>
<td width="24" bgColor="#cc66ff"> </td>
<td width="24" bgColor="#cc33ff"> </td>
<td width="24" bgColor="#cc00ff"> </td>
<td width="24" bgColor="#ccffcc"> </td>
<td width="24" bgColor="#cccccc"> </td>
<td width="24" bgColor="#cc99cc"> </td>
<td width="24" bgColor="#cc66cc"> </td>
<td width="24" bgColor="#cc33cc"> </td>
<td width="24" bgColor="#cc00cc"> </td>
<td width="24" bgColor="#ccff99"> </td>
<td width="24" bgColor="#cccc99"> </td>
</tr>
<tr>
<th>32</th>
<td width="24" bgColor="#cc9999"> </td>
<td width="24" bgColor="#cc6699"> </td>
<td width="24" bgColor="#cc3399"> </td>
<td width="24" bgColor="#cc0099"> </td>
<td width="24" bgColor="#99ffff"> </td>
<td width="24" bgColor="#99ccff"> </td>
<td width="24" bgColor="#9999ff"> </td>
<td width="24" bgColor="#9966ff"> </td>
<td width="24" bgColor="#9933ff"> </td>
<td width="24" bgColor="#9900ff"> </td>
<td width="24" bgColor="#99ffcc"> </td>
<td width="24" bgColor="#99cccc"> </td>
<td width="24" bgColor="#9999cc"> </td>
<td width="24" bgColor="#9966cc"> </td>
<td width="24" bgColor="#9933cc"> </td>
<td width="24" bgColor="#9900cc"> </td>
</tr>
<tr>
<th>48</th>
<td width="24" bgColor="#99ff99"> </td>
<td width="24" bgColor="#99cc99"> </td>
<td width="24" bgColor="#999999"> </td>
<td width="24" bgColor="#996699"> </td>
<td width="24" bgColor="#993399"> </td>
<td width="24" bgColor="#990099"> </td>
<td width="24" bgColor="#66ffff"> </td>
<td width="24" bgColor="#66ccff"> </td>
<td width="24" bgColor="#6699ff"> </td>
<td width="24" bgColor="#6666ff"> </td>
<td width="24" bgColor="#6633ff"> </td>
<td width="24" bgColor="#6600ff"> </td>
<td width="24" bgColor="#66ffcc"> </td>
<td width="24" bgColor="#66cccc"> </td>
<td width="24" bgColor="#6699cc"> </td>
<td width="24" bgColor="#6666cc"> </td>
</tr>
<tr>
<th>64</th>
<td width="24" bgColor="#6633cc"> </td>
<td width="24" bgColor="#6600cc"> </td>
<td width="24" bgColor="#66ff99"> </td>
<td width="24" bgColor="#66cc99"> </td>
<td width="24" bgColor="#669999"> </td>
<td width="24" bgColor="#666699"> </td>
<td width="24" bgColor="#663399"> </td>
<td width="24" bgColor="#660099"> </td>
<td width="24" bgColor="#33ffff"> </td>
<td width="24" bgColor="#33ccff"> </td>
<td width="24" bgColor="#3399ff"> </td>
<td width="24" bgColor="#3366ff"> </td>
<td width="24" bgColor="#3333ff"> </td>
<td width="24" bgColor="#3300ff"> </td>
<td width="24" bgColor="#33ffcc"> </td>
<td width="24" bgColor="#33cccc"> </td>
</tr>
<tr>
<th>80</th>
<td width="24" bgColor="#3399cc"> </td>
<td width="24" bgColor="#3366cc"> </td>
<td width="24" bgColor="#3333cc"> </td>
<td width="24" bgColor="#3300cc"> </td>
<td width="24" bgColor="#33ff99"> </td>
<td width="24" bgColor="#33cc99"> </td>
<td width="24" bgColor="#339999"> </td>
<td width="24" bgColor="#336699"> </td>
<td width="24" bgColor="#333399"> </td>
<td width="24" bgColor="#330099"> </td>
<td width="24" bgColor="#00ffff"> </td>
<td width="24" bgColor="#00ccff"> </td>
<td width="24" bgColor="#0099ff"> </td>
<td width="24" bgColor="#0066ff"> </td>
<td width="24" bgColor="#0033ff"> </td>
<td width="24" bgColor="#0000ff"> </td>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?