You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openoffice.apache.org by Regina Henschel <rb...@t-online.de> on 2012/08/06 02:09:45 UTC

Understanding custom shapes

Hi all,

I'm currently learning, how custom shapes work. I know already, how to 
write them directly in the XML file format, I understand what I see in 
Basic, I understand mso_sptxxxVer[], mso_sptxxxCalc[], and 
mso_sptxxxGluePoints[].

But now I stuck with mso_sptxxxSegm[]. I understand the "Segments" as 
they are shown in Basic, but I cannot map that to mso_sptxxxSegm[].

For example for custom shape "Parallelogram" I see in Basic:
Command Count Command Count Command Count Command Count
    1      1      2      3      4      0      5     0
which is
M L L L Z N

In mso_sptParallelogramSegm[] I read
    0x4000, 0x0003, 0x6001, 0x8000
and have no idea, how that fits together.

Can someone give me a pointer or explain it to me?

Kind regards
Regina

Re: Understanding custom shapes

Posted by Regina Henschel <rb...@t-online.de>.
Hi Jianyuan,

Jianyuan Li schrieb:
> Hi, Regina,
>
> The attachment has been sent you directly.
>

Thanks, I've got the file. And the hint to [MS-ODRAW].pdf has been very 
useful too. I think, I understand the values in mso..Segm[] now :)

Kind regards
Regina

>
> 2012/8/6 Jianyuan Li <li...@gmail.com>
>
>> This time attachment is provided with doc file.
>> I think mso..Segm[] use a different numbering pattern. You can find more
>> details for them in MS specification "[MS-ODRAW].pdf".
>>
>>
>> 2012/8/6 Regina Henschel <rb...@t-online.de>
>>
>>> Hi Jianyuan,
>>>
>>> thanks for your answer. Unfortunately the attachment was stripped. Can
>>> you please sent me the attachment directly or provide it for download?
>>>
>>> Jianyuan Li schrieb:
>>>
>>>   Hi, Regina,
>>>>
>>>> Below is my understanding for custom shape segment.
>>>> An segment is consist of two parts: command and count. It is described
>>>> with
>>>> an integer with two bytes. The high byte describes command and the low
>>>> byte
>>>> describes count. For the high byte, the high 3 bits is used to show the
>>>> basic command and the low 5 bits is used to show extended command. See my
>>>> attachment for details.
>>>> Taking "0x4000" as an example, it means command is moveto and count is 0.
>>>> Moveto is shown with "2" and occupy the first 3 bits of high byte. So
>>>> 0x40
>>>> will be calculated.
>>>>
>>>
>>> The values shown in Basic follow the EnhancedCustomShapeSegmentComm**and
>>> from the idl reference. There MOVETO is 1. Does mso..Segm[] use a different
>>> numbering pattern?
>>>
>>> Kind regards
>>> Regina
>>>
>>>
>>>
>>>
>>>> 2012/8/6 Regina Henschel <rb...@t-online.de>
>>>>
>>>>   Hi all,
>>>>>
>>>>> I'm currently learning, how custom shapes work. I know already, how to
>>>>> write them directly in the XML file format, I understand what I see in
>>>>> Basic, I understand mso_sptxxxVer[], mso_sptxxxCalc[], and
>>>>> mso_sptxxxGluePoints[].
>>>>>
>>>>> But now I stuck with mso_sptxxxSegm[]. I understand the "Segments" as
>>>>> they
>>>>> are shown in Basic, but I cannot map that to mso_sptxxxSegm[].
>>>>>
>>>>> For example for custom shape "Parallelogram" I see in Basic:
>>>>> Command Count Command Count Command Count Command Count
>>>>>      1      1      2      3      4      0      5     0
>>>>> which is
>>>>> M L L L Z N
>>>>>
>>>>> In mso_sptParallelogramSegm[] I read
>>>>>      0x4000, 0x0003, 0x6001, 0x8000
>>>>> and have no idea, how that fits together.
>>>>>
>>>>> Can someone give me a pointer or explain it to me?
>>>>>
>>>>> Kind regards
>>>>> Regina
>>>>>
>>>>>
>>>>
>>>
>>
>


Re: Understanding custom shapes

Posted by Jianyuan Li <li...@gmail.com>.
Hi, Regina,

