<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Games, Life, and Stuff &#187; Application Develeopment</title>
	<atom:link href="http://www.techknight.com/blog/category/application-develeopment/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.techknight.com/blog</link>
	<description>Game development and more</description>
	<lastBuildDate>Mon, 15 Aug 2011 14:35:21 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>ClrTyp 1.0 &#8211; Disables ClearType when taking screenshots</title>
		<link>http://www.techknight.com/blog/2008/06/06/clrtyp-10-disables-cleartype-when-taking-screenshots/</link>
		<comments>http://www.techknight.com/blog/2008/06/06/clrtyp-10-disables-cleartype-when-taking-screenshots/#comments</comments>
		<pubDate>Fri, 06 Jun 2008 18:06:00 +0000</pubDate>
		<dc:creator>techknight</dc:creator>
				<category><![CDATA[Application Develeopment]]></category>
		<category><![CDATA[downloads]]></category>

		<guid isPermaLink="false">http://www.techknight.com/blog/2008/06/06/clrtyp-10-disables-cleartype-when-taking-screenshots/</guid>
		<description><![CDATA[At the request of a friend, I made a utility last night that temporarily disables ClearType when a screenshot is made via PrtScr or Alt+PrtScr. ClrTyp 1.0 Usage: Extract zip file to any folder and run ClrTyp.exe. An icon will appear in the systray. As long as ClrTyp is running, any screenshots made with your [...]]]></description>
			<content:encoded><![CDATA[<p>At the request of a friend, I made a utility last night that temporarily disables <a href="http://www.microsoft.com/typography/WhatIsClearType.mspx">ClearType</a> when a screenshot is made via PrtScr or Alt+PrtScr.</p>
<h5>ClrTyp 1.0</h5>
<p>Usage:</p>
<p>Extract zip file to any folder and run ClrTyp.exe. An icon will appear in the systray. As long as ClrTyp is running, any screenshots made with your Print Screen key will have ClearType disabled.</p>
<p>Download:</p>
<ul>
<li><a href="http://www.techknight.com/download/clrtyp_x86.zip">clrtyp_x86.zip</a> 32-bit version</li>
<li><a href="http://www.techknight.com/download/clrtyp_x64.zip">clrtype_x64.zip</a> 64-bit version</li>
</ul>
<p>Requirements:</p>
<ul>
<li><a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=0856EACB-4362-4B0D-8EDD-AAB15C5E04F5&amp;displaylang=en">Microsoft .NET Framework 2.0</a> must be installed.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.techknight.com/blog/2008/06/06/clrtyp-10-disables-cleartype-when-taking-screenshots/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Digital Comic Viewer part 2</title>
		<link>http://www.techknight.com/blog/2008/05/08/digital-comic-viewer-part-2/</link>
		<comments>http://www.techknight.com/blog/2008/05/08/digital-comic-viewer-part-2/#comments</comments>
		<pubDate>Fri, 09 May 2008 04:34:00 +0000</pubDate>
		<dc:creator>techknight</dc:creator>
				<category><![CDATA[Application Develeopment]]></category>
		<category><![CDATA[comics]]></category>

		<guid isPermaLink="false">http://www.techknight.com/blog/2008/05/08/digital-comic-viewer-part-2/</guid>
		<description><![CDATA[I&#8217;d planned to pay for the feature I wanted in SWF To Image, but it turned out to already exist! There&#8217;s a method called LoadFromBinaryImage that is intended to process FlashMovie objects created by SWF Scout (a commercial SWF generation library), but I can throw my byte array at it like this: (hIssueData is a [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;d planned to pay for the feature I wanted in <a href="http://www.bytescout.com/swftoimage.html">SWF To Image</a>, but it turned out to already exist! There&#8217;s a method called LoadFromBinaryImage that is intended to process FlashMovie objects created by <a href="http://www.bytescout.com/swfscout.html">SWF Scout</a> (a commercial SWF generation library), but I can throw my byte array at it like this: (hIssueData is a hashmap, and imageX_lfile is the byte array for the modified lettering file of a specific page)<br />
<blockquote>object objSwf = hIssueData["image" + x.ToString() + "_lfile"];<br />renderFlash.LoadFromBinaryImage(ref objSwf, &#8220;http://www.google.com&#8221;);</p></blockquote>
<p>For some reason LoadFromBinaryImage requires a non-empty string as second parameter called BaseURL&#8230; I guess it gets used if there are external resources called from the SWF. Anyway, I can then take renderFlash.BinaryImage and pass it through the ImageMagick routines to end up with the final combined image.</p>
<p>The end result is that I&#8217;ve now got a working viewer that writes no assets to disk. However I&#8217;ve still got to do the full-screen mode, keyboard navigation, and a better way of selecting comics before I do a release. Due to <a href="http://www.rockstargames.com/IV/">Grand Theft Auto IV</a> that could mean at least a week. :)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.techknight.com/blog/2008/05/08/digital-comic-viewer-part-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Digital Comic Viewer part 1</title>
		<link>http://www.techknight.com/blog/2008/05/02/digital-comic-viewer-part-1/</link>
		<comments>http://www.techknight.com/blog/2008/05/02/digital-comic-viewer-part-1/#comments</comments>
		<pubDate>Fri, 02 May 2008 06:53:00 +0000</pubDate>
		<dc:creator>techknight</dc:creator>
				<category><![CDATA[Application Develeopment]]></category>
		<category><![CDATA[comics]]></category>

		<guid isPermaLink="false">http://www.techknight.com/blog/2008/05/02/digital-comic-viewer-part-1/</guid>
		<description><![CDATA[I did some preliminary work on Digital Comic Viewer today. Instead of writing files to disk, I&#8217;m able to load them as byte arrays that can be displayed on-screen: So far this only works with pages that don&#8217;t have any Flash text layered on them. As I changed things around I ran into a limitation [...]]]></description>
			<content:encoded><![CDATA[<p>I did some preliminary work on Digital Comic Viewer today. Instead of writing files to disk, I&#8217;m able to load them as byte arrays that can be displayed on-screen:</p>
<p><a href="http://www.techknight.com/blog/wp-content/uploads/2009/02/image106.png"><img title="image" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="228" alt="image" src="http://www.techknight.com/blog/wp-content/uploads/2009/02/image-thumb104.png" width="444" border="0"></a> </p>
<p>So far this only works with pages that don&#8217;t have any Flash text layered on them. As I changed things around I ran into a limitation of the excellent <a href="http://www.bytescout.com/swftoimage.html">SWFToImage library</a>&#8230; Although the final image output can be a byte array instead of a file, the SWF input cannot. That&#8217;s not too surprising, as only crazy people would even have a modified byte array of their SWF to begin with! I sent an email to the SWFToImage author though, so hopefully we can work something out.
<p>Once the basic features are re-implemented without any writes to disk I&#8217;ll release a preliminary version for people to play with. After that will come a proper full-screen viewing mode, and finally a good user interface.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.techknight.com/blog/2008/05/02/digital-comic-viewer-part-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Digital Comic Downloader discontinued</title>
		<link>http://www.techknight.com/blog/2008/04/21/digital-comic-downloader-discontinued/</link>
		<comments>http://www.techknight.com/blog/2008/04/21/digital-comic-downloader-discontinued/#comments</comments>
		<pubDate>Mon, 21 Apr 2008 06:53:00 +0000</pubDate>
		<dc:creator>techknight</dc:creator>
				<category><![CDATA[Application Develeopment]]></category>
		<category><![CDATA[comics]]></category>

		<guid isPermaLink="false">http://www.techknight.com/blog/2008/04/21/digital-comic-downloader-discontinued/</guid>
		<description><![CDATA[Update: 2008-04-25 17:15 I&#8217;ve decided to take down Digital Comic Downloader. I&#8217;m all about digital distribution as where comics need to go, so I&#8217;m afraid of making it less palatable to companies like Marvel (and others in the future) by causing any cold feet&#8230; As I said when I launched DCD, the purpose is not [...]]]></description>
			<content:encoded><![CDATA[<h5>Update: 2008-04-25 17:15</h5>
<p>I&#8217;ve decided to take down Digital Comic Downloader. I&#8217;m all about digital distribution as where comics need to go, so I&#8217;m afraid of making it less palatable to companies like Marvel (and others in the future) by causing any cold feet&#8230; As I said when I launched DCD, the purpose is not piracy but I have to admit that it is capable of enabling it. (It&#8217;s probably a bit unrealistic for me to think that because the images are not perfect that users would never choose to spread them around.)<br />However, I&#8217;m going to start working on a new application able to view comics in a nice full-screen mode, but not able to save files to disk. My hope is that this approach will be viewed as a good balance between user needs and corporate interests.</p>
<h5>Update: 2008-04-24 02:48</h5>
<p>Fixed! I was staring at the logs trying to figure out where the new dynamic &#8220;secret&#8221; value came from when I realized that I was looking at an MD5 hash. After that it was easy to run the viewer SWF file through <a href="http://www.sothink.com/product/flashdecompiler/index.htm">Sothink SWF Decompiler</a> to see how it was generated. They concatenate the issue id, your session id, and a salt value of &#8220;tcbsqudqm23rue4pnvcja86tl4&#8243; with pipes and take the md5sum of that.<br />
<h5>Update: 2008-04-23 10:55</h5>
<p>Broken again. That was pretty fast! I&#8217;ll see what I can do at lunch, otherwise any fix will be later this evening.<br />
<h5>Update: 2008-04-23 02:27</h5>
<p>Fixed! Marvel changed issuedata.php to only return metadata when you POST (not GET) this to it:<br />onLoad=%5Btype%20Function%5D<br />&amp;secret=r586io7qu60mops19em15688j6<br />&amp;session%5Fid=[sessionid]<br />&amp;dc%5Fid=[issueid]<br />Perhaps they will change the value of &#8220;secret&#8221; a lot to make things annoying? Anyway, the download links below have been updated with the new versions. Marvel, you are welcome to download these too. :)<br />
<h5>Update: 2008-04-22 18:55</h5>
<p>Whatever Marvel did on their side seems to have broken their own viewer, too. It works fine in Firefox, but as of today doesn&#8217;t work in Internet Explorer 7 under Windows Vista for me. Anyone else have the same problem? Also they were the first ones to download the DCD source code so there&#8217;s no telling what further changes might be made on their side. If the current avenue becomes impractical I do have some ideas for automated screen captures&#8230; But I&#8217;d rather not go down that road.<br />
<h5>Update: 2008-04-22 13:03</h5>
<p>Broken again. issuedata.php is no longer returning the necessary metadata. If you try it and get a message saying that &#8220;such and such directory exists, do you want to delete it?&#8221;, say no.<br />I won&#8217;t be able to troubleshoot this change until I get home tonight, so I&#8217;ve decided to release the source code.<br />
<h5>Update: 2008-04-21 18:07</h5>
<p>Welcome to anyone coming from this week&#8217;s <a href="http://www.comicbookresources.com/?page=article&amp;id=16123">Lying In The Gutters</a>! Marvel downloaded the new version described below just minutes after it was posted. So if you use it and it stops working suddenly, please be patient while I research a fix. For now though, enjoy! (To be fair, the issue earlier is suspicious but still might&#8217;ve been a coincidence. No one from Marvel has contacted me, so there isn&#8217;t necessarily a conspiracy afoot.)
<p><strong>Update: 2008-04-21 16:52</strong>
<p>Nevermind, it was an easy fix. The MDCU server started rejecting requests from browsers with a blank agent-string. I&#8217;ve set a proper one in the program and the download link below has been updated. I am committed to providing an alternative to Marvel&#8217;s unusable web viewer.<br />
<h5>Update: 2008-04-21 16:42</h5>
<p>Hmm. Someone from a Marvel IP address downloaded DCD this afternoon&#8230; And now it can&#8217;t communicate with the server! I&#8217;ll see what I can do later tonight.<br />
<h5>Original</h5>
<p>I&#8217;m pleased to announce the availability of Digital Comic Downloader 1.0.<br />
<h5>What it is</h5>
<p>If you&#8217;re a subscriber to <a href="http://www.marvel.com/digitalcomics/">Marvel Digital Comics Unlimited</a>, you know how awful the official web viewer is. It displays pages, sure, but it is basically useless for reading. Digital Comic Downloader brings the selected comic down to your hard drive, allowing you to choose which viewing software to use. This makes reading issues a pleasant experience, letting you make the most of your subscription. It can even combine the separate text and art layers of newer comics into flat files!<br />
<h5>What it is not</h5>
<p>Digital Comic Downloader is not meant for piracy. The issues that you download should be the ones that you&#8217;re actually about to read (and later delete). Marvel has been very kind in not using encryption or DRM and that needs to be respected.
<p>Further, the downloads produced are <a href="http://www.techknight.com/blog/2008/04/17/image-manipulation-progress/">not perfect copies</a>, so even if you had a mind to infringe copyright, what you&#8217;ve got is useless for archiving&#8230; But great for reading.<br />
<h5>Screenshot</h5>
<p><a href="http://www.techknight.com/blog/wp-content/uploads/2009/02/image103.png"><img title="image" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="203" alt="image" src="http://www.techknight.com/blog/wp-content/uploads/2009/02/image-thumb101.png" width="444" border="0"></a> </p>
<h5>Requirements</h5>
<ul>
<li>An active, paid <a href="http://www.marvel.com/digitalcomics/">Marvel Digital Comics Unlimited</a> subscription</li>
<li>Windows 2000/XP/Vista (only tested on Vista so far)</li>
<li>Microsoft <a href="http://msdn.microsoft.com/netframework/downloads/">.NET Framework 3.5</a></li>
<li><a href="http://www.adobe.com/products/flashplayer/">Adobe Flash</a> plug-in</li>
<li>A standalone comic reader like <a href="http://www.geocities.com/davidayton/CDisplay.html">CDisplay</a> or any other image-viewing application</li>
</ul>
<h5>Download</h5>
<p>Downloads are disabled. Thanks for everyone&#8217;s support!</p>
<h5>Hot to use</h5>
<p><em>This is early, <u>unsupported</u> software. Only rudimentary error-checking exists.</em> However: Once you&#8217;ve installed the program and any prerequisites, click on the Digital Comic Downloader entry in your Start Menu to begin. The fields should mostly be self-explanatory&#8230; Fill them in and click Download and you&#8217;re off to the races.
<p>One thing that might might confuse is the &#8220;Issue ID&#8221; field. To find this number, access the Marvel Digital Comics Unlimited <a href="http://www.marvel.com/digitalcomics/hq">catalogue</a> as normal. When you pick something you want to read, mouse over the &#8220;OPEN&#8221; button and look at your web browser&#8217;s status bar:
<p><a href="http://www.techknight.com/blog/wp-content/uploads/2009/02/image104.png"><img title="image" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="162" alt="image" src="http://www.techknight.com/blog/wp-content/uploads/2009/02/image-thumb102.png" width="444" border="0"></a>
<p>As you can see in the screenshot, Astonishing X-Men #9 is Issue ID number 1454. Use that when filling out the fields in DCD.<br />
<h5>Feedback</h5>
<p>Please leave feedback with any problems you encounter and any ideas you have for further development.
<p>Here are features that I already plan to implement, so don&#8217;t worry about suggesting them:
<ul>
<li>Auto-compress the download folder into a zip/cbz. Probably in the next version. No rar/cbr support though, because there aren&#8217;t any free libraries for creating rar archives. (only for decompressing them)</li>
<li>Proxy support (at the moment it uses whatever Internet Explorer is set to&#8230; I think)</li>
<li>Store the metadata that Marvel provides. There&#8217;s all sorts of information like whether a page is a double spread, an advertisement, what year the series started, etc&#8230; This could be useful for future comic reading software.</li>
<li>There <em>will not</em> be a full-series download function. I don&#8217;t want to position this application as anything but a &#8220;hey, I want to read this issue but the official viewer sucks&#8221; sort of helper. So don&#8217;t ask, thanks!</li>
</ul>
<h5>Credits</h5>
<p>SWFToImage library by ByteScout, from:<br /> <a href="http://www.bytescout.com/swftoimage.html">http://www.bytescout.com/swftoimage.html</a></p>
<p>MagickNet library by ?, from:<br /><a href="http://midimick.com/magicknet/">http://midimick.com/magicknet/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.techknight.com/blog/2008/04/21/digital-comic-downloader-discontinued/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Image manipulation progress</title>
		<link>http://www.techknight.com/blog/2008/04/17/image-manipulation-progress/</link>
		<comments>http://www.techknight.com/blog/2008/04/17/image-manipulation-progress/#comments</comments>
		<pubDate>Fri, 18 Apr 2008 03:57:00 +0000</pubDate>
		<dc:creator>techknight</dc:creator>
				<category><![CDATA[Application Develeopment]]></category>
		<category><![CDATA[comics]]></category>

		<guid isPermaLink="false">http://www.techknight.com/blog/2008/04/17/image-manipulation-progress/</guid>
		<description><![CDATA[Some progress on the comic downloader. I&#8217;ve got programmatic image manipulation largely done. The process is basically this: Render the SWF text layer at twice the size of the JPG background layer, then make it transparent and scale down to fit. (That makes the output quality a bit better.) To test things out I used [...]]]></description>
			<content:encoded><![CDATA[<p>Some progress on the comic downloader.</p>
<p>I&#8217;ve got programmatic image manipulation largely done. The process is basically this: Render the SWF text layer at twice the size of the JPG background layer, then make it transparent and scale down to fit. (That makes the output quality a bit better.)</p>
<p>To test things out I used the command-line <a href="http://www.imagemagick.org/script/index.php">ImageMagick</a> tools:</p>
<blockquote><p>convert -fuzz 115 foreground.png -transparent &#8220;#ff00ff&#8221; -resize 1000&#215;1500 foreground-transparent.png<br />composite foreground-transparent.png background.jpg final.png</p>
</blockquote>
<p>Then I added the <a href="http://midimick.com/magicknet/">MagickNet</a> DLL (a .NET wrapper for the ImageMagick libraries) to my project and rewrote the steps in C#:</p>
<blockquote><p>MagickNet.Magick.Init();<br />MagickNet.Image imgForeground = new MagickNet.Image(Application.StartupPath + @&#8221;\foreground.png&#8221;);<br />imgForeground.ColorFuzz = 115;<br />MagickNet.Color imgColour = new MagickNet.Color(255, 0, 255);<br />imgForeground.Transparent(imgColour);<br />Size imgSize = new System.Drawing.Size(1000, 1500);<br />imgForeground.Resize(imgSize);<br />imgForeground.Write(Application.StartupPath + @&#8221;\foreground-transparent.png&#8221;);<br />MagickNet.Image imgBackground = new MagickNet.Image(Application.StartupPath + @&#8221;\background.jpg&#8221;);<br />MagickNet.Image imgForegroundTransparent = new MagickNet.Image(Application.StartupPath + @&#8221;\foreground-transparent.png&#8221;);<br />imgBackground.Composite(imgForegroundTransparent,0,0,CompositeOperator.AtopCompositeOp);<br />imgBackground.Write(Application.StartupPath + @&#8221;\final.png&#8221;);<br />MagickNet.Magick.Term();</p>
</blockquote>
<p>Much to my surprise, it worked! Here&#8217;s what the input and output images look like:</p>
<p>Foreground</p>
<p><a href="http://www.techknight.com/blog/wp-content/uploads/2009/02/image99.png"><img title="image" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="260" alt="image" src="http://www.techknight.com/blog/wp-content/uploads/2009/02/image-thumb97.png" width="304" border="0"></a> </p>
<p>Transparent foreground (note: some browsers can&#8217;t render transparent PNG files correctly)</p>
<p><a href="http://www.techknight.com/blog/wp-content/uploads/2009/02/foregroundtransparent.png"><img title="foreground-transparent" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="260" alt="foreground-transparent" src="http://www.techknight.com/blog/wp-content/uploads/2009/02/foregroundtransparent-thumb.png" width="304" border="0"></a> </p>
<p>Background</p>
<p><a href="http://www.techknight.com/blog/wp-content/uploads/2009/02/image100.png"><img title="image" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="260" alt="image" src="http://www.techknight.com/blog/wp-content/uploads/2009/02/image-thumb98.png" width="304" border="0"></a> </p>
<p>Final</p>
<p><a href="http://www.techknight.com/blog/wp-content/uploads/2009/02/image101.png"><img title="image" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="260" alt="image" src="http://www.techknight.com/blog/wp-content/uploads/2009/02/image-thumb99.png" width="304" border="0"></a> </p>
<p>It&#8217;s not perfect, because if you zoom in 1200% you can see some purple left on the edges of the speech balloons:</p>
<p><a href="http://www.techknight.com/blog/wp-content/uploads/2009/02/image102.png"><img title="image" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="218" alt="image" src="http://www.techknight.com/blog/wp-content/uploads/2009/02/image-thumb100.png" width="304" border="0"></a> </p>
<p>However the goal is not in creating pristine archive copies for hoarding, but temporary copies for convenient reading. So it&#8217;s fine. :)</p>
<p>Next up is to see if I can replicate the full <a href="http://www.marvel.com/digitalcomics/">MDCU</a> login process. The current method involves: logging in normally, opening a comic, then viewing the HTML source of the page to get the session id and issue id, then pasting those into my program. Not terribly convenient.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.techknight.com/blog/2008/04/17/image-manipulation-progress/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>More about the comic download tool</title>
		<link>http://www.techknight.com/blog/2008/04/13/more-about-the-comic-download-tool/</link>
		<comments>http://www.techknight.com/blog/2008/04/13/more-about-the-comic-download-tool/#comments</comments>
		<pubDate>Sun, 13 Apr 2008 11:18:00 +0000</pubDate>
		<dc:creator>techknight</dc:creator>
				<category><![CDATA[Application Develeopment]]></category>
		<category><![CDATA[comics]]></category>

		<guid isPermaLink="false">http://www.techknight.com/blog/2008/04/13/more-about-the-comic-download-tool/</guid>
		<description><![CDATA[I expected to release a downloading tool for Marvel Digital Comics Unlimited at the end of last week but ran into some last-minute troubles. The comics online at MCDU exist in two different formats: Older issues that appear to have been scanned from paper, and newer issues that appear to have come directly from a [...]]]></description>
			<content:encoded><![CDATA[<p>I expected to release a downloading tool for <a href="http://www.marvel.com/digitalcomics/">Marvel Digital Comics Unlimited</a> at the end of last week but ran into some last-minute troubles.
<p>The comics online at MCDU exist in two different formats: Older issues that appear to have been scanned from paper, and newer issues that appear to have come directly from a digital workflow. The old ones are plain JPG files that are easy enough to use in a third-party application. The new ones however, are JPG files of background art with SWF files containing speech balloons layered on top.
<p>To convert the SWF text layer into an image I&#8217;ve been using <a href="http://bytescout.com/">ByteScout</a>&#8216;s <a href="http://bytescout.com/swftoimage.html">SWF To Image library</a>. It&#8217;s a decent, free tool but there have been some hiccups. The text SWF files have an overall movie background colour of white, or #FFFFFF. So if you convert them as-is, you get white speech balloons on top of a white background:
<p><a href="http://www.techknight.com/blog/wp-content/uploads/2009/02/image95.png"><img title="image" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="174" alt="image" src="http://www.techknight.com/blog/wp-content/uploads/2009/02/image-thumb93.png" width="341" border="0"></a>
<p>That&#8217;s no good, because if you deleted all of the white and put it on top of the background you&#8217;d have this:
<p><a href="http://www.techknight.com/blog/wp-content/uploads/2009/02/image96.png"><img title="image" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="174" alt="image" src="http://www.techknight.com/blog/wp-content/uploads/2009/02/image-thumb94.png" width="341" border="0"></a>
<p>So as a solution I tried creating my own SWF that would load the JPG and text SWF in layers and then convert all that into a single image. It worked&#8230; Sort of. SWF To Image executes and captures an image too quickly for the loadMovie commands in my custom SWF to finish loading Marvel&#8217;s SWF and JPG. The only time it worked was when I used an example VBScript with a MsgBox prompt as an interruption, or in my actual program by writing the final image to disk several times in a row. That&#8217;s not a hack I&#8217;m willing to live with.
<p>I messed around with various ways of loading content in Flash with events that determine whether or not the content has finished loading but in the end I couldn&#8217;t reliably render the correct final image. For a different approach I looked into the SWF format itself. <a href="http://www.m2osw.com/en/swf_alexref.html#tag_setbackgroundcolor">This reference</a> to the SetBackgroundColor command being an RGB value set in every movie got me thinking&#8230; If I altered the downloaded SWF files to use a different background colour, it could easily be replaced.
<p>By changing this series of bytes &#8220;43 02 FF FF FF&#8221; in the header of the text SWF to &#8220;43 02 FF 00 FF&#8221;, I&#8217;m left with exactly what I need:</p>
<p><a href="http://www.techknight.com/blog/wp-content/uploads/2009/02/image97.png"><img title="image" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="174" alt="image" src="http://www.techknight.com/blog/wp-content/uploads/2009/02/image-thumb95.png" width="341" border="0"></a> </p>
<p>Now that the background isn&#8217;t white, purple is deleted instead, leaving this on top of the background:</p>
<p><a href="http://www.techknight.com/blog/wp-content/uploads/2009/02/image98.png"><img title="image" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="174" alt="image" src="http://www.techknight.com/blog/wp-content/uploads/2009/02/image-thumb96.png" width="341" border="0"></a> </p>
<p>However this new method has not been done programmatically yet. (Only with a hex editor, some screenshots, and Photoshop.) There won&#8217;t be an issue replacing bytes representing the background colour, but going on to cleanly remove that new purple background may require some fine-tuning.
<p>More to come&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.techknight.com/blog/2008/04/13/more-about-the-comic-download-tool/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

