<?xml version="1.0"?>
<rss version="2.0">
	<channel>
		<title>saving a bitmap question</title>
		<link>http://www.allegro.cc/forums/view/618823</link>
		<description>Allegro.cc Forum Thread</description>
		<webMaster>matthew@allegro.cc (Matthew Leverton)</webMaster>
		<lastBuildDate>Wed, 31 May 2023 17:30:35 +0000</lastBuildDate>
	</channel>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Hi again:<br />  I have a question about saving bitmaps. I can save the backbuffer<br />with no problem. My question is how to save just the bitmap without<br />saving the complete backbuffer?</p><p>         temp_image = al_create_bitmap(screen_width, working_screen_height);<br />         al_set_target_bitmap(temp_image);<br />         al_draw_bitmap(al_get_backbuffer(display), 0, 0, 0);</p><p>         al_save_bitmap(&quot;sample.png&quot;, temp_image);</p><p>         al_destroy_bitmap(temp_image);<br />  <br />This will save the complete backbuffer</p><p>Thanks for your time!
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Scooter)</author>
		<pubDate>Mon, 29 May 2023 19:31:37 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Hi Scooter.</p><p>The answer is relatvely simple. Just pass a different bitmap pointer to al_save_bitmap.</p><p>edit<br />Maybe I&#39;m misunderstanding you. Use a smaller bitmap and draw a bitmap region instead of a bitmap.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Edgar Reynaldo)</author>
		<pubDate>Mon, 29 May 2023 21:30:57 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Hi Edgar:<br /> Thanks for the tip. It seems my problem stems from the fact that<br />I do not know how to get the width and height of the rotated bitmap.<br />After rotation I use al_get bitmap_width and al_get_bitmap_height and<br />it returns the width and height of the original bitmap, not the rotated<br />one. If you could give me a hint on this I believe I could figure the<br />rest out on my own.</p><p>Thanks!
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Scooter)</author>
		<pubDate>Tue, 30 May 2023 16:29:15 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>The concept of saving a rotated bitmap doesn’t really make much sense, all bitmaps are square/rectangle. You could either save a square, which has a height and width of the biggest original w/h (ie, a 320x240 bitmap would be saved as 320x320), or you could add some logic to determine the minimum rectangle size required based on rotation…
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Dizzy Egg)</author>
		<pubDate>Tue, 30 May 2023 21:48:18 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>To get the rotated width and height you need a little trigonometry. I&#39;ll write it out when I get home.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Edgar Reynaldo)</author>
		<pubDate>Tue, 30 May 2023 22:18:13 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Hi Edgar:<br />  After seeing your reply, I know exactly what to do:</p><p>I know the 4 corners of the image before rotating. I<br />can rotate the 4 corners for the new positions. If I<br />take the 2 extremes I will know the width and height.</p><p>Very good! Thanks for the tip!
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Scooter)</author>
		<pubDate>Wed, 31 May 2023 17:30:35 +0000</pubDate>
	</item>
</rss>
