Skip to content

Chroma key

The chroma key feature uses an image overlay. It is activated as follows, for the image overlay of the chosen index (index 0 for the 1st image overlay, index 1 for the 2nd, etc.):

When the chroma key is enabled, the image overlay is stretched to the video size.

E.g., with the 1st image overlay (index 0):

VideoGrabber.PlayerFileName := 'my video clip.avi';
VideoGrabber.SetImageOverlayFromImageFile2 (0, 'my background image.jpg');
VideoGrabber.SetImageOverlay_ChromaKeyRGBColor (0, $FF0000); // the blue color
VideoGrabber.SetImageOverlay_ChromaKeyLeewayPercent (0, 20); // 20%
VideoGrabber.SetImageOverlay_ChromaKey (0, true);
VideoGrabber.SetImageOverlay_Enabled (0, true);
VideoGrabber.OpenPlayer;

To use several image overlays, see "Applying several image overlays concurrently" in the Image overlays chapter.