<?xml version="1.0"?>
<rss version="2.0">
	<channel>
		<title>how to : Bitmap Color Mask</title>
		<link>http://www.allegro.cc/forums/view/608657</link>
		<description>Allegro.cc Forum Thread</description>
		<webMaster>matthew@allegro.cc (Matthew Leverton)</webMaster>
		<lastBuildDate>Mon, 24 Oct 2011 16:19:39 +0000</lastBuildDate>
	</channel>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I have a question regarding al_convert_mask_to_alpha. I have managed to open a bitmap in an image editor and get an RGB color to feed into that funciton, but is there some way to make something easier where I do not Have to look up each color for each bitmap?</p><p>My idea was this:</p><p><span class="source-code"><a href="http://www.allegro.cc/manual/al_convert_mask_to_alpha"><span class="a">al_convert_mask_to_alpha</span></a><span class="k2">(</span>image, <a href="http://www.allegro.cc/manual/al_get_pixel"><span class="a">al_get_pixel</span></a><span class="k2">(</span>image,<span class="n">0</span>,<span class="n">0</span><span class="k2">)</span><span class="k2">)</span><span class="k2">;</span></span></p><p>but al_get_pixel does not seem to return an RGB value. What does it return and is it possible to translate it into an RGB value for use in a function like this?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (sec_goat)</author>
		<pubDate>Mon, 24 Oct 2011 03:51:29 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>If you had read the help pages linked to by your own code tags in your post, you would know al_get_pixel returns an ALLEGRO_COLOR and the second parameter of al_convert_mask_to_alpha takes an ALLEGRO_COLOR. Your code should work as far as I can tell. What isn&#39;t working? If you really need the r,g,b,a values, use one of the <span class="source-code"><a href="http://www.allegro.cc/manual/al_unmap_rgb"><span class="a">al_unmap_rgb</span></a><span class="k3">*</span></span> functions.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Edgar Reynaldo)</author>
		<pubDate>Mon, 24 Oct 2011 05:30:34 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>
</p><div class="quote_container"><div class="title"><a href="http://www.allegro.cc/forums/thread/608657/935083#target">Edgar Reynaldo</a> said:</div><div class="quote"><p>If you had read the help pages linked to by your own code tags in your post</p></div></div><p>

You will have to forgive me, I am coming off Python, which is a little more verbose in the help field. I do now see that at the top of the page it defines return type. I was looking in the text for something that told me return type. I must apologize for my ignorance, also I did not realise that if I post an allegro function it links to the help page, this is an awesome resource. Thank you.</p><p>Well it appears the code I wrote up here works exactly correct!<br />In my actual code I had written it as:</p><p><span class="source-code"><a href="http://www.allegro.cc/manual/al_convert_mask_to_alpha"><span class="a">al_convert_mask_to_alpha</span></a><span class="k2">(</span>player, <a href="http://www.allegro.cc/manual/al_get_pixel"><span class="a">al_get_pixel</span></a><span class="k2">(</span>player, <a href="http://www.allegro.cc/manual/al_map_rgb"><span class="a">al_map_rgb</span></a><span class="k2">(</span><a href="http://www.allegro.cc/manual/al_get_pixel"><span class="a">al_get_pixel</span></a><span class="k2">(</span>player,<span class="n">0</span>,<span class="n">0</span><span class="k2">)</span><span class="k2">)</span><span class="k2">)</span></span><img src="http://www.allegro.cc/forums/smileys/rolleyes.gif" alt="::)" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (sec_goat)</author>
		<pubDate>Mon, 24 Oct 2011 16:19:39 +0000</pubDate>
	</item>
</rss>
