<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: how to display bmp images in autolisp? in Visual LISP, AutoLISP and General Customization Forum</title>
    <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-display-bmp-images-in-autolisp/m-p/13778310#M166113</link>
    <description>&lt;P&gt;Unfortunately, image files like bitmaps (&lt;STRONG&gt;bmp&lt;/STRONG&gt;) are NOT supported but only vector or slide (&lt;STRONG&gt;sld&lt;/STRONG&gt;) files are supported in dcl &lt;STRONG&gt;image&lt;/STRONG&gt; &amp;amp; &lt;STRONG&gt;image button&lt;/STRONG&gt; tiles.&lt;/P&gt;&lt;P&gt;Perhaps you can utilize the built-in Autolisp function&amp;nbsp;&lt;SPAN&gt;&lt;STRONG&gt;acad_truecolordlg&amp;nbsp;&lt;/STRONG&gt;to open a a color selection window and then you can pass that result back to your code:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;A href="https://help.autodesk.com/view/OARX/2024/ENU/?guid=GUID-E6FF435F-9E66-4F37-8770-2E3FB87B8E0B" target="_blank"&gt;https://help.autodesk.com/view/OARX/2024/ENU/?guid=GUID-E6FF435F-9E66-4F37-8770-2E3FB87B8E0B&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;(setq col (acad_truecolordlg '(62 . 7)))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;The above line of code will bring up the following color selection window:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="paullimapa_0-1755840513170.png" style="width: 400px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1563605iFD4ABA4B42F21D11/image-size/medium?v=v2&amp;amp;px=400" role="button" title="paullimapa_0-1755840513170.png" alt="paullimapa_0-1755840513170.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;If an &lt;STRONG&gt;AutoCAD Color Index&lt;/STRONG&gt; (0 to 256) is selected like&amp;nbsp;&lt;STRONG&gt;Magenta&lt;/STRONG&gt;&amp;nbsp;which is Color &lt;STRONG&gt;6&lt;/STRONG&gt;:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="paullimapa_2-1755840812883.png" style="width: 400px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1563607i63A3B94CA4A8143F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="paullimapa_2-1755840812883.png" alt="paullimapa_2-1755840812883.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;AutoCAD returns a list containing a single item:&amp;nbsp;&lt;STRONG&gt;((62 . 6))&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Use the following to get the&lt;STRONG&gt; AutoCAD Color Index&lt;/STRONG&gt;:&lt;/P&gt;&lt;LI-CODE lang="general"&gt;(cdr (car col))&lt;/LI-CODE&gt;&lt;P&gt;AutoCAD returns:&amp;nbsp;&lt;STRONG&gt;6&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;If a &lt;STRONG&gt;True Color&lt;/STRONG&gt; selection is made:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="paullimapa_1-1755840697336.png" style="width: 400px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1563606i942772082692FF7D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="paullimapa_1-1755840697336.png" alt="paullimapa_1-1755840697336.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;AutoCAD returns a list containing two items:&amp;nbsp;&lt;STRONG&gt;((62 . 112) (420 . 3329361))&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;You'll need to convert the&lt;STRONG&gt; 420 &lt;/STRONG&gt;pair color number to &lt;STRONG&gt;RGB&lt;/STRONG&gt; by using something like Lee Mac's &lt;STRONG&gt;LM:OLE-&amp;gt;RGB&lt;/STRONG&gt; conversion function:&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.lee-mac.com/colourconversion.html" target="_blank"&gt;https://www.lee-mac.com/colourconversion.html&lt;/A&gt;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;;; OLE -&amp;gt; RGB  -  Lee Mac
;; Args: c - [int] OLE Colour

