<?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>appytizers &#187; csharp</title>
	<atom:link href="http://www.rohand.com/tag/csharp/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.rohand.com</link>
	<description>the book of i</description>
	<lastBuildDate>Fri, 13 Aug 2010 16:37:52 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Resize an Image in C#</title>
		<link>http://www.rohand.com/2010/resize-an-image-in-c/</link>
		<comments>http://www.rohand.com/2010/resize-an-image-in-c/#comments</comments>
		<pubDate>Thu, 03 Jun 2010 18:46:54 +0000</pubDate>
		<dc:creator>rohand</dc:creator>
				<category><![CDATA[tech]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[csharp]]></category>

		<guid isPermaLink="false">http://www.rohand.com/2010/resize-an-image-in-c/</guid>
		<description><![CDATA[This function will let you resize an image in C#. public static Bitmap Resize(Bitmap original, int width, int height) { Bitmap bitmap = new Bitmap(width, height); using (Graphics gfx = Graphics.FromImage(bitmap)) { gfx.InterpolationMode = Drawing2D.InterpolationMode.HighQualityBicubic; gfx.SmoothingMode = Drawing2D.SmoothingMode.HighQuality; gfx.PixelOffsetMode = Drawing2D.PixelOffsetMode.HighQuality; gfx.CompositingQuality = Drawing2D.CompositingQuality.HighQuality; gfx.DrawImage(original, 0, 0, width, height); return bitmap; } }]]></description>
			<content:encoded><![CDATA[<p>This function will let you resize an image in C#.</p>
<pre>public static Bitmap Resize(Bitmap original,
                        int width, int height)
{
  Bitmap bitmap = new Bitmap(width, height);

  using (Graphics gfx = Graphics.FromImage(bitmap))
  {
    gfx.InterpolationMode
            = Drawing2D.InterpolationMode.HighQualityBicubic;
    gfx.SmoothingMode
            = Drawing2D.SmoothingMode.HighQuality;
    gfx.PixelOffsetMode
            = Drawing2D.PixelOffsetMode.HighQuality;
    gfx.CompositingQuality
            = Drawing2D.CompositingQuality.HighQuality;

    gfx.DrawImage(original, 0, 0, width, height);

    return bitmap;
  }
}</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.rohand.com/2010/resize-an-image-in-c/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Do Not .IndexOf Without Further Checks</title>
		<link>http://www.rohand.com/2010/do-not-indexof-without-further-checks/</link>
		<comments>http://www.rohand.com/2010/do-not-indexof-without-further-checks/#comments</comments>
		<pubDate>Tue, 26 Jan 2010 19:42:54 +0000</pubDate>
		<dc:creator>rohand</dc:creator>
				<category><![CDATA[tech]]></category>
		<category><![CDATA[bugs]]></category>
		<category><![CDATA[csharp]]></category>

		<guid isPermaLink="false">http://www.rohand.com/2010/do-not-indexof-without-further-checks/</guid>
		<description><![CDATA[Do not do this: if (&#34;A,B,C,D,E&#34;.IndexOf(key) &#62; -1) { // CODE REDACTED } If key is an empty string, the result is 0 and the code in the IF block is executed. This is probably not what you expected.]]></description>
			<content:encoded><![CDATA[<p>Do not do this:</p>
<pre>if (&quot;A,B,C,D,E&quot;.IndexOf(key) &gt; -1)
{
    // CODE REDACTED
}</pre>
<p>If <code>key</code> is an empty string, the result is 0 and the code in the IF block is executed. This is probably not what you expected.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.rohand.com/2010/do-not-indexof-without-further-checks/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
