<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://forums.asp.net/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>System.Drawing/GDI+</title><link>http://forums.asp.net/150.aspx</link><description>Discuss manipulating and creating graphics using the System.Drawing namespace and GDI+.</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP1 (Build: 20510.895)</generator><item><title>Re: An exception of type 'System.OutOfMemoryException</title><link>http://forums.asp.net/thread/3262786.aspx</link><pubDate>Sun, 28 Jun 2009 17:51:30 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3262786</guid><dc:creator>kaushalparik27</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3262786.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=150&amp;PostID=3262786</wfw:commentRss><description>&lt;p&gt;pleasure to help.. dont forget to resolve the thread and mark the answers. thanx./.&lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: An exception of type 'System.OutOfMemoryException</title><link>http://forums.asp.net/thread/3261545.aspx</link><pubDate>Sat, 27 Jun 2009 09:22:30 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3261545</guid><dc:creator>pointman</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3261545.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=150&amp;PostID=3261545</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;Hi! Thx for the help!&lt;/p&gt;
&lt;p&gt;You were right about the Thembs file. When i delete the file it works greate!&lt;/p&gt;
&lt;p&gt;Thx!&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;/Tyronne&lt;/p&gt;</description></item><item><title>Re: An exception of type 'System.OutOfMemoryException</title><link>http://forums.asp.net/thread/3256916.aspx</link><pubDate>Thu, 25 Jun 2009 06:20:33 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3256916</guid><dc:creator>kaushalparik27</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3256916.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=150&amp;PostID=3256916</wfw:commentRss><description>&lt;p&gt;&lt;BLOCKQUOTE&gt;&lt;div&gt;&lt;img src="/Themes/fan/images/icon-quote.gif"&gt; &lt;strong&gt;pointman:&lt;/strong&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="keyword"&gt;foreach&lt;/span&gt;&lt;span&gt;&amp;nbsp;(System.IO.FileInfo&amp;nbsp;fil&amp;nbsp;&lt;/span&gt;&lt;span class="keyword"&gt;in&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;span class="keyword"&gt;new&lt;/span&gt;&lt;span&gt;&amp;nbsp;System.IO.DirectoryInfo(path).GetFiles(&lt;/span&gt;&lt;span class="string"&gt;&amp;quot;*.*&amp;quot;&lt;/span&gt;&lt;span&gt;))&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;/BLOCKQUOTE&gt;&lt;/p&gt;&lt;p&gt;as the above post suggested..&lt;/p&gt;&lt;p&gt;[1] pls check that image may get corrupted- (you can try openning image in default image viewer and check whether its openning correctly)&lt;br /&gt;&lt;/p&gt;&lt;p&gt;also there are other possibilities you can check :&lt;/p&gt;&lt;p&gt;[1] image not in use&lt;/p&gt;&lt;p&gt;[2] as you are getting the file with&amp;nbsp; - &lt;span&gt;.GetFiles(&lt;/span&gt;&lt;span&gt;&amp;quot;*.*&amp;quot;&lt;/span&gt;&lt;span&gt;))&amp;nbsp; - quite possible that there might be other files exists in the same folder other than image type (for example &lt;b&gt;Thembs.db&lt;/b&gt;) and causing the problem&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span&gt;[3] check that proper path of the file are getting in the code..&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span&gt;hope it helps./.&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;</description></item><item><title>Re: An exception of type 'System.OutOfMemoryException</title><link>http://forums.asp.net/thread/3256897.aspx</link><pubDate>Thu, 25 Jun 2009 06:15:15 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3256897</guid><dc:creator>paaresh</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3256897.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=150&amp;PostID=3256897</wfw:commentRss><description>&lt;p&gt;Hi,&lt;/p&gt;&lt;p&gt;please check that your image file is damaged?&lt;/p&gt;&lt;p&gt;if not then check its file attributes.&lt;br /&gt;&lt;/p&gt;</description></item><item><title>An exception of type 'System.OutOfMemoryException</title><link>http://forums.asp.net/thread/3256332.aspx</link><pubDate>Wed, 24 Jun 2009 21:29:21 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3256332</guid><dc:creator>pointman</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3256332.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=150&amp;PostID=3256332</wfw:commentRss><description>&lt;p&gt;hi!&lt;/p&gt;
&lt;p&gt;I got the following error message:&lt;/p&gt;
&lt;p&gt;An exception of type &amp;#39;System.OutOfMemoryException&amp;#39; occurred in System.Drawing.dll but was not handled in user code&lt;/p&gt;
&lt;p&gt;Here is the code:&lt;/p&gt;&lt;pre class="c-sharp" name="code"&gt;private void LoadImages()
            {
                  DataSet ds = new DataSet();
                  dt = ds.Tables.Add(&amp;quot;images&amp;quot;);

                  dt.Columns.Add(&amp;quot;imagename&amp;quot;);
                  dt.Columns.Add(&amp;quot;size&amp;quot;);
                  dt.Columns.Add(&amp;quot;type&amp;quot;);
                  dt.Columns.Add(&amp;quot;Width&amp;quot;);
                  dt.Columns.Add(&amp;quot;Height&amp;quot;);
                  dt.Columns.Add(&amp;quot;deleteFile&amp;quot;);

                  String path = Server.MapPath(&amp;quot;../../News/Images/&amp;quot;);

                  foreach (System.IO.FileInfo fil in new System.IO.DirectoryInfo(path).GetFiles(&amp;quot;*.*&amp;quot;))
                  {
                        System.Drawing.Image objImg = System.Drawing.Image.FromFile(fil.FullName);

                        DataRow rowNew = dt.NewRow();
                        rowNew[&amp;quot;Imagename&amp;quot;] = fil.Name;
                        rowNew[&amp;quot;Size&amp;quot;] = fil.Length / 1024;
                        rowNew[&amp;quot;type&amp;quot;] = fil.Extension;
                        rowNew[&amp;quot;Width&amp;quot;] = objImg.Width;
                        rowNew[&amp;quot;height&amp;quot;] = objImg.Height;
                        rowNew[&amp;quot;deleteFile&amp;quot;] = fil.FullName;
                        dt.Rows.Add(rowNew);
                        objImg.Dispose();

                  }

                  Repeater1.Visible = true;
                  Repeater1.DataSource = dt;
                  Repeater1.DataBind();

            }&lt;/pre&gt;
&lt;p&gt;And the error occurs at the System.Drawing.Image objImg = System.Drawing.Image.FromFile(fil.FullName);&lt;/p&gt;
&lt;p&gt;Any suggestions anyone?&lt;/p&gt;
&lt;p&gt;/Tyronne&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;</description></item></channel></rss>