<?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>Confessions of a Keytarist &#187; Tricks</title>
	<atom:link href="http://www.blog.ianmellor.co.uk/tag/tricks/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.blog.ianmellor.co.uk</link>
	<description>Only an idiot blames his fools... tools.. damn keyboard</description>
	<lastBuildDate>Fri, 09 Jul 2010 14:03:00 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Finding Top Gear</title>
		<link>http://www.blog.ianmellor.co.uk/2010/07/09/finding-top-gear/</link>
		<comments>http://www.blog.ianmellor.co.uk/2010/07/09/finding-top-gear/#comments</comments>
		<pubDate>Fri, 09 Jul 2010 14:03:00 +0000</pubDate>
		<dc:creator>Sk93</dc:creator>
				<category><![CDATA[Cars]]></category>
		<category><![CDATA[Photoshop]]></category>
		<category><![CDATA[BMW]]></category>
		<category><![CDATA[Car]]></category>
		<category><![CDATA[Digital]]></category>
		<category><![CDATA[Photography]]></category>
		<category><![CDATA[Tricks]]></category>
		<category><![CDATA[Z4]]></category>

		<guid isPermaLink="false">http://www.blog.ianmellor.co.uk/2010/07/09/finding-top-gear/</guid>
		<description><![CDATA[Recently, I’ve been taking quite a few car photographs, and although I was pleased with the overall quality of the shots, they didn’t seem to “blast” of the page like those in the glossy mags.   After a bit of studying perhaps the most famous of them all, Top Gear, I decided to see [...]]]></description>
			<content:encoded><![CDATA[<p>Recently, I’ve been taking quite a few car photographs, and although I was pleased with the overall quality of the shots, they didn’t seem to “blast” of the page like those in the glossy mags.   <br />After a bit of studying perhaps the most famous of them all, Top Gear, I decided to see if I could replicate the processing done on their images with mine.</p>
<p>I played around in Photoshop for quite a bit before settling on the process I describe below. I’m pretty pleased with the outcome, so I thought it worthy of inclusion on this blog. Hopefully some of you will find it useful too!</p>
<p> <span id="more-133"></span>
<p>Ok.. So first we need an image to work with. I’m going to use this one I took of a friend’s BMW Z4:   <br /><a href="http://www.blog.ianmellor.co.uk/wp-content/uploads/2010/07/topgear1.jpg"><img style="border-bottom: 0px; border-left: 0px; display: block; float: none; margin-left: auto; border-top: 0px; margin-right: auto; border-right: 0px" title="topgear-1" border="0" alt="topgear-1" src="http://www.blog.ianmellor.co.uk/wp-content/uploads/2010/07/topgear1_thumb.jpg" width="260" height="166" /></a></p>
<p>With the image open, the first step is to increase the midtones of the image.   <br />This gives a more “fluid” look to the car and provide a better base for the alterations we will be making later on.    <br />To do this, select the “Layer-&gt;New Adjustment Layer-&gt;Curves” menu option and then alter the curve so that the midtones are increased, as below:</p>
<p><a href="http://www.blog.ianmellor.co.uk/wp-content/uploads/2010/07/topgear2.png"><img style="border-bottom: 0px; border-left: 0px; display: block; float: none; margin-left: auto; border-top: 0px; margin-right: auto; border-right: 0px" title="topgear-2" border="0" alt="topgear-2" src="http://www.blog.ianmellor.co.uk/wp-content/uploads/2010/07/topgear2_thumb.png" width="144" height="240" /></a>&#160; </p>
<p>Now we need to fade out some of the colour in the image, and we do that by adding a new black “Fill” layer.    <br />To do this, select the “Layer-&gt;New Fill Layer-&gt;Solid Colour” menu.     <br />On the “New Layer” dialog that will appear, name the layer “Black Fill”, select “Hue” from the “Mode” dropdown box and set the “Opacity” to 40%, as shown below:</p>
<p><a href="http://www.blog.ianmellor.co.uk/wp-content/uploads/2010/07/topgear4.png"><img style="border-bottom: 0px; border-left: 0px; display: block; float: none; margin-left: auto; border-top: 0px; margin-right: auto; border-right: 0px" title="topgear-4" border="0" alt="topgear-4" src="http://www.blog.ianmellor.co.uk/wp-content/uploads/2010/07/topgear4_thumb.png" width="240" height="85" /></a> </p>
<p>Click “OK”, and then select true black (0,0,0) as the solid colour when prompted. Your image should now appear slightly less colourful than when we started, but don’t panic – that’s normal and intended!   </p>
<p>Next we need to flatten the image (Select the “Layer-&gt;Flatten Image” menu), and then switch over to “Lab Colour” mode, which we do by selecting the “Image-&gt;Mode-&gt;Lab Color” menu option.</p>
<p>Once in Lab Colour mode, click on the “Channels” window (or select “Channels” from the “Windows” menu list), then click on the “Lightness” channel to select just it.</p>
<p><a href="http://www.blog.ianmellor.co.uk/wp-content/uploads/2010/07/topgear5.png"><img style="border-bottom: 0px; border-left: 0px; display: block; float: none; margin-left: auto; border-top: 0px; margin-right: auto; border-right: 0px" title="topgear-5" border="0" alt="topgear-5" src="http://www.blog.ianmellor.co.uk/wp-content/uploads/2010/07/topgear5_thumb.png" width="244" height="114" /></a> </p>
<p>Click the “Filters-&gt;Sharpen-&gt;Unsharp Mask…” menu, and set the “Amount” and “Radius” values to 50, leaving the “Threshold” value set to 0 (zero), as shown below, then click “OK”.</p>
<p><a href="http://www.blog.ianmellor.co.uk/wp-content/uploads/2010/07/topgear6.png"><img style="border-bottom: 0px; border-left: 0px; display: block; float: none; margin-left: auto; border-top: 0px; margin-right: auto; border-right: 0px" title="topgear-6" border="0" alt="topgear-6" src="http://www.blog.ianmellor.co.uk/wp-content/uploads/2010/07/topgear6_thumb.png" width="189" height="244" /></a> </p>
</p>
</p>
</p>
<p>Time to move back to RGB mode, so first select the “Lab” channel, then click the “Image-&gt;Mode-&gt;RGB Color” menu option. We should now be seeing a nice sharp image of the car with quite crisp and clean colours, with any reflections on the paint or windows showing much clearer:</p>
<p><a href="http://www.blog.ianmellor.co.uk/wp-content/uploads/2010/07/topgear7.png"><img style="border-bottom: 0px; border-left: 0px; display: block; float: none; margin-left: auto; border-top: 0px; margin-right: auto; border-right: 0px" title="topgear-7" border="0" alt="topgear-7" src="http://www.blog.ianmellor.co.uk/wp-content/uploads/2010/07/topgear7_thumb.png" width="260" height="165" /></a> </p>
<p>Our image is beginning to take on that <em>Top Gear </em>feel, but we’ve one or two things left to do to make it that bit more special.</p>
<p>One of those things is to add a colour gradient, by clicking on the “Layer-&gt;New Fill Layer-&gt;Gradient…” menu option. Change the “Mode” dropdown value to “Overlay”, then click OK on the “New Layer” dialog.   <br />In the “Gradient Fill” dialog window that appears next, we want to tick the “Reverse” checkbox, then click on the gradient box to set our own colours.<em>(you need to click the coloured gradient, not the down arrow next to it)</em></p>
<p><a href="http://www.blog.ianmellor.co.uk/wp-content/uploads/2010/07/topgear8.png"><img style="border-bottom: 0px; border-left: 0px; display: block; float: none; margin-left: auto; border-top: 0px; margin-right: auto; border-right: 0px" title="topgear-8" border="0" alt="topgear-8" src="http://www.blog.ianmellor.co.uk/wp-content/uploads/2010/07/topgear8_thumb.png" width="244" height="173" /></a>&#160;</p>
<p>This will open the “Gradient Editor”, with the default “foreground to transparent” gradient already loaded.   <br />First of all, click the “New” button to ensure we don’t mess up any presets, then change both the start and end colours to a nice blood red; Click on the two sliders that appear below the gradient bar and choose a medium-dark red.    <br /><em>(If you’re unsure, they are the two sliders that appear blood-red in the image below)</em></p>
<p><a href="http://www.blog.ianmellor.co.uk/wp-content/uploads/2010/07/topgear9.png"><img style="border-bottom: 0px; border-left: 0px; display: block; float: none; margin-left: auto; border-top: 0px; margin-right: auto; border-right: 0px" title="topgear-9" border="0" alt="topgear-9" src="http://www.blog.ianmellor.co.uk/wp-content/uploads/2010/07/topgear9_thumb.png" width="214" height="244" /></a> </p>
<p>Once you’re happy with the gradient, click OK to add it to the image.   </p>
<p> <a href="http://www.blog.ianmellor.co.uk/wp-content/uploads/2010/07/topgear10.png"><img style="border-bottom: 0px; border-left: 0px; display: block; float: none; margin-left: auto; border-top: 0px; margin-right: auto; border-right: 0px" title="topgear-10" border="0" alt="topgear-10" src="http://www.blog.ianmellor.co.uk/wp-content/uploads/2010/07/topgear10_thumb.png" width="260" height="164" /></a>
</p>
<p>Nearly there! Next we need to add the <em>Top Gear</em> Vignette to the image.    <br />To do this, first ensure the “Background” layer is selected, then choose the elliptical marquee tool and, using the rulers for reference (CTRL+R), select from one “tick” in at the top left corner, to one “tick” in at the bottom right corner, as shown below:</p>
<p><a href="http://www.blog.ianmellor.co.uk/wp-content/uploads/2010/07/topgear11.jpg"><img style="border-bottom: 0px; border-left: 0px; display: block; float: none; margin-left: auto; border-top: 0px; margin-right: auto; border-right: 0px" title="topgear-11" border="0" alt="topgear-11" src="http://www.blog.ianmellor.co.uk/wp-content/uploads/2010/07/topgear11_thumb.jpg" width="260" height="166" /></a></p>
<p>Next, invert the selection (“Select-&gt;Inverse” menu option) and then feather it by 250 pixels (“Select-&gt;Modify-&gt;Feather…”) so that we are only selecting the outside edges of the photo.   <br />Finally, select the “Image-&gt;Adjustments-&gt;Levels” menu and move the midtones slider to the right, until you get a nice level of vignette around the outside of the image. <em>(The exact amount varies with each image, so play around until you find a value that suits your image.)</em></p>
<p><a href="http://www.blog.ianmellor.co.uk/wp-content/uploads/2010/07/topgear12.jpg"><img style="border-bottom: 0px; border-left: 0px; display: block; float: none; margin-left: auto; border-top: 0px; margin-right: auto; border-right: 0px" title="topgear-12" border="0" alt="topgear-12" src="http://www.blog.ianmellor.co.uk/wp-content/uploads/2010/07/topgear12_thumb.jpg" width="260" height="166" /></a> </p>
<p>The final step is to increase the polarisation effect within the image, which will boost the detail and reflections on the car. To do this, we will be using the shadows and highlights adjustment tool. Select the “Image-&gt;Adjustments-&gt;Shadows/Highlights…” menu, then set both “Amount” and “Tonal Width” to 40%, then click OK</p>
<p><a href="http://www.blog.ianmellor.co.uk/wp-content/uploads/2010/07/topgear13.jpg"><img style="border-bottom: 0px; border-left: 0px; display: block; float: none; margin-left: auto; border-top: 0px; margin-right: auto; border-right: 0px" title="topgear-13" border="0" alt="topgear-13" src="http://www.blog.ianmellor.co.uk/wp-content/uploads/2010/07/topgear13_thumb.jpg" width="153" height="244" /></a></p>
<p>And there we have it! To complete the job, simply flatten the entire image, by selecting “Layers-&gt;Flatten Image” and you’re done!</p>
<p>Here’s how my sample image turned out:</p>
<p><a href="http://www.blog.ianmellor.co.uk/wp-content/uploads/2010/07/topgear14.jpg"><img style="border-bottom: 0px; border-left: 0px; display: block; float: none; margin-left: auto; border-top: 0px; margin-right: auto; border-right: 0px" title="topgear-14" border="0" alt="topgear-14" src="http://www.blog.ianmellor.co.uk/wp-content/uploads/2010/07/topgear14_thumb.jpg" width="240" height="148" /></a></p>
<blockquote><p>Let me know how you get on and if you’ve got any improvements <img src='http://www.blog.ianmellor.co.uk/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> &#160; </p>
</blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.blog.ianmellor.co.uk/2010/07/09/finding-top-gear/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Multi debugging in Visual Studio</title>
		<link>http://www.blog.ianmellor.co.uk/2009/10/16/multi-debugging-in-visual-studio/</link>
		<comments>http://www.blog.ianmellor.co.uk/2009/10/16/multi-debugging-in-visual-studio/#comments</comments>
		<pubDate>Fri, 16 Oct 2009 10:14:39 +0000</pubDate>
		<dc:creator>Sk93</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[Computers]]></category>
		<category><![CDATA[Tricks]]></category>
		<category><![CDATA[Visual Studio]]></category>

		<guid isPermaLink="false">http://www.blog.ianmellor.co.uk/2009/10/16/multi-debugging-in-visual-studio/</guid>
		<description><![CDATA[Firstly, I couldn’t come up with a “snappy” title for this post, so went with the above. I guess I’m too busy to be even marginally creative!
I have recently been working with a multiple web project solution in Visual Studio. For ages, I’ve been switching between each web project by stopping debugging, setting the other [...]]]></description>
			<content:encoded><![CDATA[<p>Firstly, I couldn’t come up with a “snappy” title for this post, so went with the above. I guess I’m too busy to be even marginally creative!</p>
<p>I have recently been working with a multiple web project solution in Visual Studio. For ages, I’ve been switching between each web project by stopping debugging, setting the other as the start up project, and then starting debugging again. As you can imagine, this makes testing interoperability between the two quite a drag.</p>
<p> <span id="more-95"></span>
<p>One of my colleagues showed me that if you set a specific port for Visual Studio’s development server, you can then start the main project (in the normal fashion), but then also start the second project by right-clicking on it, and selecting “run” from the debug menu.</p>
<p>This was a good step forward for me, as previously I wasn’t sure it was possible to achieve debugging across two projects if there was no direct reference defined. However, being the person I was, I wasn’t quite satisfied with having to start one project, then manually starting the second once it had started. So I had a bit of a dive through the various properties and configuration screens within Visual Studio and discovered a method that allows you to start multiple projects, in a defined order, by simply hitting F5.</p>
<p>To do it, right click on the Solution, and choose properties from the context menu. Once the new window appears, ensure “Common Properties”-&gt;”Startup Project” is selected from the list on the left.   <br />Then, on the right side of the screen, select the “Multiple startup projects” option. Finally, change the “Action” cell in the table for each project you want to start up when you begin debugging.    <br />If you need to specify or change the order in which projects are selected, you can select the table row for that project, and using the up/down arrow on the right of the page, move it up and down in the startup order.</p>
<p><a href="http://www.blog.ianmellor.co.uk/images/MultidebugginginVisualStudio_9E1E/solutionsprops.png"><img style="border-bottom: 0px; border-left: 0px; display: block; float: none; margin-left: auto; border-top: 0px; margin-right: auto; border-right: 0px" title="solutions-props" border="0" alt="solutions-props" src="http://www.blog.ianmellor.co.uk/images/MultidebugginginVisualStudio_9E1E/solutionsprops_thumb.png" width="483" height="303" /></a> </p>
<p>Quite a neat trick that could have saved me a good deal of ball ache in the earlier parts of this project!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.blog.ianmellor.co.uk/2009/10/16/multi-debugging-in-visual-studio/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Softly does it</title>
		<link>http://www.blog.ianmellor.co.uk/2009/08/26/softly-does-it/</link>
		<comments>http://www.blog.ianmellor.co.uk/2009/08/26/softly-does-it/#comments</comments>
		<pubDate>Wed, 26 Aug 2009 16:45:07 +0000</pubDate>
		<dc:creator>Sk93</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[Photography]]></category>
		<category><![CDATA[Photoshop]]></category>
		<category><![CDATA[Filters]]></category>
		<category><![CDATA[Soft Light]]></category>
		<category><![CDATA[Tricks]]></category>

		<guid isPermaLink="false">http://www.blog.ianmellor.co.uk/2009/08/28/softly-does-it/</guid>
		<description><![CDATA[Following on nicely from the last post, I have another quick trick I often use to give some of my more “meh” photos a bit more “yeh”.
We’ll start with the same photo as before:
 
As before, the image appears quite “flat” and lifeless. We can try and fix this with a very quick and (usually) efficient [...]]]></description>
			<content:encoded><![CDATA[<p>Following on nicely from the last post, I have another quick trick I often use to give some of my more “meh” photos a bit more “yeh”.</p>
<p>We’ll start with the same photo as before:</p>
<p><a href="http://www.blog.ianmellor.co.uk/images/Softlydoesit_E618/nosoftlight.jpg"><img style="border-bottom: 0px; border-left: 0px; display: block; float: none; margin-left: auto; border-top: 0px; margin-right: auto; border-right: 0px" title="nosoftlight" src="http://www.blog.ianmellor.co.uk/images/Softlydoesit_E618/nosoftlight_thumb.jpg" border="0" alt="nosoftlight" width="217" height="244" /></a> </p>
<p>As before, the image appears quite “flat” and lifeless. We can try and fix this with a very quick and (usually) efficient contrast tweak using a “soft light” layer.</p>
<p><span id="more-67"></span></p>
<p>To this, open your image up in Photoshop, then create a duplicate of the original background layer (right-click on the background layer and select “duplicate”..).<br />
Now, with the duplicate layer selected , choose “Soft Light” from the dropdown list of layer types:</p>
<p><a href="http://www.blog.ianmellor.co.uk/images/Softlydoesit_E618/softlight_layers.jpg"><img style="border-bottom: 0px; border-left: 0px; display: block; float: none; margin-left: auto; border-top: 0px; margin-right: auto; border-right: 0px" title="softlight_layers" src="http://www.blog.ianmellor.co.uk/images/Softlydoesit_E618/softlight_layers_thumb.jpg" border="0" alt="softlight_layers" width="239" height="179" /></a></p>
<p>At this point, your image may already look better, but it some cases (including this image), the soft light can be a little overpowering on full opacity.<br />
Obviously, every image is different, so there’s not a “one size fits all” opacity setting, so you’ll need to experiment with each image; Try dropping the opacity down to around 70%, or until you gain a good contrast.</p>
<p>I settled for 70% for this image, and the results I gained were a good deal better than the original:</p>
<p><a href="http://www.blog.ianmellor.co.uk/images/Softlydoesit_E618/softlight.jpg"><img style="border-bottom: 0px; border-left: 0px; display: block; float: none; margin-left: auto; border-top: 0px; margin-right: auto; border-right: 0px" title="softlight" src="http://www.blog.ianmellor.co.uk/images/Softlydoesit_E618/softlight_thumb.jpg" border="0" alt="softlight" width="217" height="244" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.blog.ianmellor.co.uk/2009/08/26/softly-does-it/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Finish Him!</title>
		<link>http://www.blog.ianmellor.co.uk/2009/08/25/finish-him/</link>
		<comments>http://www.blog.ianmellor.co.uk/2009/08/25/finish-him/#comments</comments>
		<pubDate>Tue, 25 Aug 2009 22:37:00 +0000</pubDate>
		<dc:creator>Sk93</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[Photography]]></category>
		<category><![CDATA[Photoshop]]></category>
		<category><![CDATA[Filters]]></category>
		<category><![CDATA[High Pass]]></category>
		<category><![CDATA[Tricks]]></category>

		<guid isPermaLink="false">http://www.blog.ianmellor.co.uk/2009/08/25/finish-him/</guid>
		<description><![CDATA[Time for another Photoshop trick; this time it’s a very quick and easy one that can add that little bit extra to a photo.
So, first of all we need an image to work with. Here’s one of my little cousin:

As you can see, the image appears very “flat”.  I know it’s not exactly a fantastic [...]]]></description>
			<content:encoded><![CDATA[<p>Time for another Photoshop trick; this time it’s a very quick and easy one that can add that little bit extra to a photo.</p>
<p>So, first of all we need an image to work with. Here’s one of my little cousin:</p>
<p><a href="http://www.blog.ianmellor.co.uk/images/FinishHim_A386/without.jpg"><img style="border-bottom: 0px; border-left: 0px; display: block; float: none; margin-left: auto; border-top: 0px; margin-right: auto; border-right: 0px" title="without" src="http://www.blog.ianmellor.co.uk/images/FinishHim_A386/without_thumb.jpg" border="0" alt="without" width="233" height="260" /></a></p>
<p>As you can see, the image appears very “flat”.  I know it’s not exactly a fantastic photo to begin with, especially as it’s from a 1mp camera phone, but it’s good enough to demonstrate this trick!<span id="more-64"></span></p>
<p>So, once you have your image in Photoshop, right click the background layer and select “Duplicate” to give us an exact copy as a second layer.<br />
Then, choose “Filters-&gt;Other-&gt;High Pass” from the menus and when prompted, select a radius of 10 and click ok.<br />
You should end up with something grey looking, similar to this:</p>
<p><a href="http://www.blog.ianmellor.co.uk/images/FinishHim_A386/highpass_step1.jpg"><img style="border-bottom: 0px; border-left: 0px; display: block; float: none; margin-left: auto; border-top: 0px; margin-right: auto; border-right: 0px" title="highpass_step1" src="http://www.blog.ianmellor.co.uk/images/FinishHim_A386/highpass_step1_thumb.jpg" border="0" alt="highpass_step1" width="260" height="249" /></a></p>
<p>Next we need to make our new layer an “overlay”. To do this, select the dropdown list of layer types and choose “Overlay”.<br />
This next image shows the location of said dropdown:</p>
<p><a href="http://www.blog.ianmellor.co.uk/images/FinishHim_A386/highpass_step2.jpg"><img style="border-bottom: 0px; border-left: 0px; display: block; float: none; margin-left: auto; border-top: 0px; margin-right: auto; border-right: 0px" title="highpass_step2" src="http://www.blog.ianmellor.co.uk/images/FinishHim_A386/highpass_step2_thumb.jpg" border="0" alt="highpass_step2" width="249" height="193" /></a></p>
<p>Now we need to apply a mask to this layer, as we don’t want to apply the high pass results to the full image. So, whilst holding ALT, click the “Add Layer Mask” button, located at the bottom of the Layers pane.</p>
<p>Masks work by using the colours white and black to determine if whatever is being masked should pass through, or not, respectively. By holding ALT when creating our mask, it will be created entirely black (meaning none of the layer will pass through). This is what we want, as we only need to apply the high pass results to specific areas of the image, as you’ll see next!</p>
<p>Ok, now we have our mask, ensure it is selected. It will have a black and blue border around it if it’s selected – see the next two images for an example:</p>
<p><a href="http://www.blog.ianmellor.co.uk/images/FinishHim_A386/highpass_step3.jpg"><img style="border-bottom: 0px; border-left: 0px; display: block; float: none; margin-left: auto; border-top: 0px; margin-right: auto; border-right: 0px" title="highpass_step3" src="http://www.blog.ianmellor.co.uk/images/FinishHim_A386/highpass_step3_thumb.jpg" border="0" alt="highpass_step3" width="114" height="56" /></a><a href="http://www.blog.ianmellor.co.uk/images/FinishHim_A386/highpass_step4.jpg"><img style="border-bottom: 0px; border-left: 0px; display: block; float: none; margin-left: auto; border-top: 0px; margin-right: auto; border-right: 0px" title="highpass_step4" src="http://www.blog.ianmellor.co.uk/images/FinishHim_A386/highpass_step4_thumb.jpg" border="0" alt="highpass_step4" width="100" height="58" /></a></p>
<p> </p>
<p>Now, select the paint brush tool, and the colour pure white, then start to paint over the eyes, hair, mouth and teeth (or any other areas you wish to “draw attention” to within your image).</p>
<p>Once you’re done, you should end up with something like this:</p>
<p><a href="http://www.blog.ianmellor.co.uk/images/FinishHim_A386/with.jpg"><img style="border-bottom: 0px; border-left: 0px; display: block; float: none; margin-left: auto; border-top: 0px; margin-right: auto; border-right: 0px" title="with" src="http://www.blog.ianmellor.co.uk/images/FinishHim_A386/with_thumb.jpg" border="0" alt="with" width="233" height="260" /></a></p>
<p>which, if you compare against the original, seems to pop out and his face draws your attention more:</p>
<p><a href="http://www.blog.ianmellor.co.uk/images/FinishHim_A386/without_3.jpg"><img style="border-bottom: 0px; border-left: 0px; display: block; float: none; margin-left: auto; border-top: 0px; margin-right: auto; border-right: 0px" title="without" src="http://www.blog.ianmellor.co.uk/images/FinishHim_A386/without_thumb_3.jpg" border="0" alt="without" width="233" height="260" /></a></p>
<p>Hope this is of some use <img src='http://www.blog.ianmellor.co.uk/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.blog.ianmellor.co.uk/2009/08/25/finish-him/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>No Closure</title>
		<link>http://www.blog.ianmellor.co.uk/2009/07/23/no-closure/</link>
		<comments>http://www.blog.ianmellor.co.uk/2009/07/23/no-closure/#comments</comments>
		<pubDate>Thu, 23 Jul 2009 15:39:56 +0000</pubDate>
		<dc:creator>Sk93</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[Computers]]></category>
		<category><![CDATA[Tricks]]></category>
		<category><![CDATA[Visual Studio]]></category>

		<guid isPermaLink="false">http://www.blog.ianmellor.co.uk/?p=47</guid>
		<description><![CDATA[A colleague came to me today asking if I knew of any way to remove the close button from a windows form, but still show the minimize and maximize buttons.
On the face of it, it sounded like an easy answer. I knew you could disable both the minimize and maximize buttons very easily from within [...]]]></description>
			<content:encoded><![CDATA[<p>A colleague came to me today asking if I knew of any way to remove the close button from a windows form, but still show the minimize and maximize buttons.</p>
<p>On the face of it, it sounded like an easy answer. I knew you could disable both the minimize and maximize buttons very easily from within the Visual Studio GUI – so surely there’s an option for the third button; the close button?   <br />Actually, no. Whilst you can remove all three buttons in one go (changing the setting “ControlBox” to false.) and as previously mentioned, you can disable the maximize and minimize buttons (“MaximizeBox” and “MinimizeBox” settings respectively), there is no setting to directly control the Close button.</p>
<p> <span id="more-47"></span>
<p>A quick Google search produced a few varied approaches, but the one I suggested my colleague to implement is as follows:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
</pre></td><td class="code"><pre class="language" style="font-family:monospace;">private const int CP_NOCLOSE_BUTTON = 0x200;
protected override CreateParams CreateParams
{
    get
    {
        CreateParams mdiCp = base.CreateParams;
        mdiCp.ClassStyle = mdiCp.ClassStyle | CP_NOCLOSE_BUTTON;
        return mdiCp;
    }
}</pre></td></tr></table></div>

<p>This small bit of code simply needs to be placed within your form class; It overrides a property that is already called when a form is initialised, so doesn’t need to be explicitly called.</p>
<p>Some before and after shots:</p>
<p><a href="http://www.blog.ianmellor.co.uk/images/NoClosure_E2CF/2.jpg"><img title="Before" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="238" alt="Before" src="http://www.blog.ianmellor.co.uk/images/NoClosure_E2CF/2_thumb.jpg" width="238" border="0" /></a> <a href="http://www.blog.ianmellor.co.uk/images/NoClosure_E2CF/1.jpg"><img title="After" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="238" alt="After" src="http://www.blog.ianmellor.co.uk/images/NoClosure_E2CF/1_thumb.jpg" width="238" border="0" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.blog.ianmellor.co.uk/2009/07/23/no-closure/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>There can be only one!</title>
		<link>http://www.blog.ianmellor.co.uk/2009/07/10/there-can-be-only-one/</link>
		<comments>http://www.blog.ianmellor.co.uk/2009/07/10/there-can-be-only-one/#comments</comments>
		<pubDate>Fri, 10 Jul 2009 12:33:37 +0000</pubDate>
		<dc:creator>Sk93</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[Computers]]></category>
		<category><![CDATA[Mutex]]></category>
		<category><![CDATA[Threading]]></category>
		<category><![CDATA[Tricks]]></category>

		<guid isPermaLink="false">http://www.blog.ianmellor.co.uk/2009/07/10/there-can-be-only-one/</guid>
		<description><![CDATA[I had to make a slight change to one of my applications for a customer today, making it check if it is already running on the local machine and, if it is, abandon it’s attempt to start up another instance.
My initial thoughts were to examine the executing processes and check for the existence of the [...]]]></description>
			<content:encoded><![CDATA[<p>I had to make a slight change to one of my applications for a customer today, making it check if it is already running on the local machine and, if it is, abandon it’s attempt to start up another instance.</p>
<p>My initial thoughts were to examine the executing processes and check for the existence of the application in the list:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
</pre></td><td class="code"><pre class="language" style="font-family:monospace;">    string procName = Process.GetCurrentProcess().ProcessName;           
    Process[] processes= Process.GetProcessesByName(procName);
&nbsp;
    if (processes.Length == 1)
    {
        //run application
        ...
    }</pre></td></tr></table></div>

<p>Now, whilst this works, it is easily “beatable” by simply changing the executable’s name. Doing so will cause the method “GetProcessessByName()” to return only a single match, instead of the current application and any other duplicate instances.</p>
<p><span id="more-43"></span></p>
<p>After pondering on the subject for a while, I started to think how threading works, or more precisely, how threading deals with shared resources.</p>
<p>When a thread attempts to access a shared resource, an exclusive lock is applied to that resource until the thread completes it’s task. These locks are actually “Mutex” objects (<a href="http://msdn.microsoft.com/en-us/library/system.threading.mutex.aspx" target="_blank">read more here</a>).</p>
<p>Using a Mutex, I was able to create the following code:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
</pre></td><td class="code"><pre class="language" style="font-family:monospace;">    bool isFirstInstance;
    Mutex mx = new Mutex(true,&quot;Global\\MyApplicationName&quot;,out isFirstInstance);
&nbsp;
    if (isFirstInstance)
    {
        //run application
        ...
        mx.Close();
    }
    else
    {
        //application already running
    }</pre></td></tr></table></div>

<p>The “Global\\” prefix tells the Mutex to be available across all user instances on the machine, not just the current.<br />
  <br />Also, whilst it’s not strictly required to close the Mutex before exiting, as it will be automatically closed when the application ends, I’ve added it in this example for completeness.</p>
<p>In my opinion, this method is more reliable, more robust, and slightly cooler <img src='http://www.blog.ianmellor.co.uk/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.blog.ianmellor.co.uk/2009/07/10/there-can-be-only-one/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
