<!DOCTYPE html
  PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<!--
Copyright (c) 2006 UGS Corp.

All Rights Reserved.

This software and related documentation are proprietary to UGS Corp.
-->
<html>
   <head>
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
      <title>Customizing Toolbar Bitmaps</title>
      <script language="javaScript">
        abridged="false";
        displayConditions=new Array();
      </script>
      <link type="text/css" href="../css/main_styles.css" rel="stylesheet">
   </head>
   <body class="bodydocs" onload="top.pageLoader()" bgcolor="#FFFFFF">
      <div class="title_topic2" id="xps10_pagetitle">Customizing Toolbar Bitmaps</div>
      <hr noshade="true">
      <div class="title_division">Introduction</div>
      <p class="para_division">Toolbars and menus can display bitmaps containing 16 million colors.</p>
      <div class="title_division">Formats</div>
      <p class="para_division">Save bitmaps as 24&ndash;bit.</p>
      <p class="para_division">On Windows, NX also handles bitmaps saved in (8&ndash;bit) 256 color, (4&ndash;bit) 16 color, and monochrome formats.</p>
      <p class="para_division">The bitmaps must not use any internal compression (its internal format must be BI_RGB).</p>
      <table border="0">
         <tr>
            <td valign="top" align="left"><img align="left" src="../graphics/note.gif" alt="Note" title="Note"></td>
            <td valign="bottom" align="left" width="100%">
               <div class="para_note">
                  <p class="para_note_body">If you provide one bitmap, NX automatically resizes the image to fit the toolbar. However, this may degrade the quality of the image.</p>
               </div>
            </td>
         </tr>
      </table>
      <div class="title_division">Naming Bitmaps</div>
      <p class="para_division">How you name bitmaps depends on how many sizes you are providing. If you provide only one bitmap, NX automatically resizes the image to fit the toolbar. However, this may degrade the quality of the image. It is better to provide a bitmap for each size.</p>
      <p class="para_division">When NX needs to locate a bitmap file for an image called &ldquo;&lt;my_graphic&gt;&rdquo;, it first attempts to load a bitmap called &ldquo;&lt;my_graphic&gt;.bmp&rdquo; and scales the image to the required size.</p>
      <p class="para_division">Use the following naming guidelines for single or multiple sizes of bitmaps:</p>
      <ul>
         <li>
            <p class="para_item">If you are providing only one bitmap, simply name it &lt;my_graphic&gt;.bmp.</p>
         </li>
         <li>
            <p class="para_item">If you are providing multiple bitmaps for each toolbar size, name the bitmaps according to the scheme in the table below.</p>
         </li>
      </ul>
      <table cellspacing="4" align="center">
         <tr valign="top">
            <td bgcolor="#f4f4f4" colspan="1" rowspan="1">
               <p class="para_td">Bitmap Size</p>
            </td>
            <td bgcolor="#f4f4f4" colspan="1" rowspan="1">
               <p class="para_td"> Sample Filename</p>
            </td>
         </tr>
         <tr>
            <td bgcolor="#F4F4F4" colspan="1" rowspan="1" valign="top">
               <p class="para_td">48x48</p>
            </td>
            <td bgcolor="#F4F4F4" colspan="1" rowspan="1" valign="top">
               <p class="para_td">&lt;my_graphic&gt;.21.bmp</p>
            </td>
         </tr>
         <tr>
            <td bgcolor="#F4F4F4" colspan="1" rowspan="1" valign="top">
               <p class="para_td">32x32</p>
            </td>
            <td bgcolor="#F4F4F4" colspan="1" rowspan="1" valign="top">
               <p class="para_td">&lt;my_graphic&gt;.2s.bmp</p>
            </td>
         </tr>
         <tr>
            <td bgcolor="#F4F4F4" colspan="1" rowspan="1" valign="top">
               <p class="para_td">24x24</p>
            </td>
            <td bgcolor="#F4F4F4" colspan="1" rowspan="1" valign="top">
               <p class="para_td">&lt;my_graphic&gt;.lc.bmp</p>
            </td>
         </tr>
         <tr>
            <td bgcolor="#F4F4F4" colspan="1" rowspan="1" valign="top">
               <p class="para_td">16x16</p>
            </td>
            <td bgcolor="#F4F4F4" colspan="1" rowspan="1" valign="top">
               <p class="para_td">&lt;my_graphic&gt;.sc.bmp</p>
            </td>
         </tr>
      </table><br><div class="title_division">Transparency</div>
      <p class="para_division">For a background transparency color on 24&ndash;bit bitmaps use magenta (255, 0,255). NX treats magenta as transparent for all high-quality bitmap files, whether stored as 24&ndash;bit (16 million color), 8&ndash;bit (256&ndash;color), or 4&ndash;bit (16 color). </p>
      <div class="title_division">Partial Transparency</div>
      <p class="para_division">If you have an image which contains partial transparency (perhaps defined as a PNG format image),you must convert it into two bitmap images (24&ndash;bit BMP format): </p>
      <ol type="1" start="1">
         <li>
            <p class="para_item">Create one of the two images with a white background color.</p>
         </li>
         <li>
            <p class="para_item">Create the other with a black background color. </p>
         </li>
         <li>
            <p class="para_item">Name the images using the naming conventions described above for the sized bitmaps but with the &ldquo;.bmp&rdquo; extension replaced by &ldquo;.white.bmp&rdquo; or &ldquo;.black.bmp&rdquo; as appropriate.</p>
         </li>
         <li>
            <p class="para_item">Size the bitmap image to correspond to the size indicated by the bitmap name. </p>
         </li>
      </ol>
      <p class="para_division">For example, for the &lt;my_graphic&gt;.png image, generate the following 8 bitmap files:</p>
      <table cellspacing="4" align="center">
         <tr valign="top">
            <td bgcolor="#f4f4f4" colspan="1" rowspan="1">
               <p class="para_td">Bitmap Size</p>
            </td>
            <td bgcolor="#f4f4f4" colspan="1" rowspan="1">
               <p class="para_td"> Sample Filename</p>
            </td>
         </tr>
         <tr>
            <td bgcolor="#F4F4F4" colspan="1" rowspan="1" valign="top">
               <p class="para_td">48x48, background set to white</p>
            </td>
            <td bgcolor="#F4F4F4" colspan="1" rowspan="1" valign="top">
               <p class="para_td">&lt;my_graphic&gt;.21.white.bmp</p>
            </td>
         </tr>
         <tr>
            <td bgcolor="#F4F4F4" colspan="1" rowspan="1" valign="top">
               <p class="para_td">48x48, background set to black</p>
            </td>
            <td bgcolor="#F4F4F4" colspan="1" rowspan="1" valign="top">
               <p class="para_td">&lt;my_graphic&gt;.21.black.bmp</p>
            </td>
         </tr>
         <tr>
            <td bgcolor="#F4F4F4" colspan="1" rowspan="1" valign="top">
               <p class="para_td">32x32, background set to white</p>
            </td>
            <td bgcolor="#F4F4F4" colspan="1" rowspan="1" valign="top">
               <p class="para_td">&lt;my_graphic&gt;.2s.white.bmp</p>
            </td>
         </tr>
         <tr>
            <td bgcolor="#F4F4F4" colspan="1" rowspan="1" valign="top">
               <p class="para_td">32x32, background set to black</p>
            </td>
            <td bgcolor="#F4F4F4" colspan="1" rowspan="1" valign="top">
               <p class="para_td">&lt;my_graphic&gt;.2s.black.bmp</p>
            </td>
         </tr>
         <tr>
            <td bgcolor="#F4F4F4" colspan="1" rowspan="1" valign="top">
               <p class="para_td">24x24, background set to white</p>
            </td>
            <td bgcolor="#F4F4F4" colspan="1" rowspan="1" valign="top">
               <p class="para_td">&lt;my_graphic&gt;.lc.white.bmp</p>
            </td>
         </tr>
         <tr>
            <td bgcolor="#F4F4F4" colspan="1" rowspan="1" valign="top">
               <p class="para_td">24x24, background set to black</p>
            </td>
            <td bgcolor="#F4F4F4" colspan="1" rowspan="1" valign="top">
               <p class="para_td">&lt;my_graphic&gt;.lc.black.bmp</p>
            </td>
         </tr>
         <tr>
            <td bgcolor="#F4F4F4" colspan="1" rowspan="1" valign="top">
               <p class="para_td">16x16, background set to white</p>
            </td>
            <td bgcolor="#F4F4F4" colspan="1" rowspan="1" valign="top">
               <p class="para_td">&lt;my_graphic&gt;.sc.white.bmp</p>
            </td>
         </tr>
         <tr>
            <td bgcolor="#F4F4F4" colspan="1" rowspan="1" valign="top">
               <p class="para_td">16x16, background set to black</p>
            </td>
            <td bgcolor="#F4F4F4" colspan="1" rowspan="1" valign="top">
               <p class="para_td">&lt;my_graphic&gt;.sc.black.bmp</p>
            </td>
         </tr>
      </table><br><table border="0">
         <tr>
            <td valign="top" align="left"><img align="left" src="../graphics/note.gif" alt="Note" title="Note"></td>
            <td valign="bottom" align="left" width="100%">
               <div class="para_note">
                  <p class="para_note_body">NX only merges black and white bitmaps that are saved in 24&ndash;bit BMP format and with no internal compression.</p>
               </div>
            </td>
         </tr>
      </table>
      <p class="para_division">Single Bitmap Size:</p>
      <p class="para_division">If you provide only the &lt;my_graphic&gt;.21.white.bmp and &lt;my_graphic&gt;.21.black.bmp pair of bitmaps, NX uses these bitmaps and automatically scales the images down to the smaller sizes as needed. In th etoolbar or menu file, you should still refer to this bitmap as &ldquo;&lt;my_graphic&gt;.bmp&rdquo;.</p>
      <div class="title_division">Where NX Searches for Bitmaps</div>
      <p class="para_division">Absolute Pathnames:</p>
      <p class="para_division">If a toolbar or menu file references a bitmap with an absolute path name, NX loads the bitmap from the specified directory. The path name may contain embedded environment variables and can use either&rdquo;/&rdquo; or &ldquo;\&rdquo; as a directory delimiter (e.g., $BITMAPS/thing.bmp).</p>
      <p class="para_division">Filename Only:</p>
      <p class="para_division">If you only use the bitmap name, NX searches for bitmaps in the following directories in this order:</p>
      <ol type="1" start="1">
         <li>
            <p class="para_item">Each of the directories referred to by the UGII_BITMAP_PATH environment variable (if defined). On Unix platforms, this should be a colon-separated list of directory names; on Windows, it is a semicolon-separated list.</p>
         </li>
         <li>
            <p class="para_item">Each of the &ldquo;application&rdquo; subdirectories of the NX Open directories listed in the custom_dirs.dat file.</p>
         </li>
         <li>
            <p class="para_item">The $UGII_ROOT_DIR/ugii/bitmaps standard directory.</p>
         </li>
      </ol>
      <div class="title_division">Limitations</div>
      <p class="para_division">Avoid references to bitmaps with relative pathnames (e.g. &ldquo;./bitmaps/&lt;my_graphic&gt;.bmp&rdquo;). NX attempts to load such bitmaps from its current directory at the time that the bitmap is required.</p>
      <p class="para_division">NX does not correctly handle directories containing period (.) characters.</p>
   </body>
</html>