Windows Scripting
  Home arrow Windows Scripting arrow Simplified Image Processing in GDI+
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 
Mobile Linux 
App Generation ROI 
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? 
WINDOWS SCRIPTING

Simplified Image Processing in GDI+
By: Xianzhong Zhu
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating:  stars stars stars stars stars / 0
    2008-09-10

    Table of Contents:
  • Simplified Image Processing in GDI+
  • Meta File Support in GDI
  • Sample One-Record and Replay Metafiles
  • Sample Two-Clipping and Scaling Images
  • Sample Three-Use Interpolation to Output
  • Sample Four-Flipping an Image

  • 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


    Simplified Image Processing in GDI+


    (Page 1 of 6 )

    With GDI+ coming into its own in the two-dimensional image processing field, image processing was drastically simplified. Those who have become accustomed to traditional GDI may feel a bit puzzled with the image handling introduced in GDI+. Once they grow accustomed to the differences, which should happen quickly, they will probably prefer GDI+. Keep reading to find out why, and to learn GDI+'s image processing methods through several examples. This article is the first of two parts.

    Introduction

    With GDI+, users of traditional GDI will notice that they can no longer find the troublesome DIB or DDB concepts, nor can they find data structures such as the BMP file header and the BMP-related palette which brought so much trouble to Windows GDI developers. In GDI+, there are almost no absolute limits between various picture files. A typical example is that in GDI+ you may find that you can use almost the same means to manipulate BMP files as you do with JPEG or PNG format files.

    Digging deeper into GDI+, you will see that there are three main classes, i.e. Image, Bitmap, and Metafile, introduced to deal with common and typical image processing. The Bitmap class provides methods to load, save, and handle raster images, which to some degree expands the abilities of the Image class. In contrast, the Metafile class has enhanced the Image class by introducing additional methods to record and validate vector images.

    There are many concepts as well as higher theories with images. However, we are not going to dwell much on these monotonous and bald doctrines. In this article, I will show you the richer and easier support available in GDI+ to process images through several samples.

    Open and Render Images

    There are mainly two classes introduced to manipulate and maintain image processing, i.e. Image and Bitmap. The Bitmap class derives from the base class Image. Here we are mainly interested in the Bitmap class.

    There are 12 variations of constructor for the Bitmap class. As for rendering an image file, this is typically performed using the DrawImage methods of the Graphics class-there are 30 kinds of definitions for the DrawImage method. There are so many rich invocations for the DrawImage method that you can deal with an image in GDI+ with great ease and flexibility. For example, the functionalities, rotating, and inverting, interpolating with any special angle, that can not be directly accomplished using the API BitBlt() in GDI can now be easily achieved using the DrawImage method in GDI+.

    Here we do not plan to list the dozens of variations of the DrawImage method, but summarize what you can do with it:

    1. You can use the DrawImage method to render many kinds of images at the specified locations as well as scaling them.
    2. You can utilize the point information in the screen to describe the location of an image using the DrawImage method to rotate it at any specified angle, which is quite different from what you can achieve using the coordination transformation in the drawing plane.
    3. If the ImageAttributes function is enabled in the DrawImage method, you can validate the color information of an image as well as specify the color-rendering channel.

    More Windows Scripting Articles
    More By Xianzhong Zhu


     

    WINDOWS SCRIPTING ARTICLES

    - Introducing Two-Way Data Binding using Silve...
    - Silverlight 2.0 Application Development with...
    - Burning Multisession CDs with IMAPI2 in WSH
    - Creating a Silverlight 2.0 Application that ...
    - Burning CDs with the IMAPI2 Control
    - Burning CDs in Windows XP with WSH
    - Advanced Word Object Scripting
    - Reading and Printing Word Documents in WSH
    - Scripting Microsoft Word
    - Using WSH to Catalog MP3 Files
    - Reading MP3 ID3 Tags in WSH
    - A Brief Look at Menus in WPF
    - More Examples of Simplified Image Processing...
    - Completing a WPF To-Do List Application
    - Simplified Image Processing in GDI+





    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway
    Stay green...Green IT