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.):
- load the background image with SetImageOverlayFromImageFile2 (Index, FileName) (or another SetImageOverlayFrom... function taking the index as the first parameter)
- assign the chroma key RGB color with SetImageOverlay_ChromaKeyRGBColor (Index, Color)
- adjust the chroma key leeway % (optional) with SetImageOverlay_ChromaKeyLeewayPercent (Index, Percent) (the default value is 25%)
- enable the chroma key with SetImageOverlay_ChromaKey (Index, true)
- enable the image overlay with SetImageOverlay_Enabled (Index, true)
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.