<?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 Using Utils.GetBlockImage() for RibbonButton image in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/using-utils-getblockimage-for-ribbonbutton-image/m-p/10581113#M15430</link>
    <description>&lt;P&gt;I'm trying to use the Autodesk.AutoCAD.Internal.Utils.GetBlockImage() method to get a preview of the blocks of a closed document. However, when using System.Windows.Interop.Imaging.CreateBitmapSourceFromHitmap(), the image in the RibbonSplitButton does not display correctly. How can I convert and resize it to display it correctly in the RibbonSplitButton?&lt;/P&gt;</description>
    <pubDate>Sat, 28 Aug 2021 14:12:25 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2021-08-28T14:12:25Z</dc:date>
    <item>
      <title>Using Utils.GetBlockImage() for RibbonButton image</title>
      <link>https://forums.autodesk.com/t5/net-forum/using-utils-getblockimage-for-ribbonbutton-image/m-p/10581113#M15430</link>
      <description>&lt;P&gt;I'm trying to use the Autodesk.AutoCAD.Internal.Utils.GetBlockImage() method to get a preview of the blocks of a closed document. However, when using System.Windows.Interop.Imaging.CreateBitmapSourceFromHitmap(), the image in the RibbonSplitButton does not display correctly. How can I convert and resize it to display it correctly in the RibbonSplitButton?&lt;/P&gt;</description>
      <pubDate>Sat, 28 Aug 2021 14:12:25 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/using-utils-getblockimage-for-ribbonbutton-image/m-p/10581113#M15430</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-08-28T14:12:25Z</dc:date>
    </item>
    <item>
      <title>Re: Using Utils.GetBlockImage() for RibbonButton image</title>
      <link>https://forums.autodesk.com/t5/net-forum/using-utils-getblockimage-for-ribbonbutton-image/m-p/10581143#M15431</link>
      <description>Oh, just used nImgWidth = 32 and nImgHeight = 32 along with System.Windows.Media.Imaging.BitmapSizeOptions.FromEmptyOptions() for System.Windows.Interop.Imaging.CreateBitmapSourceFromHBitmap() and it worked</description>
      <pubDate>Sat, 28 Aug 2021 14:32:15 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/using-utils-getblockimage-for-ribbonbutton-image/m-p/10581143#M15431</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-08-28T14:32:15Z</dc:date>
    </item>
    <item>
      <title>Re: Using Utils.GetBlockImage() for RibbonButton image</title>
      <link>https://forums.autodesk.com/t5/net-forum/using-utils-getblockimage-for-ribbonbutton-image/m-p/10581419#M15432</link>
      <description>&lt;P&gt;Have you tried to pass different width/height values to the GetBlockImage() method?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Since you need image for the Ribbon UI, which does not need higher qualify/resolution images, and I guess you need them at runtime, you might want to try&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Autodesk.AutoCAD.Windows.Data.CMLContentSearchPreviews class (in acmgd.dll), it has a static method GetBlockTRThumbnail(BlockTableRecord). This method is designed for AutoCAD to get a block's thumbnail for AutoCAD's UI at runtime, so it could be just what you want. The good thing is that it directly generate the thumbnail image as ImageSource, so you do not need code to convert bitmap to ImageSource for AutoCAD UI use.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 28 Aug 2021 17:32:20 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/using-utils-getblockimage-for-ribbonbutton-image/m-p/10581419#M15432</guid>
      <dc:creator>norman.yuan</dc:creator>
      <dc:date>2021-08-28T17:32:20Z</dc:date>
    </item>
  </channel>
</rss>

