Microsoft DirectX 8.0 |
Creates a continuous video image of a solid color.
Class ID (CLSID): 1c621200-67b2-11d2-9eeb-006008039e37
CLSID Variable Name: CLSID_ColorSource
Properties
Property Type Default Description Color DWORD 0 Color to generate. The value of this attribute is a hexadecimal number with the format 0xAARRGGBB, where AA is the alpha value, RR is the red value, GG is the green value, and BB is the blue value. Alpha values range from 0x00 (transparent) to 0xFF (opaque). The property is static and must be applied at time zero.
Remarks
The Video Color Source is used with source objects. First, create a new source object. Then set the source object's subobject GUID to CLSID_ColorSource, by calling the IAMTimelineObj::SetSubobjectGUID method.
To set the color, create a property setter object and apply the Color property at time zero. The Video Color Source does not support dynamic changes to this property; the value cannot change over time.
The following code example shows how to use this object. For more information about using IPropertySetter, see Setting Properties on Effects and Transitions:
DWORD dwYellow = 0xFFFF00; IAMTimelineObj *pSource = NULL; IPropertySetter *pProp = NULL; pTimeline->CreateEmptyNode(&pSourceObj, TIMELINE_MAJOR_TYPE_SOURCE); pSource->SetStartStop(0, 50000000); pSource->SetSubObjectGUID(CLSID_ColorSource); // Create a property setter. CoCreateInstance(CLSID_PropertySetter, NULL, CLSCTX_INPROC_SERVER, IID_IPropertySetter, (void**) &pProp); // Set the color. DEXTER_PARAM param; DEXTER_VALUE val; param.Name = SysAllocString(L"Color"); param.dispID = 0; param.nValues = 1; val.v.vt = VT_I4; val.v.lVal = dwYellow; val.rt = 0; // Time must be zero. val.dwInterp = DEXTERF_JUMP; pProp->AddProp(param, &val); pSource->SetPropertySetter(pProp); // Clean up. SysFreeString(param.Name); VariantClear(&val.v)); pProp->Release();The following example shows the XML representation of the object created in the previous example. In this case the PARAM tag does not support AT or LINEAR tags, because the object does not support dynamic properties:
<clip start="0" stop="5" clsid="{0CFDD070-581A-11D2-9EE6-006008039E37}"> <param name="Color" value="16776960"/> </clip>