<?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: Win10 Custom Scaling | SetMenuIcon() Exception &amp;quot;Icons must be 16x16 pixels in size.&amp;quot; in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/win10-custom-scaling-setmenuicon-exception-quot-icons-must-be/m-p/10146318#M17286</link>
    <description>&lt;P&gt;&lt;SPAN&gt;(Jokingly said) - What does Autodesk have against older users wanting to use Windows Custom Scaling&amp;nbsp; to make things easier to read? Haha&lt;/SPAN&gt;&lt;/P&gt;&lt;HR /&gt;&lt;P&gt;&lt;SPAN&gt;Joking aside, in a debug session it appears that Utils.GetAcadResourceIcon("RCDATA_16_*") calls return Null instead of the Icon as expected.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Can someone please confirm that this is in fact an API bug?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regardless of what user elects to set any Windows Custom Scaling, the API should still return a valid resource icon (given the applicable parent CUIx is loaded that provides said resource icon), no?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This is happening in 2019-Current versions.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Please advise.&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 10 Mar 2021 19:30:54 GMT</pubDate>
    <dc:creator>BlackBox_</dc:creator>
    <dc:date>2021-03-10T19:30:54Z</dc:date>
    <item>
      <title>Win10 Custom Scaling | SetMenuIcon() Exception "Icons must be 16x16 pixels in size."</title>
      <link>https://forums.autodesk.com/t5/net-forum/win10-custom-scaling-setmenuicon-exception-quot-icons-must-be/m-p/10138988#M17283</link>
      <description>&lt;P&gt;I have a user that increased their Window 10 Display, Custom Scaling (Text Height) % in OS Settings, that is now prompting them with an "Icons must be 16x16 pixels in size." SetMenuIcon() exception at AutoCAD/Civil 3D launch:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;SetMenuIcon(blockMenuItem, "Block", "RCDATA_16_BLOCK");&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Putting this in a Try-Catch block is simple enough - but AutoCAD application still does not load the icons - even though they're coming from internal ACAD.cuix icons (or the respective native icon resources) via SetMenuIcon() call with native "RCDATA_16_*" icons.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The native Commands in CUI (Ribbon, Menu, Toolbar, etc) still load fine - which means it is okay to use the native icon resources - but they won't load for SetMenuItem()?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Windows Custom Scaling isn't exactly new, so someone has to have seen something on how to fix this (besides just disable Custom Scaling); I'm just not finding anything useful to resolve this.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please advise.&lt;/P&gt;</description>
      <pubDate>Mon, 08 Mar 2021 14:57:48 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/win10-custom-scaling-setmenuicon-exception-quot-icons-must-be/m-p/10138988#M17283</guid>
      <dc:creator>BlackBox_</dc:creator>
      <dc:date>2021-03-08T14:57:48Z</dc:date>
    </item>
    <item>
      <title>Re: Win10 Custom Scaling | SetMenuIcon() Exception "Icons must be 16x16 pixels in size."</title>
      <link>https://forums.autodesk.com/t5/net-forum/win10-custom-scaling-setmenuicon-exception-quot-icons-must-be/m-p/10139299#M17284</link>
      <description>&lt;P&gt;Apologies, for any confusion:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;SetMenuIcon() is simply a custom Method to call&amp;nbsp;Utils.GetAcadResourceIcon("RCDATA_16_*") within a try-catch block that would still allow my custom MenuItems to be loaded &amp;amp; operational even without the icon.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The&amp;nbsp;Utils.GetAcadResourceIcon("RCDATA_16_*") call is what's raising the exception.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;private static void SetMenuIcon(MenuItem menu, string name, string icon)
        {
            Document doc = acDocs.MdiActiveDocument;

            if (doc == null)
                return;

            Editor ed = doc.Editor;

            try
            {
                menu.Icon = Utils.GetAcadResourceIcon(icon);
            }
            catch
            {
                ed.WriteMessage("\n** Exception: \"{0}\" menu: Resource icon \"{1}\" missing \n",
                    name, icon);
            }
        }&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 08 Mar 2021 16:26:14 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/win10-custom-scaling-setmenuicon-exception-quot-icons-must-be/m-p/10139299#M17284</guid>
      <dc:creator>BlackBox_</dc:creator>
      <dc:date>2021-03-08T16:26:14Z</dc:date>
    </item>
    <item>
      <title>Re: Win10 Custom Scaling | SetMenuIcon() Exception "Icons must be 16x16 pixels in size."</title>
      <link>https://forums.autodesk.com/t5/net-forum/win10-custom-scaling-setmenuicon-exception-quot-icons-must-be/m-p/10139421#M17285</link>
      <description>&lt;P&gt;In a test:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Clicking Windows button (WinKey), typing Display, click on Display Settings, scroll down to and click on Advanced Scaling Settings, then enter 110 into the Custom Scaling textbox (&amp;amp; restarting workstation for setting to take effect).&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;... Using Civil 3D 2021.2, I am able to confirm that&amp;nbsp;Utils.GetAcadResourceIcon() is incorrectly identifying that the resource icon does not exist, when same "RCDATA_16_*" icons are being used in the native Ribbon panels (that's where I got the icon names in the first place).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Not sure how/why, but it's *as if* the&amp;nbsp;Utils.GetAcadResourceIcon() call is somehow getting the actual "RCDATA_16_*" resource icon (16x16) x 1.10 (110%) OS Custom Scaling == 17.6x17.6 pixels and throwing the Exception?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help would be greatly appreciated.&lt;/P&gt;</description>
      <pubDate>Mon, 08 Mar 2021 16:59:34 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/win10-custom-scaling-setmenuicon-exception-quot-icons-must-be/m-p/10139421#M17285</guid>
      <dc:creator>BlackBox_</dc:creator>
      <dc:date>2021-03-08T16:59:34Z</dc:date>
    </item>
    <item>
      <title>Re: Win10 Custom Scaling | SetMenuIcon() Exception "Icons must be 16x16 pixels in size."</title>
      <link>https://forums.autodesk.com/t5/net-forum/win10-custom-scaling-setmenuicon-exception-quot-icons-must-be/m-p/10146318#M17286</link>
      <description>&lt;P&gt;&lt;SPAN&gt;(Jokingly said) - What does Autodesk have against older users wanting to use Windows Custom Scaling&amp;nbsp; to make things easier to read? Haha&lt;/SPAN&gt;&lt;/P&gt;&lt;HR /&gt;&lt;P&gt;&lt;SPAN&gt;Joking aside, in a debug session it appears that Utils.GetAcadResourceIcon("RCDATA_16_*") calls return Null instead of the Icon as expected.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Can someone please confirm that this is in fact an API bug?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regardless of what user elects to set any Windows Custom Scaling, the API should still return a valid resource icon (given the applicable parent CUIx is loaded that provides said resource icon), no?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This is happening in 2019-Current versions.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Please advise.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Mar 2021 19:30:54 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/win10-custom-scaling-setmenuicon-exception-quot-icons-must-be/m-p/10146318#M17286</guid>
      <dc:creator>BlackBox_</dc:creator>
      <dc:date>2021-03-10T19:30:54Z</dc:date>
    </item>
    <item>
      <title>Re: Win10 Custom Scaling | SetMenuIcon() Exception "Icons must be 16x16 pixels in size."</title>
      <link>https://forums.autodesk.com/t5/net-forum/win10-custom-scaling-setmenuicon-exception-quot-icons-must-be/m-p/10150174#M17287</link>
      <description>&lt;P&gt;You've got to watch .NET operations involving images (and of course fonts in datagridview, etc).&amp;nbsp; For example I had a tool that was assembling downloaded images in a tile fashion.&amp;nbsp; On certain end user machines it was making a mess of it until I looked closely at the end users results.&amp;nbsp; It turns out that .NET was scaling the source image tiles by the custom scaling (150%).&amp;nbsp; I simply had to put some size constraints in using DrawImage(Bmp,Rectangle) instead of DrawImage(Bmp,InsPnt).&amp;nbsp; Got to watch .NET and Windows, don't think AutoCAD is doing anything.&lt;/P&gt;</description>
      <pubDate>Fri, 12 Mar 2021 00:06:38 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/win10-custom-scaling-setmenuicon-exception-quot-icons-must-be/m-p/10150174#M17287</guid>
      <dc:creator>TerryDotson</dc:creator>
      <dc:date>2021-03-12T00:06:38Z</dc:date>
    </item>
  </channel>
</rss>

