This topic and its replies were posted before the current version of LEADTOOLS was released and may no longer be applicable.
#1
Posted
:
Tuesday, December 12, 2006 8:15:19 PM(UTC)
Groups: Registered
Posts: 15
does anybody has VB.Net code to crop an image? I'm using v15 of the Annotation suite
#2
Posted
:
Tuesday, December 12, 2006 11:50:10 PM(UTC)
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.