<?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: How to Resize an Image in ASP.NET?</title><link>http://forums.asp.net/thread/958924.aspx</link><pubDate>Thu, 16 Jun 2005 11:43:10 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:958924</guid><dc:creator>JasonFollas</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/958924.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=150&amp;PostID=958924</wfw:commentRss><description>&lt;P&gt;&lt;FONT face=Verdana size=2&gt;Your width is a constant reduction (25% of original size), which makes it slightly easier rather than trying to take any dimension and scale to 50px wide...&lt;BR&gt;&lt;BR&gt;1. Load the original into an Image object, and get the height.&lt;BR&gt;2. Create a new Bitmap with&amp;nbsp;a width and height that is 25% of original values.&lt;BR&gt;3. Get a Graphics object for the bitmap.&lt;BR&gt;4. Draw the original onto the bitmap, specifying a rectangle the size of the bitmap&lt;BR&gt;5. Save file (or do whatever you need to do with it).&lt;BR&gt;6. Dispose objects.&lt;BR&gt;&lt;/FONT&gt;&lt;BR&gt;&lt;FONT face="Courier New" size=2&gt;System.Drawing.Image original = System.Drawing.Image.FromFile(@"c:\10yearsreunion.jpg");&lt;BR&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff&gt;&lt;BR&gt;&lt;FONT face="Courier New" size=2&gt;int&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt; height = original.Height;&lt;BR&gt;&lt;FONT color=#0000ff&gt;int&lt;/FONT&gt; width = original.Width;&lt;BR&gt;&lt;BR&gt;System.Drawing.Bitmap newPic = &lt;FONT color=#0000ff&gt;new&lt;/FONT&gt; System.Drawing.Bitmap(width/4, height/4);&lt;BR&gt;&lt;BR&gt;System.Drawing.Graphics gr = System.Drawing.Graphics.FromImage(newPic);&lt;BR&gt;gr.DrawImage(original, 0, 0, (width/4), (height/4));&lt;BR&gt;&lt;BR&gt;newPic.Save(@"c:\10yearsreuinion_25pct.jpg", System.Drawing.Imaging.ImageFormat.Jpeg);&lt;BR&gt;&lt;BR&gt;gr.Dispose();&lt;BR&gt;newPic.Dispose();&lt;BR&gt;original.Dispose();&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;BR&gt;&lt;BR&gt;&lt;FONT face="Courier New"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;</description></item><item><title>Re: How to Resize an Image in ASP.NET?</title><link>http://forums.asp.net/thread/958567.aspx</link><pubDate>Thu, 16 Jun 2005 02:16:38 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:958567</guid><dc:creator>DarrellNorton</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/958567.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=150&amp;PostID=958567</wfw:commentRss><description>Here's one article:&lt;br&gt;
&lt;a href="http://west-wind.com/weblog/posts/283.aspx"&gt;Creating Thumbnail Images on the fly with ASP.NET&lt;/a&gt;&lt;br&gt;
&lt;br&gt;</description></item><item><title>How to Resize an Image in ASP.NET?</title><link>http://forums.asp.net/thread/958348.aspx</link><pubDate>Wed, 15 Jun 2005 21:26:36 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:958348</guid><dc:creator>shapper</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/958348.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=150&amp;PostID=958348</wfw:commentRss><description>Hello,&lt;br&gt;
&lt;br&gt;
In each record of an ASP.Net Repeater I have an image which original
size is 200px width and with a height which can vary from record to
record.&lt;br&gt;
&lt;br&gt;
How can I resize each image to 50px and keep its proportion?&lt;br&gt;
&lt;br&gt;
Does anyone know how to do this? &lt;br&gt;
&lt;br&gt;
Thank You,&lt;br&gt;
Miguel&lt;br&gt;</description></item></channel></rss>