The attachment has been sent you directly.


2012/8/6 Jianyuan Li <li...@gmail.com>

> This time attachment is provided with doc file.
> I think mso..Segm[] use a different numbering pattern. You can find more
> details for them in MS specification "[MS-ODRAW].pdf".
>
>
> 2012/8/6 Regina Henschel <rb...@t-online.de>
>
>> Hi Jianyuan,
>>
>> thanks for your answer. Unfortunately the attachment was stripped. Can
>> you please sent me the attachment directly or provide it for download?
>>
>> Jianyuan Li schrieb:
>>
>>  Hi, Regina,
>>>
>>> Below is my understanding for custom shape segment.
>>> An segment is consist of two parts: command and count. It is described
>>> with
>>> an integer with two bytes. The high byte describes command and the low
>>> byte
>>> describes count. For the high byte, the high 3 bits is used to show the
>>> basic command and the low 5 bits is used to show extended command. See my
>>> attachment for details.
>>> Taking "0x4000" as an example, it means command is moveto and count is 0.
>>> Moveto is shown with "2" and occupy the first 3 bits of high byte. So
>>> 0x40
>>> will be calculated.
>>>
>>
>> The values shown in Basic follow the EnhancedCustomShapeSegmentComm**and
>> from the idl reference. There MOVETO is 1. Does mso..Segm[] use a different
>> numbering pattern?
>>
>> Kind regards
>> Regina
>>
>>
>>
>>
>>> 2012/8/6 Regina Henschel <rb...@t-online.de>
>>>
>>>  Hi all,
>>>>
>>>> I'm currently learning, how custom shapes work. I know already, how to
>>>> write them directly in the XML file format, I understand what I see in
>>>> Basic, I understand mso_sptxxxVer[], mso_sptxxxCalc[], and
>>>> mso_sptxxxGluePoints[].
>>>>
>>>> But now I stuck with mso_sptxxxSegm[]. I understand the "Segments" as
>>>> they
>>>> are shown in Basic, but I cannot map that to mso_sptxxxSegm[].
>>>>
>>>> For example for custom shape "Parallelogram" I see in Basic:
>>>> Command Count Command Count Command Count Command Count
>>>>     1      1      2      3      4      0      5     0
>>>> which is
>>>> M L L L Z N
>>>>
>>>> In mso_sptParallelogramSegm[] I read
>>>>     0x4000, 0x0003, 0x6001, 0x8000
>>>> and have no idea, how that fits together.
>>>>
>>>> Can someone give me a pointer or explain it to me?
>>>>
>>>> Kind regards
>>>> Regina
>>>>
>>>>
>>>
>>
>

Re: Understanding custom shapes

Posted by Jianyuan Li <li...@gmail.com>.
This time attachment is provided with doc file.
I think mso..Segm[] use a different numbering pattern. You can find more
details for them in MS specification "[MS-ODRAW].pdf".

2012/8/6 Regina Henschel <rb...@t-online.de>

> Hi Jianyuan,
>
> thanks for your answer. Unfortunately the attachment was stripped. Can you
> please sent me the attachment directly or provide it for download?
>
> Jianyuan Li schrieb:
>
>  Hi, Regina,
>>
>> Below is my understanding for custom shape segment.
>> An segment is consist of two parts: command and count. It is described
>> with
>> an integer with two bytes. The high byte describes command and the low
>> byte
>> describes count. For the high byte, the high 3 bits is used to show the
>> basic command and the low 5 bits is used to show extended command. See my
>> attachment for details.
>> Taking "0x4000" as an example, it means command is moveto and count is 0.
>> Moveto is shown with "2" and occupy the first 3 bits of high byte. So 0x40
>> will be calculated.
>>
>
> The values shown in Basic follow the EnhancedCustomShapeSegmentComm**and
> from the idl reference. There MOVETO is 1. Does mso..Segm[] use a different
> numbering pattern?
>
> Kind regards
> Regina
>
>
>
>
>> 2012/8/6 Regina Henschel <rb...@t-online.de>
>>
>>  Hi all,
>>>
>>> I'm currently learning, how custom shapes work. I know already, how to
>>> write them directly in the XML file format, I understand what I see in
>>> Basic, I understand mso_sptxxxVer[], mso_sptxxxCalc[], and
>>> mso_sptxxxGluePoints[].
>>>
>>> But now I stuck with mso_sptxxxSegm[]. I understand the "Segments" as
>>> they
>>> are shown in Basic, but I cannot map that to mso_sptxxxSegm[].
>>>
>>> For example for custom shape "Parallelogram" I see in Basic:
>>> Command Count Command Count Command Count Command Count
>>>     1      1      2      3      4      0      5     0
>>> which is
>>> M L L L Z N
>>>
>>> In mso_sptParallelogramSegm[] I read
>>>     0x4000, 0x0003, 0x6001, 0x8000
>>> and have no idea, how that fits together.
>>>
>>> Can someone give me a pointer or explain it to me?
>>>
>>> Kind regards
>>> Regina
>>>
>>>
>>
>

