SunQuest
 
       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  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
ASP Web Hosting  
ASP.NET Web Hosting 
Dedicated Servers 
Actuate Whitepapers 
VeriSign Whitepapers 
Windows Web Hosting
 
IBM® developerWorks 
Sun Developer Network 
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: 5 stars5 stars5 stars5 stars5 stars / 4
    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

    Generate data entry and reporting .NET Web apps in minutes, straight from your database. Read our FREE whitepaper “Build Web 2.0 Applications Without Hand-Coding” Download now!

    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

    - Exceptions in C#
    - Overriding versus Overloading
    - Value Types and Reference Types
    - Defining Member and Type Visibility
    - Managing Files in C#
    - Working with Windows Registry in C#
    - Lossless Image Resizing in C#
    - Lossless Image Converting in C#
    - Creating an RSS Feed with ASP.Net Written in...
    - Polymorphism in C#
    - Inheritance in C#
    - C# Events Explained
    - C# Delegates Explained
    - C# StreamReader and StreamWriter Explained
    - C# FileStream Explained

    Click Here




    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway