<?xml version="1.0"?>
<rss version="2.0">
	<channel>
		<title>Bad scaling with al_set_display_icon()</title>
		<link>http://www.allegro.cc/forums/view/615517</link>
		<description>Allegro.cc Forum Thread</description>
		<webMaster>matthew@allegro.cc (Matthew Leverton)</webMaster>
		<lastBuildDate>Fri, 03 Jul 2015 10:15:19 +0000</lastBuildDate>
	</channel>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I&#39;ve recently found that, using <span class="source-code"><a href="http://www.allegro.cc/manual/al_set_display_icon"><span class="a">al_set_display_icon</span></a><span class="k2">(</span><span class="k2">)</span></span>, passing a bitmap larger than 32x32 ends with a crummy-looking taskbar icon.  From a cursory look at the Allegro source, it seems like it uses memory bitmaps to scale the image to the proper size.</p><p>I&#39;m wondering if there&#39;s a way I can work around this, as I know there are platforms using icons larger than 32x32 and I still want it to look decent.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Bruce Pascoe)</author>
		<pubDate>Thu, 02 Jul 2015 22:00:00 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I was under the impression that that is what <span class="source-code">al_set_display_icons</span> was for, you&#39;d pass it a whole bunch of icons of different sizes and it&#39;d somehow pick one that looks best.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (SiegeLord)</author>
		<pubDate>Thu, 02 Jul 2015 22:30:41 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I was hoping I wouldn&#39;t have to do that.  Currently I have it load a single image file, icon.png, from the game directory to apply to the window, with this I would have to have multiple files (or maybe some sort of icon atlas) and load them all.</p><p>That said, I partially worked around it by doing this:<br /><span class="source-code"><a href="http://www.allegro.cc/manual/al_set_new_bitmap_flags"><span class="a">al_set_new_bitmap_flags</span></a><span class="k2">(</span>ALLEGRO_MIN_LINEAR <span class="k3">|</span> ALLEGRO_MAG_LINEAR<span class="k2">)</span><span class="k2">;</span></span><br />Before loading the icon (as a video bitmap), scaling it down, and then passing that to Allegro.  The results aren&#39;t optimal, but it does look 100% better than letting Allegro do the scaling in software.</p><p>As I&#39;m making a general-purpose game engine, my requirements are a bit different than if I were just making a standalone game--I want to keep things as simple as possible. <img src="http://www.allegro.cc/forums/smileys/smiley.gif" alt=":)" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Bruce Pascoe)</author>
		<pubDate>Thu, 02 Jul 2015 22:42:23 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Well, you could create the different sizes programmatically (I guess that&#39;s what you&#39;re essentially doing) and pass them to that function. Start with a 512x512 icon and then scale it down a few times with whatever high quality method you chose and then pass them to Allegro.</p><p>It&#39;s an interesting question of whether <span class="source-code"><a href="http://www.allegro.cc/manual/al_set_display_icon"><span class="a">al_set_display_icon</span></a></span> should have configurable icon scaling quality.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (SiegeLord)</author>
		<pubDate>Thu, 02 Jul 2015 22:46:46 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>In case you&#39;re curious, this question came about due to my recent discovery that Windows 10 is going to support 768x768 icons, so I was getting ready by scaling up my icons to that size. <img src="http://www.allegro.cc/forums/smileys/cool.gif" alt="8-)" />  Allegro didn&#39;t much appreciate me passing that huge image to <span class="source-code"><a href="http://www.allegro.cc/manual/al_set_display_icon"><span class="a">al_set_display_icon</span></a></span> though, it looked like crap. <img src="http://www.allegro.cc/forums/smileys/tongue.gif" alt=":P" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Bruce Pascoe)</author>
		<pubDate>Thu, 02 Jul 2015 22:54:57 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Icons tend to look like crap if you scale them too much. To look best, you want to have a few sizes, that then get scaled up or down to the nearest platform supported size (android apps do this a lot, it saves on a bunch of copies of icons, but provides the decent looking results at most display sizes and pixel densities).
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Thomas Fjellstrom)</author>
		<pubDate>Fri, 03 Jul 2015 05:12:58 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I think it would be nice if we had an API which can help discover just which sizes ans usages of icons are supported. Maybe something like this:</p><div class="source-code snippet"><div class="inner"><pre>
<span class="k1">typedef</span> <span class="k1">struct</span> ALLEGRO_ICON_INFO <span class="k2">{</span>
   <span class="k1">int</span> width<span class="k2">;</span>          <span class="c">// Icon width</span>
   <span class="k1">int</span> height<span class="k2">;</span>         <span class="c">// Icon height</span>
   <span class="k1">int</span> usage<span class="k2">;</span>          <span class="c">// Flag that describes what the icon is used for, etc.</span>
<span class="k2">}</span> ALLEGRO_ICON_INFO<span class="k2">;</span>

<span class="k1">int</span> al_get_num_icons<span class="k2">(</span><a href="http://www.allegro.cc/manual/ALLEGRO_DISPLAY"><span class="a">ALLEGRO_DISPLAY</span></a> <span class="k3">*</span> disp<span class="k2">)</span><span class="k2">;</span>
ALLEGRO_ICON_INFO <span class="k3">*</span> al_get_icon_info<span class="k2">(</span><a href="http://www.allegro.cc/manual/ALLEGRO_DISPLAY"><span class="a">ALLEGRO_DISPLAY</span></a> <span class="k3">*</span> disp, <span class="k1">int</span> <a href="http://www.delorie.com/djgpp/doc/libc/libc_470.html" target="_blank">index</a><span class="k2">)</span><span class="k2">;</span>
</pre></div></div><p>
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (beoran)</author>
		<pubDate>Fri, 03 Jul 2015 10:15:19 +0000</pubDate>
	</item>
</rss>
