Welcome Guest! To enable all features, please Login or Register.

Notification

Icon
Error

Options
View
Last Go to last post Unread Go to first unread post
#1 Posted : Tuesday, December 12, 2006 8:15:19 PM(UTC)

Chris T  
Chris T

Groups: Registered
Posts: 15


does anybody has VB.Net code to crop an image? I'm using v15 of the Annotation suite
 

Try the latest version of LEADTOOLS for free for 60 days by downloading the evaluation: https://www.leadtools.com/downloads

Wanna join the discussion? Login to your LEADTOOLS Support accountor Register a new forum account.

#2 Posted : Tuesday, December 12, 2006 11:50:10 PM(UTC)

Adnan Ismail  
Guest

Groups: Guests
Posts: 3,022

Was thanked: 2 time(s) in 2 post(s)


The following code trims 100 pixels off of each side of an image:














































Public Sub CropCommandExample()
 RasterCodecs.Startup()
 Dim codecs As RasterCodecs = New RasterCodecs()
 Dim srcFileName As String = "C:\Program Files\LEAD Technologies\LEADTOOLS 15\Images\Image1.cmp"
 Dim destFileName As String = "C:\Program Files\LEAD Technologies\LEADTOOLS 15\Images\CropCommand.bmp"
 ' Load the source image from disk
 Dim image As RasterImage = codecs.Load(srcFileName)
 ' Crop 100 pixels from each side of the image
 Dim command As CropCommand = New CropCommand()
 command.Rectangle = New Rectangle(100, 100, image.Width - 100, image.Height - 100)
 command.Run(image)
 ' Save it to disk
 codecs.Save(image, destFileName, RasterImageFormat.Bmp, 24)
 ' Clean Up
 image.Dispose()
 RasterCodecs.Shutdown()
End Sub


For more information, please refer to the "CropCommand Class" topic in the LEADTOOLS .NET help file
 
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Powered by YAF.NET | YAF.NET © 2003-2024, Yet Another Forum.NET
This page was generated in 0.057 seconds.