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: &quot;wwxxxxxxxx...&quot; 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, &quot;0affc804804ffc&quot; 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 &quot;0affc804804ffc&quot;
8 4 2 1&nbsp; 8 4 2 1&nbsp; 8 4 2 1
X X X X&nbsp; X X X X&nbsp; X X 0 0 = ffc
X 0 0 0&nbsp; 0 0 0 0&nbsp; 0 X 0 0 = 804
X 0 0 0&nbsp; 0 0 0 0&nbsp; 0 X 0 0 = 804
X X X X&nbsp; X X X X&nbsp; 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 &lt; 3.5.</li>
      <li><i>setfg(int r, int g, int b)</i> -&nbsp;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 &lt; 3.5.&nbsp;</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 &lt; 3.5.</li>
      <li><i>setbg(int r, int g, int b)</i> -&nbsp;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 &lt; 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 &lt; 3.5.</li>
      <li><i>settextcolor(int r, int g, int b)</i> -&nbsp;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 &lt; 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 &lt; 3.5.</li>
      <li><i>getuicolor(int item)</i> - return the system color for a given UI
        item. Returns 0 on OS &lt; 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 &lt; 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">&nbsp;</td>
              <td width="24" bgColor="#ffccff">&nbsp;</td>
              <td width="24" bgColor="#ff99ff">&nbsp;</td>
              <td width="24" bgColor="#ff66ff">&nbsp;</td>
              <td width="24" bgColor="#ff33ff">&nbsp;</td>
              <td width="24" bgColor="#ff00ff">&nbsp;</td>
              <td width="24" bgColor="#ffffcc">&nbsp;</td>
              <td width="24" bgColor="#ffcccc">&nbsp;</td>
              <td width="24" bgColor="#ff99cc">&nbsp;</td>
              <td width="24" bgColor="#ff66cc">&nbsp;</td>
              <td width="24" bgColor="#ff33cc">&nbsp;</td>
              <td width="24" bgColor="#ff00cc">&nbsp;</td>
              <td width="24" bgColor="#ffff99">&nbsp;</td>
              <td width="24" bgColor="#ffcc99">&nbsp;</td>
              <td width="24" bgColor="#ff9999">&nbsp;</td>
              <td width="24" bgColor="#ff6699">&nbsp;</td>
            </tr>
            <tr>
              <th>16</th>
              <td width="24" bgColor="#ff3399">&nbsp;</td>
              <td width="24" bgColor="#ff0099">&nbsp;</td>
              <td width="24" bgColor="#ccffff">&nbsp;</td>
              <td width="24" bgColor="#ccccff">&nbsp;</td>
              <td width="24" bgColor="#cc99ff">&nbsp;</td>
              <td width="24" bgColor="#cc66ff">&nbsp;</td>
              <td width="24" bgColor="#cc33ff">&nbsp;</td>
              <td width="24" bgColor="#cc00ff">&nbsp;</td>
              <td width="24" bgColor="#ccffcc">&nbsp;</td>
              <td width="24" bgColor="#cccccc">&nbsp;</td>
              <td width="24" bgColor="#cc99cc">&nbsp;</td>
              <td width="24" bgColor="#cc66cc">&nbsp;</td>
              <td width="24" bgColor="#cc33cc">&nbsp;</td>
              <td width="24" bgColor="#cc00cc">&nbsp;</td>
              <td width="24" bgColor="#ccff99">&nbsp;</td>
              <td width="24" bgColor="#cccc99">&nbsp;</td>
            </tr>
            <tr>
              <th>32</th>
              <td width="24" bgColor="#cc9999">&nbsp;</td>
              <td width="24" bgColor="#cc6699">&nbsp;</td>
              <td width="24" bgColor="#cc3399">&nbsp;</td>
              <td width="24" bgColor="#cc0099">&nbsp;</td>
              <td width="24" bgColor="#99ffff">&nbsp;</td>
              <td width="24" bgColor="#99ccff">&nbsp;</td>
              <td width="24" bgColor="#9999ff">&nbsp;</td>
              <td width="24" bgColor="#9966ff">&nbsp;</td>
              <td width="24" bgColor="#9933ff">&nbsp;</td>
              <td width="24" bgColor="#9900ff">&nbsp;</td>
              <td width="24" bgColor="#99ffcc">&nbsp;</td>
              <td width="24" bgColor="#99cccc">&nbsp;</td>
              <td width="24" bgColor="#9999cc">&nbsp;</td>
              <td width="24" bgColor="#9966cc">&nbsp;</td>
              <td width="24" bgColor="#9933cc">&nbsp;</td>
              <td width="24" bgColor="#9900cc">&nbsp;</td>
            </tr>
            <tr>
              <th>48</th>
              <td width="24" bgColor="#99ff99">&nbsp;</td>
              <td width="24" bgColor="#99cc99">&nbsp;</td>
              <td width="24" bgColor="#999999">&nbsp;</td>
              <td width="24" bgColor="#996699">&nbsp;</td>
              <td width="24" bgColor="#993399">&nbsp;</td>
              <td width="24" bgColor="#990099">&nbsp;</td>
              <td width="24" bgColor="#66ffff">&nbsp;</td>
              <td width="24" bgColor="#66ccff">&nbsp;</td>
              <td width="24" bgColor="#6699ff">&nbsp;</td>
              <td width="24" bgColor="#6666ff">&nbsp;</td>
              <td width="24" bgColor="#6633ff">&nbsp;</td>
              <td width="24" bgColor="#6600ff">&nbsp;</td>
              <td width="24" bgColor="#66ffcc">&nbsp;</td>
              <td width="24" bgColor="#66cccc">&nbsp;</td>
              <td width="24" bgColor="#6699cc">&nbsp;</td>
              <td width="24" bgColor="#6666cc">&nbsp;</td>
            </tr>
            <tr>
              <th>64</th>
              <td width="24" bgColor="#6633cc">&nbsp;</td>
              <td width="24" bgColor="#6600cc">&nbsp;</td>
              <td width="24" bgColor="#66ff99">&nbsp;</td>
              <td width="24" bgColor="#66cc99">&nbsp;</td>
              <td width="24" bgColor="#669999">&nbsp;</td>
              <td width="24" bgColor="#666699">&nbsp;</td>
              <td width="24" bgColor="#663399">&nbsp;</td>
              <td width="24" bgColor="#660099">&nbsp;</td>
              <td width="24" bgColor="#33ffff">&nbsp;</td>
              <td width="24" bgColor="#33ccff">&nbsp;</td>
              <td width="24" bgColor="#3399ff">&nbsp;</td>
              <td width="24" bgColor="#3366ff">&nbsp;</td>
              <td width="24" bgColor="#3333ff">&nbsp;</td>
              <td width="24" bgColor="#3300ff">&nbsp;</td>
              <td width="24" bgColor="#33ffcc">&nbsp;</td>
              <td width="24" bgColor="#33cccc">&nbsp;</td>
            </tr>
            <tr>
              <th>80</th>
              <td width="24" bgColor="#3399cc">&nbsp;</td>
              <td width="24" bgColor="#3366cc">&nbsp;</td>
              <td width="24" bgColor="#3333cc">&nbsp;</td>
              <td width="24" bgColor="#3300cc">&nbsp;</td>
              <td width="24" bgColor="#33ff99">&nbsp;</td>
              <td width="24" bgColor="#33cc99">&nbsp;</td>
              <td width="24" bgColor="#339999">&nbsp;</td>
              <td width="24" bgColor="#336699">&nbsp;</td>
              <td width="24" bgColor="#333399">&nbsp;</td>
              <td width="24" bgColor="#330099">&nbsp;</td>
              <td width="24" bgColor="#00ffff">&nbsp;</td>
              <td width="24" bgColor="#00ccff">&nbsp;</td>
              <td width="24" bgColor="#0099ff">&nbsp;</td>
              <td width="24" bgColor="#0066ff">&nbsp;</td>
              <td width="24" bgColor="#0033ff">&nbsp;</td>
              <td width="24" bgColor="#0000ff">&nbsp;</td>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?