Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 127197
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T05:26:18+00:00 2026-05-11T05:26:18+00:00

I’m trying to genererate thumbnails from image files stored in a folder under the

  • 0

I’m trying to genererate thumbnails from image files stored in a folder under the website root, I am currently using the built in capebilites in .NET to dynamically generate the thumbnails but the quality gets quite bad and since its an webshop thats a real problem my question is if there is any good (open source?) frameworks that can help me hanlde the image thumbnail creation and rezise and possible help with image file size compression during upload?

I’ve looked but havent found any yet?

Thanks in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T05:26:19+00:00Added an answer on May 11, 2026 at 5:26 am

    I’ve written some code you could use. Please don’t sell it 😉

    This is the code:

    /*  *  Software Developed by Filip Ekberg ( Filip@SmartIT.se )  *   *  For Questions regarding this software, please send me an E-mail  *   */  #region Usings using System; using System.Collections.Generic; using System.Text; using System.Drawing; using System.Drawing.Drawing2D; using System.Drawing.Imaging; #endregion  namespace ImageResizer {     class ImageProcessor     {         #region Members         private int m_imgWidht,                     m_imgHeight,                     m_oImgWidht,                     m_oImgHeight;          private float m_vertRes,                       m_horiRes;          private double m_size = 0.25;          private Bitmap m_Bitmap;         private Graphics m_Graphics;         private Image m_currentImage;          private PixelFormat m_pxlFormat = PixelFormat.Format32bppRgb;         private InterpolationMode m_interpolationMode = InterpolationMode.HighQualityBilinear;         private CompositingQuality m_compositingQuality = CompositingQuality.HighQuality;         private SmoothingMode m_smoothingMode = SmoothingMode.None;         #endregion          #region Access Methods          public int ImageWidth          {             get { return m_imgWidht; }         }         public int ImageHeight         {             get { return m_imgHeight; }         }         public float VerticalResolution         {             get { return m_vertRes; }             set { m_vertRes = value; }         }         public float HorizonalResolution         {             get { return m_horiRes; }             set { m_horiRes = value; }         }          /// <summary>         /// Use ImageSize struct for setting this.         /// </summary>         public double Size         {             get { return m_size; }             set { m_size = value; }         }         public Image ProcessImage         {             get { return m_currentImage; }             set { m_currentImage = value; }         }         public PixelFormat ImagePixelFormat          {             get { return m_pxlFormat; }             set { m_pxlFormat = value; }         }         public InterpolationMode ImageInterpolationMode         {             get { return m_interpolationMode; }             set { m_interpolationMode = value; }         }         public CompositingQuality ImageCompositingQuality         {             get { return m_compositingQuality; }             set { m_compositingQuality = value; }         }         public SmoothingMode ImageSmoothingMode         {             get { return m_smoothingMode; }             set { m_smoothingMode = value; }         }          #endregion          #region Process Image         public Bitmap BeginProcess()         {             if ( m_currentImage == null )                 return null;              m_oImgWidht = m_currentImage.Width;             m_oImgHeight = m_currentImage.Height;              m_vertRes = m_currentImage.VerticalResolution;             m_horiRes = m_currentImage.HorizontalResolution;              m_imgWidht = (int)(m_oImgWidht * (double)m_size);             m_imgHeight = (int)(m_oImgHeight * (double)m_size);               m_Bitmap = new Bitmap(m_imgWidht, m_imgHeight, m_pxlFormat);              m_Bitmap.SetResolution(m_vertRes, m_horiRes);              m_Graphics = Graphics.FromImage(m_Bitmap);              m_Graphics.InterpolationMode = m_interpolationMode;              m_Graphics.CompositingQuality = m_compositingQuality;              m_Graphics.SmoothingMode = m_smoothingMode;              // m_Graphics.DrawImage(m_currentImage, new Rectangle(0, 0, m_imgWidht, m_imgHeight), new Rectangle(0, 0, m_oImgWidht, m_oImgHeight), GraphicsUnit.Pixel);              Rectangle rectDestination = new Rectangle(0, 0, m_imgWidht, m_imgHeight);            // m_Graphics.DrawImage(m_currentImage,            //     new Rectangle(-1, -1, m_oImgWidht + 2, m_oImgHeight + 2),             //    new Rectangle(m_oImgWidht, m_oImgHeight, m_imgWidht, m_oImgHeight),             //    GraphicsUnit.Pixel);             ImageAttributes ia = new ImageAttributes();             ia.SetWrapMode(WrapMode.TileFlipXY);             m_Graphics.DrawImage(m_currentImage, rectDestination, 0, 0, m_oImgWidht, m_oImgHeight, GraphicsUnit.Pixel, ia);               // m_Graphics.Dispose();              return m_Bitmap;         }         #endregion     } } 

    This is how you might use it:

    private ImageProcessor m_processor = new ImageProcessor();   m_currentImage = new Bitmap(currentFile.FullName);                  // Display a Thumbnail of it                 pictureBox1.Image = m_currentImage.GetThumbnailImage(pictureBox1.Width, pictureBox1.Height, null, IntPtr.Zero);                  // Update the Label with Filename and what file is currently processed                 delegate_lblControl(currentFile.Name + '\n' + m_currentProcessedImage + ' / ' + m_fileList.Length);                  // Increase the value on the ProcessBar                 delegate_imageProcessValue(1);                  // Process the Image                 m_processor.ProcessImage = m_currentImage;                  m_processor.Size = m_size;                  m_finalProcessedImage = m_processor.BeginProcess();                  ImageCodecInfo jgpEncoder = GetEncoder(ImageFormat.Jpeg);                 System.Drawing.Imaging.Encoder myEncoder =                     System.Drawing.Imaging.Encoder.Quality;                  EncoderParameters myEncoderParameters = new EncoderParameters(1);                 EncoderParameter myEncoderParameter = new EncoderParameter(myEncoder, m_jpegQuality);                 myEncoderParameters.Param[0] = myEncoderParameter;                   // Save the Image to the Output folder                 m_finalProcessedImage.Save(fldOutput.SelectedPath + '\\' + currentFile.Name, jgpEncoder, myEncoderParameters);                  // Dispose the Images                 m_finalProcessedImage.Dispose();                  m_currentImage.Dispose(); 

    What the code i’ve written actually can do is resize your images to a specific percentage.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a bunch of posts stored in text files formatted in yaml/textile (from
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
link Im having trouble converting the html entites into html characters, (&# 8217;) i
Does anyone know how can I replace this 2 symbol below from the string
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I am trying to loop through a bunch of documents I have to put
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.