/2014/06/21/Win32--Revisited---Creating-an-AVI-from-a-GIF-that-works-with-ANIMATE_CLASS/
{"item":{"status":"visible","url":"\/2014\/06\/21\/Win32--Revisited---Creating-an-AVI-from-a-GIF-that-works-with-ANIMATE_CLASS\/","trash":"","name":"Win32--Revisited---Creating-an-AVI-from-a-GIF-that-works-with-ANIMATE_CLASS","parent":"","title":"Win32: Revisited - Creating an AVI from a GIF that works with ANIMATE_CLASS","date":"2014-06-21 02:06:05","filepath":"posts\/20140621_Win32--Revisited---Creating-an-AVI-from-a-GIF-that-works-with-ANIMATE_CLASS.xml.json","type":"post","content":"<p><img style=\"margin-left: 10px; margin-right: 10px; float: left;\" src=\"http:\/\/www.8bitrobot.com\/media\/uploads\/2012\/01\/gear.png\" alt=\"\" width=\"60\" height=\"64\" \/><\/p>\n<p>An earlier post (<a href=\"http:\/\/www.8bitrobot.com\/2014\/05\/24\/Win32--Creating-an-AVI-for-ANIMATE_CLASS\/\">Creating an AVI for ANIMATE_CLASS<\/a>) described how to create an AVI that will work with the ANIMATE_CLASS common control. However, there are still some particulars that need to be ironed out for the AVI creation and play to be successful... especially when attempting to create an AVI from a GIF animated image.<\/p>\n<p>Most of the issues center around bit depth and global palettes during the conversion. But, instead of explaining all this, I'll just give the basic steps used to create the AVI:<\/p>\n<ol>\n<li>Download <a href=\"http:\/\/www.imagemagick.org\/\">ImageMagick<\/a><\/li>\n<li>At the command prompt use IM to create a series of frames with the proper encoding<\/li>\n<ul>\n<li>convert -append spin.gif all.gif<\/li>\n<li>convert all.gif -unique-colors -depth 8 map.gif<\/li>\n<li>convert -coalesce spin.gif BMP2:frame_%05d.bmp<\/li>\n<li>mogrify -define bmp:format=bmp2 +matte -remap map.gif -colors 256 *.bmp<\/li>\n<\/ul>\n<li>Download <a href=\"http:\/\/makeavi.sourceforge.net\/\">MakeAVI<\/a><\/li>\n<li>Add the frame files (frame_00000.bmp)<\/li>\n<li>Select the fps and press Begin<\/li>\n<li>Choose a save name<\/li>\n<li>Choose the \"Microsoft RLE\" compressor with quality set to 100<\/li>\n<li>Press OK and verify the AVI can be played in Media Player<\/li>\n<\/ol>\n<div>Also, keep in mind some colors may cause problems with transparency. So, be sure to remove ACS_TRANSPARENT from the window style if you don't want transparency.<\/div>\n<div>Here is a <a href=\"http:\/\/code.msdn.microsoft.com\/windowsdesktop\/CppWindowsCommonControls-9ea0de64\/sourcecode?fileId=21600&pathId=788479441\">Microsoft sample<\/a> for creating an AVI animation window (note: it uses ACS_TRANSPARENT).<\/div>"}}