(defun LM:OLE-&amp;gt;RGB ( c )
    (mapcar '(lambda ( x ) (lsh (lsh (fix c) x) -24)) '(24 16 8))
)&lt;/LI-CODE&gt;&lt;P&gt;The following line of code coverts &lt;STRONG&gt;col&lt;/STRONG&gt; to &lt;STRONG&gt;RGB&lt;/STRONG&gt;:&lt;/P&gt;&lt;LI-CODE lang="general"&gt;(setq rgb (reverse (LM:OLE-&amp;gt;RGB (cdr (cadr col)))))&lt;/LI-CODE&gt;&lt;P&gt;AutoCAD returns:&amp;nbsp;&lt;STRONG&gt;(50 205 81)&lt;/STRONG&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 22 Aug 2025 06:03:28 GMT</pubDate>
    <dc:creator>paullimapa</dc:creator>
    <dc:date>2025-08-22T06:03:28Z</dc:date>
    <item>
      <title>how to display bmp images in autolisp?</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-display-bmp-images-in-autolisp/m-p/13778206#M166112</link>
      <description>&lt;P&gt;I'm creating a menu via Autolisp, where the user can choose the line color and background color of the hatch, and I'm using sld images to display these "colors", however AutoCAD transforms RGB MSlide colors into ACI. Is it possible to use .bmp images? I'm trying but it doesn't appear. Could someone make a simple script showing how to display a .bmp image in a menu via Autolisp?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;in the image you can see that color 4 appears as gray in the menu;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot_1.png" style="width: 999px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1563600i29B93C7B08997D2D/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot_1.png" alt="Screenshot_1.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 22 Aug 2025 03:25:48 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-display-bmp-images-in-autolisp/m-p/13778206#M166112</guid>
      <dc:creator>pemattosarq</dc:creator>
      <dc:date>2025-08-22T03:25:48Z</dc:date>
    </item>
    <item>
      <title>Re: how to display bmp images in autolisp?</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-display-bmp-images-in-autolisp/m-p/13778310#M166113</link>
      <description>&lt;P&gt;Unfortunately, image files like bitmaps (&lt;STRONG&gt;bmp&lt;/STRONG&gt;) are NOT supported but only vector or slide (&lt;STRONG&gt;sld&lt;/STRONG&gt;) files are supported in dcl &lt;STRONG&gt;image&lt;/STRONG&gt; &amp;amp; &lt;STRONG&gt;image button&lt;/STRONG&gt; tiles.&lt;/P&gt;&lt;P&gt;Perhaps you can utilize the built-in Autolisp function&amp;nbsp;&lt;SPAN&gt;&lt;STRONG&gt;acad_truecolordlg&amp;nbsp;&lt;/STRONG&gt;to open a a color selection window and then you can pass that result back to your code:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;A href="https://help.autodesk.com/view/OARX/2024/ENU/?guid=GUID-E6FF435F-9E66-4F37-8770-2E3FB87B8E0B" target="_blank"&gt;https://help.autodesk.com/view/OARX/2024/ENU/?guid=GUID-E6FF435F-9E66-4F37-8770-2E3FB87B8E0B&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;(setq col (acad_truecolordlg '(62 . 7)))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;The above line of code will bring up the following color selection window:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="paullimapa_0-1755840513170.png" style="width: 400px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1563605iFD4ABA4B42F21D11/image-size/medium?v=v2&amp;amp;px=400" role="button" title="paullimapa_0-1755840513170.png" alt="paullimapa_0-1755840513170.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;If an &lt;STRONG&gt;AutoCAD Color Index&lt;/STRONG&gt; (0 to 256) is selected like&amp;nbsp;&lt;STRONG&gt;Magenta&lt;/STRONG&gt;&amp;nbsp;which is Color &lt;STRONG&gt;6&lt;/STRONG&gt;:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="paullimapa_2-1755840812883.png" style="width: 400px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1563607i63A3B94CA4A8143F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="paullimapa_2-1755840812883.png" alt="paullimapa_2-1755840812883.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;AutoCAD returns a list containing a single item:&amp;nbsp;&lt;STRONG&gt;((62 . 6))&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Use the following to get the&lt;STRONG&gt; AutoCAD Color Index&lt;/STRONG&gt;:&lt;/P&gt;&lt;LI-CODE lang="general"&gt;(cdr (car col))&lt;/LI-CODE&gt;&lt;P&gt;AutoCAD returns:&amp;nbsp;&lt;STRONG&gt;6&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;If a &lt;STRONG&gt;True Color&lt;/STRONG&gt; selection is made:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="paullimapa_1-1755840697336.png" style="width: 400px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1563606i942772082692FF7D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="paullimapa_1-1755840697336.png" alt="paullimapa_1-1755840697336.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;AutoCAD returns a list containing two items:&amp;nbsp;&lt;STRONG&gt;((62 . 112) (420 . 3329361))&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;You'll need to convert the&lt;STRONG&gt; 420 &lt;/STRONG&gt;pair color number to &lt;STRONG&gt;RGB&lt;/STRONG&gt; by using something like Lee Mac's &lt;STRONG&gt;LM:OLE-&amp;gt;RGB&lt;/STRONG&gt; conversion function:&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.lee-mac.com/colourconversion.html" target="_blank"&gt;https://www.lee-mac.com/colourconversion.html&lt;/A&gt;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;;; OLE -&amp;gt; RGB  -  Lee Mac
;; Args: c - [int] OLE Colour

(defun LM:OLE-&amp;gt;RGB ( c )
    (mapcar '(lambda ( x ) (lsh (lsh (fix c) x) -24)) '(24 16 8))
)&lt;/LI-CODE&gt;&lt;P&gt;The following line of code coverts &lt;STRONG&gt;col&lt;/STRONG&gt; to &lt;STRONG&gt;RGB&lt;/STRONG&gt;:&lt;/P&gt;&lt;LI-CODE lang="general"&gt;(setq rgb (reverse (LM:OLE-&amp;gt;RGB (cdr (cadr col)))))&lt;/LI-CODE&gt;&lt;P&gt;AutoCAD returns:&amp;nbsp;&lt;STRONG&gt;(50 205 81)&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 22 Aug 2025 06:03:28 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-display-bmp-images-in-autolisp/m-p/13778310#M166113</guid>
      <dc:creator>paullimapa</dc:creator>
      <dc:date>2025-08-22T06:03:28Z</dc:date>
    </item>
    <item>
      <title>Re: how to display bmp images in autolisp?</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-display-bmp-images-in-autolisp/m-p/13779537#M166136</link>
      <description>&lt;P&gt;Your already using a custom dcl to show the hatch patterns, which I take it are Slides, the make the color question slides as well, just set your Solid hatch to correct color and make a sld, not tested very much. Just made a couple of slides and used vslide.&lt;/P&gt;</description>
      <pubDate>Sat, 23 Aug 2025 00:18:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-display-bmp-images-in-autolisp/m-p/13779537#M166136</guid>
      <dc:creator>Sea-Haven</dc:creator>
      <dc:date>2025-08-23T00:18:30Z</dc:date>
    </item>
  </channel>
</rss>

