http:^^www.cs.washington.edu^education^courses^457^projects^libui^
来自「This data set contains WWW-pages collect」· EDU^EDUCATION^COURSES^457^PROJECTS^LIBUI^ 代码 · 共 1,346 行 · 第 1/4 页
EDU^EDUCATION^COURSES^457^PROJECTS^LIBUI^
1,346 行
<br><hr><br><h3><a name="Routines-Draw">Drawing Routines</a></h3><dl> <dt><samp><a name="uiGetColorTableParamsDef">void <b>uiGetColorTableParams</b> (int <var>*start</var>, int <var>*size</var>);</samp> <dd><i>Only valid when using <a href="#uiAddOptionsDef">indexed color mode</a> in the main window(s).</i><br> Sets <var>*start</var> to be the starting index of the color table and <var>*size</var> to be the size of the table. <p> <dt><samp><a name="uiSetColorTableEntryDef">void <b>uiSetColorTableEntry</b> (int <var>which</var>, float <var>red</var>, float <var>green</var>, float <var>blue</var>);</samp> <dd><i>Only valid when using <a href="#uiAddOptionsDef">indexed color mode</a> in the main window(s).</i><br> Sets one entry of the color table.<p> <dl> <dt><var>which</var> <dd>index # to set <dt><var>red, green, blue</var> <dd>floating-point values [0.0, 1.0] for red, green, and blue channels </dl> <p> <dt><samp><a name="uiSetColorTableDef">void <b>uiSetColorTable</b> (int <var>start</var>, int <var>length</var>, float <var>*data</var>);</samp> <dd><i>Only valid when using <a href="#uiAddOptionsDef">indexed color mode</a> in the main window(s).</i><br> Sets a set of entries of the color table.<p> <dl> <dt><var>start</var> <dd>starting index of the color table <dt><var>length</var> <dd>number of entries to set <dt><var>data</var> <dd>array of data containing floating-point values [0.0, 1.0] for red, green, and blue channels </dl> <p> <dt><samp><a name="uiSetColorIndexDef">void <b>uiSetColorIndex</b> (uiColorIndex <var>index</var>);</samp> <dd>Set the current drawing color to an indexed-color.<p> <dl> <dt><var>index</var> <dd>Index in color map to assign current color </dl> <p> <dt><samp><a name="uiSetColorRGBDef">void <b>uiSetColorRGB</b> (uiColorRGB <var>color</var>); </samp> <dd>Set the current drawing color to the RGB color specified.<p> <dl> <dt><var>color</var> <dd>RGB Color to assign current color </dl> <p> <dt><samp><a name="uiGetBlackPixelDef">int <strong>uiGetBlackPixel</strong> (void);</a></samp> <dd>Returns the color index that will produce black on the overlay plane.<p> <dt><samp><a name="uiGetWhitePixelDef">int <strong>uiGetWhitePixel</strong> (void);</a></samp> <dd>Returns the color index that will produce white on the overlay plane.<p> <dt><samp><a name="uiSetBackgroundDef">void <strong>uiSetBackground</strong> ( void );</a></samp> <dd>Sets the current drawing color to the window's background color.<p> <dt><samp><a name="uiDrawLineDef">void <b>uiDrawLine</b> (int <var>x1</var>, int <var>y1</var>, int <var>x2</var>, int <var>y2</var>);</samp> <dd>Draws a line between two points. This must be preceeded by a <a href="#uiSetCurrentWindowDef">uiSetCurrentWindow</a> call, and must be followed by a <a href = "#uiFlushDef">uiFlush</a> call.<p> <dl> <dt><var>x1</var>, <var>y1</var> <dd>first point <dt><var>x2</var>, <var>y2</var> <dd>second point </dl> <p> <dt><samp><a NAME="uiSetDrawModeDef">void <b>uiSetDrawMode</b> (uiDrawMode <var>mode</var>);</samp> <dd>Used to specify the drawing mode. This can only be used when drawing with indexed-color<p> <dl> <dt><var>mode</var> <dd>Mode to do drawing<br> <samp>UI_XOR</samp> : specifies drawing in XOR mode<br> <samp>UI_COPY</samp> : specifies drawing in standard draw mode </dl> <p> <dt><samp><a name="uiDrawImageDef">void <b>uiDrawImage</b> (Image * <var>im</var>, int <var>x</var>, int <var>y</var>);</samp> <dd>Draws image to given coordinates<p> <dl> <dt><var>im</var> <dd>Pointer to image in memory <dt><var>x</var>, <var>y</var> <dd>Coordinates to draw image </dl> <p> <dt><samp><a name="uiFlushDef">void <b>uiFlush</b>();</samp> <dd>Signal to draw queued objects immediately. The function <a href = "#uiDrawLineDef>uiDrawLine</a> must be followed by a call to uiFlush </dl><br><hr><br><h3><a name="Routines-Misc">Miscellaneous routines</a></h3><dl> <dt><samp><a NAME="uiSetIdleCallbackDef">void <strong>uiSetIdleCallback</strong> (<a HREF="#uiIdleCallbackDef">uiIdleCallback</a> <VAR>idleProc</VAR> );</a></samp> <dd>Defines an idle procedure to be called periodically when the program has nothing better to do. You may call <strong>uiSetIdleCallback()</strong> anywhere in your program, just as long as <a href="#uiInitWindows">uiInitWindows()</a> has already been called. To disable an idle procedure, the procedure should return <em> TRUE</em>; this will remove the procedure from the work queue (you need to call uiSetIdleCallback again to replace it). To leave an idle procedure on the work queue, the procedure should return <em>FALSE</em>. Because idle procedures, even empty ones, consume large amounts of system resources, it is best to leave them disabled until needed.<p> <dt><samp><a name="uiSetTimerCallback">void <strong>uiSetTimerCallback</strong> (<a href="#uiTimerCallbackDef">uiTimerCallback</a> <var>timerProc</var>, unsigned long <var>interval</var>);</a></samp> <dd>Like an idle callback, only is called at a defined interval (in milliseconds). Will be continually called until the callback procedure returns <em>TRUE</em> when it is removed from the event queue. To replace it, you must call uiSetTimerCallback again. <p> <dt><samp><a NAME="uiQuitDef">void <strong>uiQuit</strong>();</a></samp> <dd>Shuts down the interface library. This function never returns -- <strong>uiQuit()</strong> calls <samp>exit(1)</samp> as its last statement.<p> <dt><samp><a NAME="uiPostFileDialogDef">void <strong>uiPostFileDialog </strong>(char *<var>title</var>, char *<var>filter</var>, <a HREF="#uiFileBoxCallbackDef">uiFileBoxCallback</a> <var>okCallback </var>);</a></samp> <dd>Presents a file-selection dialog.<p> <dl> <dt><VAR>title</VAR> <dd>The title of the dialog box. <dt><VAR>filter</VAR> <dd>An optional filter that filenames must satisfy in order to be shown. (for example, "*.c" to show files ending with ".c") <dt><VAR>okCallback</VAR> <dd>The callback procedure to be invoked when the user presses the OK button in the dialog. This is where the name of the selected file is made available. If no callback is to be invoked, pass NULL for this argument. </dl> When the application calls <strong>uiPostFileDialog()</strong>, a file-selection box is presented. The <strong>uiPostFileDialog</strong> call returns control to the application immediately (while the dialog box is still up), and the application is notified when the OK button has been pressed via the <VAR><a href="#uiFileBoxCallbackDef">okCallback</a></VAR>.<p> <dt><samp><a NAME="uiBusyCursorDef">void <strong>uiBusyCursor</strong> (int <var>state</var>, int <var>interruptable</var>)</samp> <dd>Sets the cursor the watch. This is a useful user interface routine to let the user know that the current operation could take some time.<p> <dl> <dt><var>state</var> <dd>Determines whether the the cursor should be changed to the watch, or changed back. To change to the watch, use <em> ENABLE_BUSY_CURSOR</em>. To change back to the default icon, use <em>DISABLE_BUSY_CURSOR</em>. When the cursor is set to the watch, no user interaction will be allowed. Additionally, user interation will <em>not</em> be queued. <dt><var>interruptable</var> <dd>This variable is currently not used. Always set it to 0. </dl><p></dl><DL></dl><br><br><hr><!-- --><!-- Glossary --><!-- --><h2><a NAME="Reference-Glossary">Glossary</a></h2><dl> <dt><a NAME="CallbackProcedureDefinition"><em>Callback Procedure</em></a> <dd>A routine that is called by the interface library in response to some action (the user presses a button, a window becomes visible, etc) <!-- dialog box--> <dt><a NAME="IdleProcedureDefinition"><em>Idle Procedure</em></a> <dd>A routine that is called periodically by the interface library, when there is nothing else to do. <dt><a NAME="OverlayPlaneDefinition"><em>Overlay plane</em></a> <dd>A drawing plane which lies above another drawing area and whose image is drawn on top of the image beneath it. One color index (typically 0) is specified to be transparent.</dl><br><br><hr><!-- --><!-- Index --><!-- --><h2><a name="Index">Index</a></h2><ul> <li><a href="#Macros">CLAMP</a> <li><a href="#Macros">MAX</a> <li><a href="#Macros">MIN</a> <li><a HREF="#uiAddMenuItemDef">uiAddMenuItem</a> <li><a HREF="#uiAddSliderDef">uiAddSlider</a> <li><a HREF="#uiAddToggleButtonDef">uiAddToggleButton</a> <li><a HREF="#uiAddWindowDef">uiAddWindow</a> <li><a HREF="#uiAppOptionsDef">uiAppOptions</a> <li><a HREF="#uiBoolDef">uiBool</a> <li><a HREF="#uiBusyCursorDef">uiBusyCursor</a> <li><a HREF="#uiCallbackDef">uiCallback</a> <li><a href="#uiCloseImageDef">uiCloseImage</a> <li><a HREF="#uiDeleteImageDef">uiDeleteImage</a> <li><a HREF="#uiDirtyWindowDef">uiDirtyWindow</a> <li><a HREF="#uiDrawingPlaneDef">uiDrawingPlane</a> <li><a href="#uiDrawImageDef">uiDrawImage</a> <li><a href="#uiDrawLineDef">uiDrawLine</a> <li><a HREF="#uiExposeCallbackDef">uiExposeCallback</a> <li><a HREF="#uiFileBoxCallbackDef">uiFileBoxCallback</a> <li><a href="#uiFlushDef">uiFlush</a> <li><a HREF="#uiFreeTextDef">uiFreeText</a> <li><a href="#uiGetBlackPixelDef">uiGetBlackPixel</a> <li><a href="#uiGetColorTableParams">uiGetColorTableParams</a> <li><a HREF="#uiGetPixelDataDef">uiGetPixelData</a> <li><a HREF="#uiGetPixelValueDef">uiGetPixelValue</a> <li><a href="#uiGetSliderParamsDef">uiGetSliderParams</a> <li><a HREF="#uiGetScalarValueDef">uiGetScalarValue</a> <li><a HREF="#uiGetSliderValueDef">uiGetSliderValue</a> <li><a HREF="#uiGetTextDef">uiGetText</a> <li><a HREF="#uiGetToggleButtonStateDef">uiGetToggleButtonState</a> <li><a HREF="#uiGetUserDataDef">uiGetUserData</a> <li><a HREF="#uiGetVectorValueDef">uiGetVectorValue</a> <li><a href="#uiGetWhitePixelDef">uiGetWhitePixel</a> <li><a HREF="#uiGetWindowSizeDef">uiGetWindowSize</a> <li><a href="#uiIdleCallbackDef">uiIdleCallback</a> <li><a HREF="#uiImageTypeDef">uiImageType</a> <li><a HREF="#uiImageWidthDef">uiImageWidth</a> <li><a HREF="#uiInitWindowsDef">uiInitWindows</a> <li><a HREF="#uiMainLoopDef">uiMainLoop</a> <li><a HREF="#uiMakeMenuDef">uiMakeMenu</a> <li><a HREF="#uiMapCoordinatesDef">uiMapCoordinates</a> <li><a HREF="#uiMouseActionDef">uiMouseAction</a> <li><a HREF="#uiMouseCallbackDef">uiMouseCallback</a> <li><a HREF="#uiNewImageDef">uiNewImage</a> <li><a href="#uiOpenImageDef">uiOpenImage</a> <li><a HREF="#uiPostFileDialogDef">uiPostFileDialog</a> <li><a HREF="#uiQuitDef">uiQuit</a> <li><a href="#uiSaveImageDef">uiSaveImage</a> <li><a HREF="#uiScalePixelValuesDef">uiScalePixelValues</a> <li><a href="#uiSetBackgroundDef">uiSetBackground</a> <li><a href="#uiSetColorIndexDef">uiSetColorIndex</a> <li><a href="#uiSetColorRGBDef">uiSetColorRGB</a> <li><a href="#uiSetColorTableDef">uiSetColorTable</a> <li><a href="#uiSetColorTableEntryDef">uiSetColorTableEntry</a> <li><a HREF="#uiSetControlHeightDef">uiSetControlHeight</a> <li><a HREF="#uiSetControlWidthDef">uiSetControlWidth</a> <li><a HREF="#uiSetCurrentWindowDef">uiSetCurrentWindow</a> <li><a href="#uiSetDrawModeDef">uiSetDrawMode</a> <li><a href="#uiSetIdleCallbackDef">uiSetIdleCallback</a> <li><a HREF="#uiSetMainWindowHeightDef">uiSetMainWindowHeight</a> <li><a HREF="#uiSetMainWindowWidthDef">uiSetMainWindowWidth</a> <li><a HREF="#uiSetScalarValueDef">uiSetScalarValue</a> <li><a HREF="#uiSetScaleFactorDef">uiSetScaleFactor</a> <li><a href="#uiSetSliderParamsDef">uiSetSliderParams</a> <li><a HREF="#uiSetSliderValueDef">uiSetSliderValue <li><a HREF="#uiSetTextHeightDef">uiSetTextHeight</a> <li><a HREF="#uiSetTimerCallbackDef">uiSetTimerCallback</a> <li><a href="#uiSetToggleButtonStateDef">uiSetToggleButtonState</a> <li><a HREF="#uiSetUserDataDef">uiSetUserData</a> <li><a HREF="#uiSetVectorValueDef">uiSetVectorValue</a> <li><a HREF="#uiSliderDef">uiSlider</a> <li><a HREF="#uiTimerCallbackDef">uiTimerCallback</a> <li><a HREF="#uiToggleButtonDef">uiToggleButton</a> <li><a HREF="#uiWindowDef">uiWindow</a></ul> <a HREF="http://www.cs.washington.edu/education/courses/457/index.html"><STRONG>Back to the CS457 Home Page</STRONG></a><hr><address>mtwong@cs.washington.edu (last modified: 19 Mar 1996)</address></body></html>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?