How to copy and pastle image

Example requests & Code samples for GdPicture Toolkits.
Post Reply
walter
Posts: 1
Joined: Wed Mar 19, 2008 4:28 pm

How to copy and pastle image

Post by walter » Wed Mar 19, 2008 4:35 pm

I am GdPicturePro4 and I am trying to develop a process that cut an image
And paste on another image, and that this image has sandwiched possibility of moving
With the mouse, with the possibility of putting in to fix the image anywhere on
Image superimposed.

What is the function that use of gdpicturepro4 to copy and paste?

What is the function that I use to move the pasted image with the mouse?

Thankful now,

David Ricardo Silva Moura
Brazil

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

Re: How to copy and pastle image

Post by Loïc » Thu Mar 27, 2008 12:10 pm

Hi,

There are several ways to perform this operation.

The sample I give below uses GetPixelArray1D() & SetPixelArray() methods.
It loads input1.jpg image, copies the rectangle of coordinate (0, 0, 100, 100) into arPixels() buffer then pastles the area to input2.jpg image :

Code: Select all

Dim arPixels() As Long

Imaging1.CreateImageFromFile ("input1.jpg")
Call Imaging1.GetPixelArray1D(arPixels, 0, 0, 100, 100)
Imaging1.CloseNativeImage
Imaging1.CreateImageFromFile ("input2.jpg")
Call Imaging1.SetPixelArray(arPixels, 0, 0, 100, 100)
Call Imaging1.SaveAsJPEG("output.jpg")
Imaging1.CloseNativeImage

Erase arPixels

Best regards,

Loïc Carrère

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest