<?xml version="1.0"?>
<rss version="2.0">
	<channel>
		<title>Take screenshot with allegro</title>
		<link>http://www.allegro.cc/forums/view/614998</link>
		<description>Allegro.cc Forum Thread</description>
		<webMaster>matthew@allegro.cc (Matthew Leverton)</webMaster>
		<lastBuildDate>Sun, 18 Jan 2015 14:25:13 +0000</lastBuildDate>
	</channel>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Is there any way to take a screenshot and then save it as an allegro bitmap to be able to display it?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Bingocat)</author>
		<pubDate>Sun, 18 Jan 2015 10:35:42 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p><span class="source-code"><a href="http://www.allegro.cc/manual/al_save_bitmap"><span class="a">al_save_bitmap</span></a><span class="k2">(</span><span class="s">"screenshot.bmp"</span>, <a href="http://www.allegro.cc/manual/al_get_backbuffer"><span class="a">al_get_backbuffer</span></a><span class="k2">(</span>display<span class="k2">)</span><span class="k2">)</span></span> might work.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (SiegeLord)</author>
		<pubDate>Sun, 18 Jan 2015 11:16:01 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I don&#39;t mean take a screenshot of the program and save it. I mean take a screenshot of the whole screen and have it as a bitmap. Something like this.</p><p><span class="source-code"><a href="http://www.allegro.cc/manual/ALLEGRO_BITMAP"><span class="a">ALLEGRO_BITMAP</span></a> <span class="k3">*</span>screenshot <span class="k3">=</span> al_take_screenshot<span class="k2">(</span><span class="k2">)</span><span class="k2">;</span></span>
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Bingocat)</author>
		<pubDate>Sun, 18 Jan 2015 11:25:07 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Ah... that can&#39;t be done with Allegro.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (SiegeLord)</author>
		<pubDate>Sun, 18 Jan 2015 12:02:44 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>You have to get the HDC of the desktop on Windows and then blit the screenDC into a compatible memoryDC and then you should be able to access the specific pixels and write to a bitmap.</p><p><a href="http://stackoverflow.com/questions/18858638/how-to-get-a-screen-image-into-a-memory-buffer">http://stackoverflow.com/questions/18858638/how-to-get-a-screen-image-into-a-memory-buffer</a>
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Edgar Reynaldo)</author>
		<pubDate>Sun, 18 Jan 2015 12:03:39 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Users can do that with screenshot utilities, which run by default in pretty much every OS.  Why would you want redundant functionality in your program, when it&#39;s as easy as pressing Print Screen?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Gideon Weems)</author>
		<pubDate>Sun, 18 Jan 2015 12:29:50 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>How about 
</p><div class="source-code snippet"><div class="inner"><pre><a href="http://www.allegro.cc/manual/al_save_bitmap"><span class="a">al_save_bitmap</span></a><span class="k2">(</span><span class="s">"screenshot.bmp"</span>, <a href="http://www.allegro.cc/manual/al_get_backbuffer"><span class="a">al_get_backbuffer</span></a><span class="k2">(</span>display<span class="k2">)</span><span class="k2">)</span><span class="k2">;</span>
<a href="http://www.allegro.cc/manual/ALLEGRO_BITMAP"><span class="a">ALLEGRO_BITMAP</span></a><span class="k3">*</span> <a href="http://www.allegro.cc/manual/screen"><span class="a">screen</span></a> <span class="k3">=</span> <a href="http://www.allegro.cc/manual/al_load_bitmap"><span class="a">al_load_bitmap</span></a><span class="k2">(</span><span class="s">"screenshot.bmp"</span><span class="k2">)</span><span class="k2">;</span>
</pre></div></div><p>
<img src="http://www.allegro.cc/forums/smileys/tongue.gif" alt=":P" /></p><p>But really what you probably should do is triple buffer. <a href="https://wiki.allegro.cc/index.php?title=Triple_buffering">https://wiki.allegro.cc/index.php?title=Triple_buffering</a></p><p>Keep a bitmap the size of the screen and draw into that, <a href="https://www.allegro.cc/manual/5/al_set_target_bitmap">https://www.allegro.cc/manual/5/al_set_target_bitmap</a> then draw that to the screen. You now have a copy of what is on the screen and you can redraw that at a later time.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (jmasterx)</author>
		<pubDate>Sun, 18 Jan 2015 12:32:23 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Ok I figured out how to do it from here <a href="http://www.cplusplus.com/forum/windows/105644/">http://www.cplusplus.com/forum/windows/105644/</a> . I saved it as a jpg and loaded it with allegro.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Bingocat)</author>
		<pubDate>Sun, 18 Jan 2015 14:25:13 +0000</pubDate>
	</item>
</rss>
