<?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>FlexiCoder Blog &#187; Image</title>
	<atom:link href="http://www.flexicoder.com/blog/index.php/tag/image/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.flexicoder.com/blog</link>
	<description></description>
	<lastBuildDate>Sat, 04 Feb 2012 12:24:07 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Image from Byte Array</title>
		<link>http://www.flexicoder.com/blog/index.php/2009/01/image-from-byte-array/</link>
		<comments>http://www.flexicoder.com/blog/index.php/2009/01/image-from-byte-array/#comments</comments>
		<pubDate>Wed, 07 Jan 2009 16:17:00 +0000</pubDate>
		<dc:creator>flexicoder</dc:creator>
				<category><![CDATA[C# 3.5]]></category>
		<category><![CDATA[.Net code]]></category>
		<category><![CDATA[Image]]></category>

		<guid isPermaLink="false">http://www.flexicoder.com/blog/?p=25</guid>
		<description><![CDATA[To render an image to a picturebox using the data stored in a byte array use the following code using (MemoryStream ms = new MemoryStream(ImageDetails.ThumbnailImage)) { ThumbnailImage.Image = Image.FromStream(ms); } Social Bookmarking]]></description>
			<content:encoded><![CDATA[<p>To render an image to a picturebox using the data stored in a byte array use the following code<br />
<code></p>
<pre class="brush: c#">
using (MemoryStream ms = new MemoryStream(ImageDetails.ThumbnailImage))
{
    ThumbnailImage.Image = Image.FromStream(ms);
}</pre>
<p></code></p>
<br/><a href="http://www.socialmarker.com/?link=http://www.flexicoder.com/blog/index.php/2009/01/image-from-byte-array/&title=Image+from+Byte+Array&text=To+render+an+image+to+a+picturebox+using+the+data+stored+in+a+byte+array+use+the+following+code+++using+%28MemoryStream+ms+%3D+new+MemoryStream%28ImageDetails.ThumbnailImage%29%29+%7B+++++ThumbnailImage.Image+%3D...&tags=" target="_blank"><img src= "http://www.socialmarker.com/bookmark.gif" border="0" /></a><noscript><a href="http://www.socialmarker.com" >Social Bookmarking</a></noscript>]]></content:encoded>
			<wfw:commentRss>http://www.flexicoder.com/blog/index.php/2009/01/image-from-byte-array/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Render Image using Generic Handler ASP.Net</title>
		<link>http://www.flexicoder.com/blog/index.php/2009/01/render-image-using-generic-handler-aspnet/</link>
		<comments>http://www.flexicoder.com/blog/index.php/2009/01/render-image-using-generic-handler-aspnet/#comments</comments>
		<pubDate>Wed, 07 Jan 2009 11:27:00 +0000</pubDate>
		<dc:creator>flexicoder</dc:creator>
				<category><![CDATA[ashx]]></category>
		<category><![CDATA[ASP.Net]]></category>
		<category><![CDATA[C# 3.5]]></category>
		<category><![CDATA[.Net code]]></category>
		<category><![CDATA[Image]]></category>

		<guid isPermaLink="false">http://www.flexicoder.com/blog/?p=24</guid>
		<description><![CDATA[The following code uses a property from an object that returns a byte array that contains an image. public void ProcessRequest(HttpContext context) { context.Response.ContentType = "image/jpg"; if (context.Request.Params["Id"] != null) { Content selectedImage = new Content(Convert.ToInt32(context.Request.Params["Id"].ToString())); if (context.Request.Params["t"] == "D") { context.Response.OutputStream.Write(selectedImage.ImageDetails.FullImage, 0, selectedImage.ImageDetails.FullImage.Length); } else { context.Response.OutputStream.Write(selectedImage.ImageDetails.ThumbnailImage, 0, selectedImage.ImageDetails.ThumbnailImage.Length); } } } Social Bookmarking]]></description>
			<content:encoded><![CDATA[<p>The following code uses a property from an object that returns a byte array that contains an image.</p>
<p><code>
<pre class="brush:c#">
public void ProcessRequest(HttpContext context)
{
    context.Response.ContentType = "image/jpg";
    if (context.Request.Params["Id"] != null)
    {
        Content selectedImage = new Content(Convert.ToInt32(context.Request.Params["Id"].ToString()));
        if (context.Request.Params["t"] == "D")
        {
            context.Response.OutputStream.Write(selectedImage.ImageDetails.FullImage, 0, selectedImage.ImageDetails.FullImage.Length);
        }
        else
        {
            context.Response.OutputStream.Write(selectedImage.ImageDetails.ThumbnailImage, 0, selectedImage.ImageDetails.ThumbnailImage.Length);
        }
    }
}</pre>
<p></code></p>
<br/><a href="http://www.socialmarker.com/?link=http://www.flexicoder.com/blog/index.php/2009/01/render-image-using-generic-handler-aspnet/&title=Render+Image+using+Generic+Handler+ASP.Net&text=The+following+code+uses+a+property+from+an+object+that+returns+a+byte+array+that+contains+an+image.+++public+void+ProcessRequest%28HttpContext+context%29+%7B+++++context.Response.ContentType+%3D+%22image%2Fjpg%22%3B...&tags=selectedimage+imagedetails%2C+context+request%2C+context%2C+selectedimage" target="_blank"><img src= "http://www.socialmarker.com/bookmark.gif" border="0" /></a><noscript><a href="http://www.socialmarker.com" >Social Bookmarking</a></noscript>]]></content:encoded>
			<wfw:commentRss>http://www.flexicoder.com/blog/index.php/2009/01/render-image-using-generic-handler-aspnet/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Loading Image/BLOB from SQL Server</title>
		<link>http://www.flexicoder.com/blog/index.php/2009/01/loading-imageblob-from-sql-server/</link>
		<comments>http://www.flexicoder.com/blog/index.php/2009/01/loading-imageblob-from-sql-server/#comments</comments>
		<pubDate>Wed, 07 Jan 2009 11:18:00 +0000</pubDate>
		<dc:creator>flexicoder</dc:creator>
				<category><![CDATA[C# 3.5]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[.Net code]]></category>
		<category><![CDATA[Image]]></category>

		<guid isPermaLink="false">http://www.flexicoder.com/blog/?p=23</guid>
		<description><![CDATA[If you have an image column in your SQL table you can load the bytes using the following code. int bufferSize = Convert.ToInt32(reader.GetBytes(7,0,null,0,int.MaxValue)); _ThumbnailImage = new Byte[bufferSize]; reader.GetBytes(7, 0, _ThumbnailImage, 0, bufferSize); The first parameter is the column number, in this case 7, call GetBytes with a null buffer first to get the number of [...]]]></description>
			<content:encoded><![CDATA[<p>If you have an <em>image </em>column in your SQL table you can load the bytes using the following code.<br />
<code>
<pre class="brush:c#">
int bufferSize = Convert.ToInt32(reader.GetBytes(7,0,null,0,int.MaxValue));
_ThumbnailImage = new Byte[bufferSize];
reader.GetBytes(7, 0, _ThumbnailImage, 0, bufferSize);
</pre>
<p></code><br />
The first parameter is the column number, in this case 7, call <em>GetBytes </em>with a null buffer first to get the number of bytes needed.</p>
<p>Remember that an <em>image </em>column, holds bytes and therefore can contain any sort of document, not necessarily an image, could be a PDF</p>
<br/><a href="http://www.socialmarker.com/?link=http://www.flexicoder.com/blog/index.php/2009/01/loading-imageblob-from-sql-server/&title=Loading+Image%2FBLOB+from+SQL+Server&text=If+you+have+an+image+column+in+your+SQL+table+you+can+load+the+bytes+using+the+following+code.+++int+bufferSize+%3D+Convert.ToInt32%28reader.GetBytes%287%2C0%2Cnull%2C0%2Cint.MaxValue%29%29%3B+_ThumbnailImage+%3D+new...&tags=" target="_blank"><img src= "http://www.socialmarker.com/bookmark.gif" border="0" /></a><noscript><a href="http://www.socialmarker.com" >Social Bookmarking</a></noscript>]]></content:encoded>
			<wfw:commentRss>http://www.flexicoder.com/blog/index.php/2009/01/loading-imageblob-from-sql-server/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

