<?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>ASP.NET Tutorials &#187; Uncategorized</title>
	<atom:link href="http://www.tutorialsasp.net/category/uncategorized/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.tutorialsasp.net</link>
	<description>Get stuff done with ASP.NET</description>
	<lastBuildDate>Tue, 31 Aug 2010 17:23:53 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2</generator>
		<item>
		<title>The New Xbox 360</title>
		<link>http://www.tutorialsasp.net/uncategorized/the-new-xbox-360/</link>
		<comments>http://www.tutorialsasp.net/uncategorized/the-new-xbox-360/#comments</comments>
		<pubDate>Wed, 21 Jul 2010 17:12:45 +0000</pubDate>
		<dc:creator>Vihutuo</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.tutorialsasp.net/?p=295</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<p><script type="text/javascript" src="http://video.unrulymedia.com/wildfire_12113381.js"></script></p>
]]></content:encoded>
			<wfw:commentRss>http://www.tutorialsasp.net/uncategorized/the-new-xbox-360/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Loading and previewing fonts from files in ASP.NET</title>
		<link>http://www.tutorialsasp.net/uncategorized/loading-and-previewing-fonts-from-files-in-aspnet/</link>
		<comments>http://www.tutorialsasp.net/uncategorized/loading-and-previewing-fonts-from-files-in-aspnet/#comments</comments>
		<pubDate>Sat, 11 Oct 2008 08:10:44 +0000</pubDate>
		<dc:creator>Vihutuo</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Fonts from file]]></category>
		<category><![CDATA[PrivateFontCollectionClass]]></category>

		<guid isPermaLink="false">http://www.tutorialsasp.net/?p=130</guid>
		<description><![CDATA[Few weeks back I created a free fonts preview and download site www.freedownloadablefonts.net. There are around 6000 fonts in .ttf files and I needed to display a preview of the fonts. All the fonts were copied to a folder &#8220;~/Fonts&#8221;. Then I created a http handler &#8220;GetFontImage.ashx&#8221; to which the font path and text to [...]]]></description>
			<content:encoded><![CDATA[<p>Few weeks back I created a free fonts preview and  download site <a title="Free downloadable fonts" href="http://www.freedownloadablefonts.net" target="_blank">www.freedownloadablefonts.net</a>. There are around 6000 fonts in .ttf files and I needed to display a preview of the fonts. All the fonts were copied to a folder &#8220;~/Fonts&#8221;. Then I created a http handler &#8220;GetFontImage.ashx&#8221; to which the font path and text to display was passed as query strings . It created an image using the font specified. The code for &#8220;<strong>GetFontImage.ashx</strong>&#8221; is as follows</p>
<p><code>&lt;%@ WebHandler Language="VB" Class="GetFontImage" %&gt;<br />
Imports System<br />
Imports System.Web<br />
Public Class GetFontImage : Implements IHttpHandler<br />
Public Sub ProcessRequest(ByVal context As HttpContext) Implements IHttpHandler.ProcessRequest<br />
context.Response.ContentType = "image/png"<br />
Dim fontpath As String = context.Request.QueryString("fontpath")<br />
Dim Text As String = context.Request.QueryString("Text")<br />
Dim FontImage As System.Drawing.Bitmap = clsUtility.GetFontPic(fontpath, Text)<br />
Dim ms As IO.MemoryStream = New IO.MemoryStream()<br />
FontImage.Save(ms, System.Drawing.Imaging.ImageFormat.Png)<br />
Dim FontImageBytes() As Byte = ms.GetBuffer()<br />
FontImage.Dispose()<br />
ms.Close()<br />
context.Response.BinaryWrite(FontImageBytes)<br />
context.Response.End()<br />
End Sub<br />
End Class<br />
</code><br />
GetFontImage.ashx calls another function clsUtility.GetFontPic(fontpath, Text) whose code is as follows. clsUtility.GetFontPic(fontpath, Text) uses the privatefontcollection class to load the font from file<br />
<code><br />
Imports Microsoft.VisualBasic<br />
Imports System.IO<br />
Imports System.Drawing<br />
Imports System.Drawing.Text<br />
Imports System.Drawing.Imaging<br />
Imports System.Drawing.Drawing2D<br />
Public Class clsUtility<br />
Public Shared Function GetFontPic(ByVal Fontpath As String, ByVal Text As String) As System.Drawing.Bitmap<br />
Dim width As Integer = 620<br />
Dim height As Integer = 30<br />
Dim FontImage As New System.Drawing.Bitmap(width, height, PixelFormat.Format24bppRgb)<br />
Dim g As Graphics = Graphics.FromImage(FontImage)<br />
g.Clear(Color.White)<br />
g.TextRenderingHint = System.Drawing.Text.TextRenderingHint.AntiAlias<br />
g.SmoothingMode = SmoothingMode.AntiAlias<br />
Dim pointF As New PointF(10,0)<br />
Dim FontSize As Integer = 24<br />
Dim solidBrush As New SolidBrush(Color.Black)<br />
Dim privateFontCollection As New PrivateFontCollection()<br />
privateFontCollection.AddFontFile(Fontpath)   ' load font from file<br />
Dim thisFont As FontFamily = privateFontCollection.Families(0)<br />
Dim regFont As New Font(thisFont, FontSize, FontStyle.Regular, GraphicsUnit.Pixel) ' Create a new font<br />
g.DrawString(Text, regFont, solidBrush, pointF) ' Using the font write the text using the font style<br />
Return FontImage<br />
End Function<br />
</code><br />
All the font information were stored in a database in a table with the following columns<br />
1. FontID<br />
2. FontName<br />
3. Path<br />
4. AddedDate<br />
A script can be easily created to add all the font information to the table using the privatefontcolection class as above<br />
The home page displays the 10 latest fonts in a gridview. The code is as folows<br />
<strong> Default.aspx</strong><br />
<code><br />
&lt;asp:GridView ID="GridView1" runat="server" AllowPaging="True" AutoGenerateColumns="False" DataKeyNames="FontID" DataSourceID="SqlDataSourceFonts" ShowHeader="False" Width="100%" GridLines="None" BorderStyle=None BorderWidth="0"&gt;<br />
&lt;Columns&gt;<br />
&lt;asp:TemplateField ItemStyle-BackColor="White" HeaderText="Image" ItemStyle-BorderWidth="0"&gt;                 &lt;ItemTemplate&gt;<br />
&lt;asp:Image AlternateText='&lt;%# Eval("FontName") %&gt;'  ImageUrl='&lt;%# GetImageURL(Eval("path"),Eval("FontName")) %&gt; ' ID="FontImage" runat="server" /&gt;<br />
&lt;/ItemTemplate&gt;<br />
&lt;/asp:TemplateField&gt;<br />
&lt;/Columns&gt;<br />
&lt;/asp:GridView&gt;<br />
&lt;asp:SqlDataSource ID="SqlDataSourceFonts" runat="server" ConnectionString="&lt;%$ ConnectionStrings:FontsConnectionString %&gt;"<br />
SelectCommand="SELECT TOP 10 * FROM [Fonts_Fonts] ORDER BY [AddedDate] DESC"&gt;<br />
</code><br />
The code is pretty straight forward with a Gridview bound to an SQLDatasource. The code for GetImageURL() is as follows<br />
<strong> Default.aspx.vb</strong><br />
<code><br />
Public Function GetImageURL(ByVal Path As String, ByVal FontName As String)<br />
Return "GetFontImage.ashx?FontPath=" &amp; Server.MapPath(Path) &amp; "&amp;Text=" &amp; FontName<br />
End Function<br />
</code><br />
<a href="http://www.dotnetkicks.com/kick/?url=http%3a%2f%2fwww.tutorialsasp.net%2funcategorized%2floading-and-previewing-fonts-from-files-in-aspnet%2f"><img src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http%3a%2f%2fwww.tutorialsasp.net%2funcategorized%2floading-and-previewing-fonts-from-files-in-aspnet%2f" border="0" alt="kick it on DotNetKicks.com" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.tutorialsasp.net/uncategorized/loading-and-previewing-fonts-from-files-in-aspnet/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Embed google maps easily in your asp.net pages</title>
		<link>http://www.tutorialsasp.net/uncategorized/embed-google-maps/</link>
		<comments>http://www.tutorialsasp.net/uncategorized/embed-google-maps/#comments</comments>
		<pubDate>Mon, 25 Aug 2008 18:37:56 +0000</pubDate>
		<dc:creator>Vihutuo</dc:creator>
				<category><![CDATA[Free ASP.NET controls]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Asp.Net Google map control]]></category>
		<category><![CDATA[Google Map]]></category>

		<guid isPermaLink="false">http://tutorialsasp.net/?p=1</guid>
		<description><![CDATA[I found a nice and simple control Artem Google Map control . Its free, very simple to use and instructions are clearly provided . Just download the control file and put it in your bin directory. Sign up for a new Google Map key and note down the key. Here is an example of using [...]]]></description>
			<content:encoded><![CDATA[<p>I found a nice and simple control <a href="http://www.codeplex.com/googlemap">Artem Google Map </a> control . Its free, very simple to use and instructions are clearly provided . Just download the control file and put it in your bin directory. <a href="http://code.google.com/apis/maps/signup.html">Sign up for a new Google Map key</a> and note down the key. Here is an example of using the control in your asp.net page</p>
<p><code>&lt;artem:GoogleMap ID="GoogleMap1" runat="server" Width="500px" Height="400px" Key="your key here"<br />
Latitude="26" Longitude="93.6" Zoom="5"&gt;<br />
&lt;/artem:GoogleMap&gt;<br />
</code><br />
You can see a live demo <a href="http://www.LittleStarDimapur.com">here</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.tutorialsasp.net/uncategorized/embed-google-maps/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>About</title>
		<link>http://www.tutorialsasp.net/uncategorized/about/</link>
		<comments>http://www.tutorialsasp.net/uncategorized/about/#comments</comments>
		<pubDate>Mon, 25 Aug 2008 18:37:56 +0000</pubDate>
		<dc:creator>Vihutuo</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://tutorialsasp.net/?page_id=2</guid>
		<description><![CDATA[I have been working ASP and ASP.NET since almost a decade back. Here I would just like to put down some stuff which I had difficulty finding the answers to. Hope it helps some guys looking for answers]]></description>
			<content:encoded><![CDATA[<p>I have been working ASP and ASP.NET since almost a decade back. Here I would just like to put down some stuff which I had difficulty finding the answers to. Hope it helps some guys looking for answers</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tutorialsasp.net/uncategorized/about/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Microsoft Expression</title>
		<link>http://www.tutorialsasp.net/uncategorized/microsoft-expression/</link>
		<comments>http://www.tutorialsasp.net/uncategorized/microsoft-expression/#comments</comments>
		<pubDate>Wed, 25 Jun 2008 16:08:19 +0000</pubDate>
		<dc:creator>Vihutuo</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.tutorialsasp.net/?p=293</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<p><script type="text/javascript" src="http://video.unrulymedia.com/wildfire_11207856.js"></script></p>
]]></content:encoded>
			<wfw:commentRss>http://www.tutorialsasp.net/uncategorized/microsoft-expression/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Visual Studio 2010 Documentary 4</title>
		<link>http://www.tutorialsasp.net/uncategorized/visual-studio-2010-documentary-4/</link>
		<comments>http://www.tutorialsasp.net/uncategorized/visual-studio-2010-documentary-4/#comments</comments>
		<pubDate>Wed, 25 Jun 2008 14:09:35 +0000</pubDate>
		<dc:creator>Vihutuo</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.tutorialsasp.net/?p=291</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<p><script type="text/javascript" src="http://video.unrulymedia.com/wildfire_11226909.js"></script></p>
]]></content:encoded>
			<wfw:commentRss>http://www.tutorialsasp.net/uncategorized/visual-studio-2010-documentary-4/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Visual Studio 2010 Documentary 2</title>
		<link>http://www.tutorialsasp.net/uncategorized/visual-studio-2010-documentary-2/</link>
		<comments>http://www.tutorialsasp.net/uncategorized/visual-studio-2010-documentary-2/#comments</comments>
		<pubDate>Wed, 25 Jun 2008 14:08:17 +0000</pubDate>
		<dc:creator>Vihutuo</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.tutorialsasp.net/?p=287</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<p><script type="text/javascript" src="http://video.unrulymedia.com/wildfire_11220558.js"></script></p>
]]></content:encoded>
			<wfw:commentRss>http://www.tutorialsasp.net/uncategorized/visual-studio-2010-documentary-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Advertisement</title>
		<link>http://www.tutorialsasp.net/uncategorized/advertisement/</link>
		<comments>http://www.tutorialsasp.net/uncategorized/advertisement/#comments</comments>
		<pubDate>Tue, 17 Jun 2008 16:30:03 +0000</pubDate>
		<dc:creator>Vihutuo</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.tutorialsasp.net/?p=285</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<p><script type="text/javascript" src="http://video.unrulymedia.com/wildfire_10753281.js"></script></p>
]]></content:encoded>
			<wfw:commentRss>http://www.tutorialsasp.net/uncategorized/advertisement/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

