Tips Station Asp.net Article Seo Articles
Tutorials Code Samples
›  Home
›  Mission
›  About us
›  Contact Us
›  Feedback
›  Terms & Condition
Asp Articles
IT Solutions
 
› ASP.NET

› Programming Tips

› Ajax

› Asp

› ADO.NET

› Databases

› SEO

› CSS And Designing

› Php

 
Most Viewed Articles
 
› Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.

› Change theme dynamically without page refresh in ASP.NET

› Install AJAX On Machines Running Visual Studio 2005

› Creating Pretty Popups Using AJAX

› Simple ASP Image Resize Function

› SQL Server Performance Counters

› ASP.Net Interview Questions And Their Answers

› Encode Url using ASP

› Difference Between DataGrid and GridView in Asp.Net

› Select Specific Value WithIn Drop Down List Or Radio Button List

more...
 
 
Home> Programming Tips
 
How to crop an Image in Asp.Net
 

An example function to crop an existing image based on parameterised points

Private Function CropImage(ByVal OriginalImage As Bitmap, ByVal TopLeft As Point, ByVal BottomRight As Point) As Bitmap  
     Dim btmCropped As New Bitmap((BottomRight.Y - TopLeft.Y), (BottomRight.X - TopLeft.X))  
       Dim grpOriginal As Graphics = Graphics.FromImage(btmCropped)  
      
        grpOriginal.DrawImage(OriginalImage, New Rectangle(0, 0, btmCropped.Width, btmCropped.Height), _  
            TopLeft.X, TopLeft.Y, btmCropped.Width, btmCropped.Height, GraphicsUnit.Pixel)  
        grpOriginal.Dispose()  
      
        Return btmCropped  
   End Function 

Example usage:

   1. Dim bmpImage As New Bitmap("c:\point.jpg") 
   2. bmpImage = CropImage(bmpImage, New Point(0, 0), New Point(100, 100))

 
 
Vrp Technologies
 
Serversea Hosting
 
 
Latest Articles
 
› Sending SMS With PHP

› MySQL Join Tutorial

› Make An RSS Feed Using PHP

› Intro To Object: Option Variables

› Design An Online Chat Room With PHP And MySQL

› Create Tell A Friend Script With HTML & PHP

› Benchmark And Optimize PHP Script Speed

› What Kind of DBA Are You?

› SQL Server Performance Counters

› SQL Server Performance Tips

more...
 
Random Articles
 
› Read and display a text file in Asp.net

› Cache Data within your Application - Asp.Net

› Add a Confirmation popup to a Button in Asp.Net

› How to Start with ASP.NET AJAX

› Displaying Data using ASP.NET 2.0 GridView

› How to crop an Image in Asp.Net

› Displaying an RSS Feed using ASP

› Benchmark And Optimize PHP Script Speed

› MySQL Join Tutorial

› Ajax - The Basics

more...
 
Home Mission About us Contact us Feedback Terms Conditions
2008 © Copyright TipsStation. All rights reserved.