<?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>Software Warlock &#187; Graphics</title>
	<atom:link href="http://softwareblog.morlok.net/tag/graphics/feed/" rel="self" type="application/rss+xml" />
	<link>http://softwareblog.morlok.net</link>
	<description></description>
	<lastBuildDate>Sat, 24 Dec 2011 16:06:59 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1</generator>
		<item>
		<title>Cocoa LCD Screen View</title>
		<link>http://softwareblog.morlok.net/2009/05/25/cocoa-lcd-screen-view/</link>
		<comments>http://softwareblog.morlok.net/2009/05/25/cocoa-lcd-screen-view/#comments</comments>
		<pubDate>Tue, 26 May 2009 00:57:14 +0000</pubDate>
		<dc:creator>Warlock</dc:creator>
				<category><![CDATA[Cocoa]]></category>
		<category><![CDATA[Core Graphics]]></category>
		<category><![CDATA[Graphics]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[Quartz 2D]]></category>

		<guid isPermaLink="false">http://softwareblog.morlok.net/?p=242</guid>
		<description><![CDATA[As part of an iPhone application I&#8217;m developing, I need a view that will display numbers/times in a way that will look like an old liquid crystal display calculator. I looked around at using various fonts to cover the same &#8230;<p class="read-more"><a href="http://softwareblog.morlok.net/2009/05/25/cocoa-lcd-screen-view/">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<p>
As part of an iPhone application I&#8217;m developing, I need a view that will display numbers/times in a way that will look like an old liquid crystal display calculator.  I looked around at using various fonts to cover the same effect, but I wanted the look where you could slightly see the non-lit components of the display.  As such, I delved into the mystical world of Quartz 2D.
</p>
<div id="attachment_243" class="wp-caption aligncenter" style="width: 310px"><a href="http://softwareblog.morlok.net/wp-content/uploads/2009/05/picture-3.png"><img src="http://softwareblog.morlok.net/wp-content/uploads/2009/05/picture-3-300x105.png" alt="Example of the LCD view showing the current time." title="Screenshot of LCD View" width="300" height="105" class="size-medium wp-image-243" /></a><p class="wp-caption-text">Example of the LCD view showing the current time.</p></div>
<p><tt>MTILcdView</tt> allows you to set three parameters: the color for the &#8220;lit&#8221; crystals, the color for the &#8220;dim&#8221; crystals, and the text to be displayed.   The view currently only supports displaying numbers plus the colon (&#8220;:&#8221;) per my needs, but it could easily be extended to display letters as well.  The view decides the size of the digits to be displayed based on the height of the view, so for a given height you must adjust the width of the view to allow the needed number of characters to be displayed.</p>
<p>The source code for the Mac is available here: <a href="http://softwareblog.morlok.net/wp-content/uploads/2009/05/mtilcdview.h">MTILcdView.h</a>, <a href="http://softwareblog.morlok.net/wp-content/uploads/2009/05/mtilcdview.m">MTILcdView.m</a>.  A complete demo application using the view can be retrieved from GitHub <a href="https://github.com/rmorlok/LcdScreen/tree">here</a>.</p>
<div id="attachment_259" class="wp-caption aligncenter" style="width: 310px"><a href="http://softwareblog.morlok.net/wp-content/uploads/2009/05/picture-1.png"><img src="http://softwareblog.morlok.net/wp-content/uploads/2009/05/picture-1-300x161.png" alt="MTILcdView running on iPhone" title="iPhone LCD View" width="300" height="161" class="size-medium wp-image-259" /></a><p class="wp-caption-text">MTILcdView running on iPhone</p></div>
<p>The source code for the iPhone 3.0 SDK is available here: <a href="http://softwareblog.morlok.net/wp-content/uploads/2009/05/mtilcdview1.h">MTILcdView.h</a>, <a href="http://softwareblog.morlok.net/wp-content/uploads/2009/05/mtilcdview1.m">MTILcdView.m</a> (note that you must manually rename the files from MTILcdView1.{h|m} to MTILcdView.{h|m}).  A complete demo application using the view can be retrieved from GitHub <a href="https://github.com/rmorlok/LcdiPhone/tree">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://softwareblog.morlok.net/2009/05/25/cocoa-lcd-screen-view/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