Re: Understanding custom shapes

Posted by Regina Henschel <rb...@t-online.de>.
Hi Jianyuan,

thanks for your answer. Unfortunately the attachment was stripped. Can 
you please sent me the attachment directly or provide it for download?

Jianyuan Li schrieb:
> Hi, Regina,
>
> Below is my understanding for custom shape segment.
> An segment is consist of two parts: command and count. It is described with
> an integer with two bytes. The high byte describes command and the low byte
> describes count. For the high byte, the high 3 bits is used to show the
> basic command and the low 5 bits is used to show extended command. See my
> attachment for details.
> Taking "0x4000" as an example, it means command is moveto and count is 0.
> Moveto is shown with "2" and occupy the first 3 bits of high byte. So 0x40
> will be calculated.

The values shown in Basic follow the EnhancedCustomShapeSegmentCommand 
from the idl reference. There MOVETO is 1. Does mso..Segm[] use a 
different numbering pattern?

Kind regards
Regina


>
> 2012/8/6 Regina Henschel <rb...@t-online.de>
>
>> Hi all,
>>
>> I'm currently learning, how custom shapes work. I know already, how to
>> write them directly in the XML file format, I understand what I see in
>> Basic, I understand mso_sptxxxVer[], mso_sptxxxCalc[], and
>> mso_sptxxxGluePoints[].
>>
>> But now I stuck with mso_sptxxxSegm[]. I understand the "Segments" as they
>> are shown in Basic, but I cannot map that to mso_sptxxxSegm[].
>>
>> For example for custom shape "Parallelogram" I see in Basic:
>> Command Count Command Count Command Count Command Count
>>     1      1      2      3      4      0      5     0
>> which is
>> M L L L Z N
>>
>> In mso_sptParallelogramSegm[] I read
>>     0x4000, 0x0003, 0x6001, 0x8000
>> and have no idea, how that fits together.
>>
>> Can someone give me a pointer or explain it to me?
>>
>> Kind regards
>> Regina
>>
>


Re: Understanding custom shapes

Posted by Jianyuan Li <li...@gmail.com>.
Hi, Regina,

Below is my understanding for custom shape segment.
An segment is consist of two parts: command and count. It is described with
an integer with two bytes. The high byte describes command and the low byte
describes count. For the high byte, the high 3 bits is used to show the
basic command and the low 5 bits is used to show extended command. See my
attachment for details.
Taking "0x4000" as an example, it means command is moveto and count is 0.
Moveto is shown with "2" and occupy the first 3 bits of high byte. So 0x40
will be calculated.

2012/8/6 Regina Henschel <rb...@t-online.de>

> Hi all,
>
> I'm currently learning, how custom shapes work. I know already, how to
> write them directly in the XML file format, I understand what I see in
> Basic, I understand mso_sptxxxVer[], mso_sptxxxCalc[], and
> mso_sptxxxGluePoints[].
>
> But now I stuck with mso_sptxxxSegm[]. I understand the "Segments" as they
> are shown in Basic, but I cannot map that to mso_sptxxxSegm[].
>
> For example for custom shape "Parallelogram" I see in Basic:
> Command Count Command Count Command Count Command Count
>    1      1      2      3      4      0      5     0
> which is
> M L L L Z N
>
> In mso_sptParallelogramSegm[] I read
>    0x4000, 0x0003, 0x6001, 0x8000
> and have no idea, how that fits together.
>
> Can someone give me a pointer or explain it to me?
>
> Kind regards
> Regina
>