Page 1 of 1

Multiple crop with the same image

Posted: Mon Jul 28, 2008 9:57 am
by srinivas
Hai,
This is Srinivas...i'm using "Crop" function.I want to crop multiple images from one file without loading original picture.
After croping the image, the old native image replacing with crop image id.


My question is Can i Crop multiple images at a time??
please send any solution to me...

Re: Multiple crop with the same image

Posted: Tue Jul 29, 2008 12:02 pm
by Loïc
Hi,

You can do that using the CreateClonedImage() method.

I give you a code to load image and extract 2 regions from this image:

Code: Select all

Dim nImageSrc As Long
Dim nCropedImage1 As Long
Dim nCropedImage2 As Long


nImageSrc = Imaging1.CreateImageFromFile("input.jpg")
nCropedImage1 = Imaging1.CreateClonedImage(nImageSrc)
nCropedImage2 = Imaging1.CreateClonedImage(nImageSrc)


Imaging1.SetNativeImage (nCropedImage1)
Call Imaging1.Crop(0, 0, 300, 300)


Imaging1.SetNativeImage (nCropedImage2)
Call Imaging1.Crop(300, 300, 300, 300)
Loïc