Direct2D custom effects registration XML with variable numbers of input

나느 41 Reputation points
2022-11-29T21:05:32.493+00:00

By using nf-d2d1_1-id2d1factory1-registereffectfromstring, one needs an XML registration string to register an effect. I want to make an effect with variable inputs like Composite effect, however, it seemed that an XML registration string have fixed <Input> properties. how can I make an effect have variable inputs?

My XML string is this:

    auto xml_AxisRotation = XML(  
        <?xml version='1.0'?>  
        <Effect>  
            <!--System Properties-->  
            <Property name='DisplayName' type='string' value='MultiInput Effect'/>  
            <Property name='Author' type='string' value='Nan_ok'/>  
            <Property name='Category' type='string' value='None'/>  
            <Property name='Description' type='string' value='asdfasdfasdf'/>  
            <Inputs>  
                <Input name='Source1'/>  
                <Input name='Source2'/>  
                //...?  
            </Inputs>  
            <!--Custom Properties go here-->  
            <Property name='Mode' type='int32'>  
                <Property name='DisplayName' type='string' value='Mode'/>  
                <Property name='Default' type='int32' value='1'/>  
            </Property>  
        </Effect>  
    );  
Windows API - Win32
Windows API - Win32
A core set of Windows application programming interfaces (APIs) for desktop and server applications. Previously known as Win32 API.
2,427 questions
0 comments No comments
{count} votes

Accepted answer
  1. Jeanine Zhang-MSFT 9,181 Reputation points Microsoft Vendor
    2022-11-30T02:28:04.08+00:00

    Hello,

    Welcome to Microsoft Q&A!

    According to the Doc: Adding custom properties to an effect

    For each property, an effect can optionally specify default, min, and max values. These values are for informational use only. They are not enforced by Direct2D. It is up to you to implement any specified default/min/max logic in the effect class yourself.

    I suggest you could implement any specified default/min/max logic in the effect class yourself.

    Thank you.

    Jeanine


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful