C#
  Home arrow C# arrow Page 5 - Lossless Image Resizing in C#
ASP Free Forums 
.NET  
ASP  
ASP Code  
ASP.NET  
ASP.NET Code  
BrainDump  
C#  
Code Examples  
Database  
Database Code  
IIS  
Microsoft Access  
MS SQL Server  
Silverlight  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
ASP Web Hosting  
ASP.NET Web Hosting 
Windows Web Hosting
 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
C#

Lossless Image Resizing in C#
By: Barzan "Tony" Antal
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 11
    2008-02-20

    Table of Contents:
  • Lossless Image Resizing in C#
  • Color Quantization
  • Getting Started
  • Let's Resize!
  • Completing the Project
  • Final Words

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Lossless Image Resizing in C# - Completing the Project


    (Page 5 of 6 )

    Now that we've finished writing our method and function, we can complete our project by adding the code snippets to the appropriate components to develop those parts which will execute when we click on btnResize and saveFileDialog2's OK button after choosing the destination location. Check 'em out!

    private void btnResize_Click(object sender, EventArgs e)

    {

    saveFileDialog2.Filter = "Joint Photographic Experts Group Format (*.jpg)|*.jpg|" +
    "Graphics Interchange Format (*.gif)|*.gif|" + "Bitmap Format (*.bmp)|*.bmp|" +
    "Portable Network Graphics Format (*.png)|*.png";

    saveFileDialog2.ShowDialog();

    }

    private void saveFileDialog2_FileOk(object sender, CancelEventArgs e)

    {

    string NewFileName = saveFileDialog2.FileName;

    string NewFileExtension = NewFileName.Substring(NewFileName.Length - 3, 3);

    ResizeImage(Int32.Parse(txtWidth.Text), Int32.Parse(txtHeight.Text),
    SelectPicture.FileName, NewFileName, NewFileExtension);

    }

    You see? After completing these blocks of code, we have finished our Lightweight Image Manipulation application. Now just head over to the next page because that's the location to download the archived source code of this entire project. You will also l find some of my closing thoughts and final words regarding this tutorial.

    More C# Articles
    More By Barzan "Tony" Antal


       · Thanks for following this series. This is the second and last part of the "Lossless...
     

    C# ARTICLES

    - Coding a CRC-Generating Algorithm in C
    - Cyclic Redundancy Check
    - Handling Methods and Functions
    - Destroying Objects in C#
    - Creating Objects in C-Sharp
    - Classes and Objects
    - Programming Languages: Managed versus Native
    - LINQ-to-MySQL with DbLinq in C#
    - Working with Dates and Times in C#
    - Generics, Dictionaries, and More
    - More About Generics
    - Working with C# Collections
    - Generics
    - C# and XML
    - Pointers and Arrays in C#





    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 4 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek