<?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>Codec &#187; background</title>
	<atom:link href="http://www.trembl.org/codec/tag/background/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.trembl.org/codec</link>
	<description>A Personal Polylogic Code/Decode &#039;Zettelkasten&#039;</description>
	<lastBuildDate>Thu, 02 Feb 2012 03:38:01 +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>Transparent Background of Custom Drawing Class</title>
		<link>http://www.trembl.org/codec/361/</link>
		<comments>http://www.trembl.org/codec/361/#comments</comments>
		<pubDate>Mon, 25 Jan 2010 07:38:19 +0000</pubDate>
		<dc:creator>Georg Tremmel</dc:creator>
				<category><![CDATA[Raw]]></category>
		<category><![CDATA[alpha]]></category>
		<category><![CDATA[background]]></category>
		<category><![CDATA[opaque]]></category>
		<category><![CDATA[transparent]]></category>
		<category><![CDATA[UIView]]></category>

		<guid isPermaLink="false">http://www.trembl.org/codec/?p=361</guid>
		<description><![CDATA[Usually common problems already have simple solution. Like that one: Problem You subclassed UIView, you want to do some custom drawing in drawRect, but no matter what you do or where you draw, the background of the view remains black. - &#40;void&#41;drawRect:&#40;CGRect&#41;rect &#123; // Drawing code CGContextRef context = UIGraphicsGetCurrentContext&#40;&#41;; CGContextSetRGBFillColor&#40;context, 0.0, 0.0, 1.0, 1.0&#41;; [...]]]></description>
			<content:encoded><![CDATA[<p>Usually common problems already have simple solution. Like that one:</p>
<p><strong>Problem</strong><br />
You subclassed UIView, you want to do some custom drawing in drawRect, but no matter what you do or where you draw, the background of the view remains black.</p>

<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;"><span style="color: #002200;">-</span> <span style="color: #002200;">&#40;</span><span style="color: #a61390;">void</span><span style="color: #002200;">&#41;</span>drawRect<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span>CGRect<span style="color: #002200;">&#41;</span>rect <span style="color: #002200;">&#123;</span>
 <span style="color: #11740a; font-style: italic;">// Drawing code</span>
 CGContextRef context <span style="color: #002200;">=</span> UIGraphicsGetCurrentContext<span style="color: #002200;">&#40;</span><span style="color: #002200;">&#41;</span>;
 CGContextSetRGBFillColor<span style="color: #002200;">&#40;</span>context, <span style="color: #2400d9;">0.0</span>, <span style="color: #2400d9;">0.0</span>, <span style="color: #2400d9;">1.0</span>, <span style="color: #2400d9;">1.0</span><span style="color: #002200;">&#41;</span>;
 CGContextFillEllipseInRect<span style="color: #002200;">&#40;</span>context, rect<span style="color: #002200;">&#41;</span>;
<span style="color: #002200;">&#125;</span></pre></div></div>

<p><strong>Solution</strong><br />
In the ViewController, which call the drawing class, add</p>

<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;">myDrawingClass.opaque <span style="color: #002200;">=</span> <span style="color: #a61390;">NO</span>;</pre></div></div>

<p>- or even nicer. In the drawing class&#8217; init function:</p>

<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;">self.opaque <span style="color: #002200;">=</span> <span style="color: #a61390;">NO</span>;</pre></div></div>

<p><del datetime="2010-01-25T07:38:22+00:00"><strong>And not like that</strong><br />
- adding &#8220;self.opaque = NO;&#8221; in the drawRect: function<br />
- CGContextClearRect(context, rect);<br />
- CGContextSetAlpha(context, 0.5f);</del></p>
]]></content:encoded>
			<wfw:commentRss>http://www.trembl.org/codec/361/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Curling Images at Twitter</title>
		<link>http://www.trembl.org/codec/175/</link>
		<comments>http://www.trembl.org/codec/175/#comments</comments>
		<pubDate>Mon, 05 Oct 2009 08:15:18 +0000</pubDate>
		<dc:creator>Georg Tremmel</dc:creator>
				<category><![CDATA[Raw]]></category>
		<category><![CDATA[background]]></category>
		<category><![CDATA[curl]]></category>
		<category><![CDATA[image]]></category>
		<category><![CDATA[max]]></category>
		<category><![CDATA[msp]]></category>
		<category><![CDATA[twitter]]></category>
		<category><![CDATA[update]]></category>

		<guid isPermaLink="false">http://www.trembl.org/codec/?p=175</guid>
		<description><![CDATA[curl -F &#8216;image=@test.png;type=image/png&#8217; -H &#8216;Expect:&#8217; -u username:password http://twitter.com/account/update_profile_background_image.xml hmm nice. the logical thing to do. instead of text messages, send images&#8230; update: turning tiling on. curl -F &#8216;image=@test.png;type=image/png&#8217; -F &#8217;tile=true&#8217; -H &#8216;Expect:&#8217; -u username:password http://twitter.com/account/update_profile_background_image.xml second -F flag creates second form field. update: same applies to user profile image curl -F &#8216;image=@icon.png;type=image/png&#8217; -H &#8216;Expect:&#8217; -u [...]]]></description>
			<content:encoded><![CDATA[<p>curl -F &#8216;image=@test.png;type=image/png&#8217; -H &#8216;Expect:&#8217; -u username:password http://twitter.com/account/update_profile_background_image.xml</p>
<p>hmm nice.</p>
<p>the logical thing to do.</p>
<p>instead of text messages, send images&#8230;</p>
<p><em>update</em>: turning tiling on.<br />
curl -F &#8216;image=@test.png;type=image/png&#8217; -<strong>F &#8217;tile=true&#8217;</strong> -H &#8216;Expect:&#8217; -u username:password http://twitter.com/account/update_profile_background_image.xml</p>
<p>second -F flag creates second form field.</p>
<p><em>update</em>: same applies to user profile image<br />
curl -F &#8216;image=@icon.png;type=image/png&#8217; -H &#8216;Expect:&#8217; -u username:password http://twitter.com/account/update_profile_image.xml</p>
<p><em>update</em>: absolute image paths<br />
curl -F &#8216;image=@<strong>/Users/x/Desktop/</strong>icon.png;type=image/png&#8217; -H &#8216;Expect:&#8217; -u username:password http://twitter.com/account/update_profile_image.xml</p>
<p>there seems to be a bug in the max <em>shell</em> object, preventing <em>cd</em> to work. it also does not like relative paths (~)&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.trembl.org/codec/175/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Transparent Background in Safari 4.0</title>
		<link>http://www.trembl.org/codec/442/</link>
		<comments>http://www.trembl.org/codec/442/#comments</comments>
		<pubDate>Tue, 23 Jun 2009 11:19:31 +0000</pubDate>
		<dc:creator>Georg Tremmel</dc:creator>
				<category><![CDATA[Raw]]></category>
		<category><![CDATA[background]]></category>
		<category><![CDATA[osx]]></category>
		<category><![CDATA[Safari]]></category>
		<category><![CDATA[transparent]]></category>

		<guid isPermaLink="false">http://www.trembl.org/codec/?p=442</guid>
		<description><![CDATA[http://127.0.0.1/transparent/ Enable Debug Menu in Safari 4.0: defaults write com.apple.Safari IncludeInternalDebugMenu 1 via http://trac.webkit.org/wiki/WebDevelopers Also, an interesing option is to modify the .nib file of Safari and insert a new menu: http://pointum.com/safari-tweaks.html]]></description>
			<content:encoded><![CDATA[<p><a href="http://">http://127.0.0.1/transparent/</a></p>
<p>Enable Debug Menu in Safari 4.0:</p>
<p><code>defaults write com.apple.Safari IncludeInternalDebugMenu 1</code></p>
<p>via <a href="http://trac.webkit.org/wiki/WebDevelopers">http://trac.webkit.org/wiki/WebDevelopers</a></p>
<p>Also, an interesing option is to modify the .nib file of Safari and insert a new menu:<br />
<a href="http://pointum.com/safari-tweaks.html">http://pointum.com/safari-tweaks.html</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.trembl.org/codec/442/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Perform method in Background</title>
		<link>http://www.trembl.org/codec/37/</link>
		<comments>http://www.trembl.org/codec/37/#comments</comments>
		<pubDate>Fri, 27 Feb 2009 05:14:37 +0000</pubDate>
		<dc:creator>Georg Tremmel</dc:creator>
				<category><![CDATA[Raw]]></category>
		<category><![CDATA[autorelease]]></category>
		<category><![CDATA[background]]></category>
		<category><![CDATA[concurrent]]></category>
		<category><![CDATA[multithread]]></category>
		<category><![CDATA[selector]]></category>
		<category><![CDATA[thread]]></category>

		<guid isPermaLink="false">http://www.trembl.org/codec/?p=37</guid>
		<description><![CDATA[[self performSelectorInBackground:@selector(method) withObject:nil]; &#038; wrap method in autorelease pool. maybe also of interest: http://code.google.com/p/plactorkit/ Dictated but not read.]]></description>
			<content:encoded><![CDATA[<p>[self performSelectorInBackground:@selector(method) withObject:nil];</p>
<p>&#038; wrap method in autorelease pool.</p>
<p>maybe also of interest:<br />
<a href="http://code.google.com/p/plactorkit/">http://code.google.com/p/plactorkit/</a> Dictated but not read.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.trembl.org/codec/37/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

