Chroma Keying

Example requests & Code samples for GdPicture Toolkits.
Post Reply
kenknight
Posts: 7
Joined: Tue Jul 01, 2008 6:18 am

Chroma Keying

Post by kenknight » Tue Jul 15, 2008 2:47 am

Hi all,

Not sure if this is the right forum, however, I'm looking for an Image Library that can take a picture of an object in front of a green screen and replace the green screen with the picture of my choice. Does gdpicture support this?

THanks,
ken

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

Re: Chroma Keying

Post by Loïc » Tue Jul 15, 2008 11:55 am

Hi,

You can do that easily using the DrawImageTransparencyColorEx() method of the GdPicture Pro component:

Code: Select all

 Dim nMainImage As Long
 Dim nBackGroundImage As Long

 nBackGroundImage = Imaging1.CreateImageFromFile("landscape.jpg") 'image to draw on red background
 nMainImage = Imaging1.CreateImageFromFile("c:\main.jpg") 'image with Red background
 Imaging1.SetNativeImage (nBackGroundImage)

 Call Imaging1.DrawImageTransparencyColorEx(nMainImage, Green, 95, 0, 0, Imaging1.GetWidth, Imaging1.GetHeight)
 
 Call Imaging1.SaveAsJPEG("output.jpg")

 Call Imaging1.CloseImage(nMainImage)
 Call Imaging1.CloseImage(nBackGroundImage)
Best regards,

Loïc

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest