Multiple crop with the same image

Example requests & Code samples for GdPicture Toolkits.
Post Reply
srinivas
Posts: 1
Joined: Fri Jul 25, 2008 8:29 am

Multiple crop with the same image

Post by srinivas » Mon Jul 28, 2008 9:57 am

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...

User avatar
Loïc
Site Admin
Posts: 5881
Joined: Tue Oct 17, 2006 10:48 pm
Location: France
Contact:

Re: Multiple crop with the same image

Post by Loïc » Tue Jul 29, 2008 12:02 pm

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

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest