[VML目次へ] [ホーム]

[VML考察1][VML考察2][VML fill][VML stroke][VMLのshadowサブエレメント][VML extructionの属性][VMLのskewサブエレメント][画像を回転][VML作成]

 

VML の shadowサブエレメントについて

TAXIが勝手に解釈している部分があります。間違いが必ずあるという認識はしておいてください。

 

オリジナルは、MSDN -  MSDN Library - Web Development - HTML and CSS - Web Multimedia - Vector Markup Language (VML) - VML Reference

にあります。United State (English)です。日本語MSDNにはありません。

 

Shadow Element  Defines a shadow for a shape.The following attributes modify a shadow.
 
(訳) 影要素  形のための影を定義します。次の属性は影を修正します。

 shapeエレメントのサブエレメント。主要エレメントにはなりません。v:imageやv:groupにも当てはめるjことはできません。v:ovalやv:rectなどはOKです。

押し出し(Extructionサブエレメント)が有る場合は、影は描画されない。

 最低限のshadowサブ工メント有効・・・<v:shadow on="True" />のみをサブエレメントとして入れてみた。

 <v:shape strokecolor="red"  fillcolor="yellow" style="border:blue solid 1px; width:100; height:100; rotation:0; position:absolute; left:100; top:100" coordsize="100,100" coordorigin="0,0" path="m 0 -57 c -66 -91 -101 20 0 67 c 101 20 66 -91 0 -57 x m 0 -33 c -38 -56 -67 -7 0 44 c 67 -7 38 -56 0 -33  x wr -2 -2 2 2 -1000 -1000 -1000 -999 x e">
 <v:shadow on="True" />
</v:shape >

ブルーの長方形は、shapeのborder

             

 

赤は構文。スクリプトでは、element.Atrribute-"属性値"。HTML+TIMEでは、atrributename="Atrribute" to="属性値"。
VMLタグでは、<v: shadow Atrribute="属性値" />
 

青はW3Cノート VMLより

Attribute(属性) Description (説明)
Color Defines the color of a shadow.

影の色を定義します。

主シャドウの色。WEBカラー名・16進数カラーコード・RGB(r,g,b)はOKのようだ。

デフォルト値は gray RGB(128,128,128)

color="属性値 "  

 

<v:shadow on="True" color="green"/>

             

<v:shadow on="True" color="rgb(255,255,0)"/>

             

 

Color2

Defines the second color of a shadow. See the Type attribute for more information about second colors.

影の第二色を定義します。第2の色に関してより詳細には、タイプ属性を参照してください。

副シャドウ、または浮き彫りシャドウ、彫り込みシャドウのハイライトの色。 WEBカラー名・16進数カラーコード・RGB(r,g,b)はOKのようだ。
???type="double"の場合のみ?embossはあまり意味無い様だし・・・。

デフォルト値は gray RGB(203,203,203)

color2="属性値"

<v:shadow on="True" color="green" color2="red" type="emboss" />

             

<v:shadow on="True" color="green" color2="blue" type="double" />

             

<v:shadow on="True" color="green" color2="blue" type="single" />

             

<v:shadow on="True" color="green" color2="blue" type="perspective" />

             

 

Matrix
Specifies the amount of brightness of a scene.

遠近法的に影を変形する定義をします。
※typeがsingle or double or embossでは効果はありません。

"sxx,sxy,syx,syy,px,py" という形式の、遠近法的変形マトリックス。[s=scale, p=perspective] もしオフセットが絶対的単位であれば px,py は emu-1 単位であり、そうでなければ図形サイズの逆数である。

MATRIXフィルタと同様の値を指定できるならば・・・

sxx・・・横方向倍率。デフォルト値は1.0となります。
sxy・・・横の傾きの角度を指定します。tanθを指定します。デフォルト値は0.0となります。
syx・・・縦の傾きの角度を指定します。tanθを指定します。デフォルト値は0.0となります。
syy・・・縦方向倍率。デフォルト値は1.0となります。
px・・・一次元変形への増加ベクトルのX軸要素を指定します。デフォルト値は1.0となります。
py・・・一次元変形への増加ベクトルのy軸要素を指定します。デフォルト値は1.0となります。

参考:tan45°=1、tan30°=0.577、tan60°=1.732、tan15°=0.2678、tan135°=-1

デフォルト定義されていない(NULL)・・・とあるが・・・skewサブエレメントでは、"1,0,0,1,0,0".がデフォルトとある。skewエレメントとは仕様が違うのかな?

matrix="属性値 "

ちなみにskewでのMSDN説明は次の通り。

The matrix is a string in the form "sxx, sxy, syx, syy, px, py" where s is scale, p is perspective, and x and y are x and y values. If Offset is in absolute units, then px and py are in emu^-1 units (otherwise they are an inverse fraction of the shape size). The default value is "1,0,0,1,0,0".

マトリックスは「sxx、sxy、syx、syy、px、py」という形式の文字列です、sがスケールで、pは遠近法です、また、xとyはx軸方向とy軸方向の値です。
オフセットが絶対単位にある場合、pxとpyは、emu^-1ユニット(そうでなければ、それらは形サイズの逆数の小片です)にあります。

デフォルト値は"1,0,0,0,0,0"です。

で、多分次のようになっていると思われます。

・sxx・・・横幅の倍率。図形の横サイズを比率で扱う。、デフォルトは1倍。

・sxy・・・縦の線の傾きのタンジェント。デフォルトは0でtan0°=0。1とすると左に45度傾斜する。マイナス値で逆傾斜。

・syx・・・横線の傾きのタンジェント。デフォルトは0でtan0°=0。1とすると下に45度傾斜する。マイナス値で逆傾斜。

・syy・・・縦高さの倍率。図形の縦サイズを比率で扱う。デフォルトは1倍。

・px,pyの正確なことはわかりませんが、遠近法としての変形をするようです。.

<v:shadow on="True" color="green" color2="blue" type="perspective" matrix=",-92680f,,,,-95367431641e-17" />

             

<v:shadow on="True" color="green" color2="blue" type="perspective" matrix=",-92680f,,,,-95367431641e-17" origin=".5,.5" offset="0,0" />

             

 

よくわかんない。

Obscured Determines whether the shadow is transparent.

影が透明かどうかを定義します。

falseの場合・・・図形に塗りつぶしがなければ、シャドウは透けて見える。但しstroked="t"で線が描画される場合は、線の影が描画される

trueの場合・・・図形に塗りつぶしがなくても、シャドウは描画される。但しstroked="t"であっても線の影は描画されない

デフォルトはfalse。

obscured="属性値 "

<v:shadow on="True" color="green" color2="blue" type="perspective" matrix=",-92680f,,,,-95367431641e-17" obscured="f" />
shapeのfilled="f" stroked="t" strokeweight="3pt"

             

<v:shadow on="True" color="green" color2="blue" type="perspective" matrix=",-92680f,,,,-95367431641e-17" obscured="f" />
shapeのfilled="f" stroked="t" strokeweight="10pt"

             

<v:shadow on="True" color="green" color2="blue" type="perspective" matrix=",-92680f,,,,-95367431641e-17" obscured="f" />
shapeのfilled="t" stroked="t" strokeweight="10pt"

             

<v:shadow on="True" color="green" color2="blue" type="perspective" matrix=",-92680f,,,,-95367431641e-17" obscured="f" />
shapeのfilled="f" stroked="f" strokeweight="3pt"

             

<v:shadow on="True" color="green" color2="blue" type="perspective" matrix=",-92680f,,,,-95367431641e-17" obscured="t" />
shapeのfilled="f" stroked="t" strokeweight="3pt"

             

<v:shadow on="True" color="green" color2="blue" type="perspective" matrix=",-92680f,,,,-95367431641e-17" obscured="t" />
shapeのfilled="f" stroked="f" strokeweight="3pt"

             

<v:shadow on="True" color="green" color2="blue" type="perspective" matrix=",-92680f,,,,-95367431641e-17" obscured="t" />
shapeのfilled="t" stroked="t" strokeweight="10pt"

             

<v:fill src="sakuranboo.gif" type="frame" />
<v:shadow on="True" color="green" color2="blue" type="emboss" obscured="f" offset="50pt,50pt" />
shapeのfilled="t" stroked="t" strokeweight="10pt"
画像塗りつぶしは関係なし。

 

 

             

<v:fill src="sakuranboo.gif" type="frame" />
<v:shadow on="True" color="green" color2="blue" type="emboss" obscured="t" offset="50pt,50pt" />
shapeのfilled="t" stroked="t" strokeweight="10pt"

 

 

             

<v:shadow on="True" color="green" color2="blue" type="emboss" obscured="f" offset="50pt,50pt" offset2="50pt,50pt" />
shapeのfilled="t" stroked="t" strokeweight="3pt" path="m 0 -57 c -66 -91 -101 20 0 67 c 101 20 66 -91 0 -57 x e m 0 -33 c -38 -56 -67 -7 0 44 c 67 -7 38 -56 0 -33  x e wr -2 -2 2 2 -1000 -1000 -1000 -999 x e"

 

 

             

<v:shadow on="True" color="green" color2="blue" type="emboss" obscured="t" offset="50pt,50pt" offset2="50px,50px" />
shapeのfilled="t" stroked="t" strokeweight="3pt" path="m 0 -57 c -66 -91 -101 20 0 67 c 101 20 66 -91 0 -57 x e m 0 -33 c -38 -56 -67 -7 0 44 c 67 -7 38 -56 0 -33  x e wr -2 -2 2 2 -1000 -1000 -1000 -999 x e"

 

 

             

 

<v:fill src="sakuranboo.gif" type="frame" />
<v:shadow on="True" color="green" color2="blue" type="drawrelative" obscured="f" offset="50pt,50pt" />
shapeのfilled="t" stroked="t" strokeweight="10pt"
画像塗りつぶしは関係なし。

 

 

             

 

 

 

 

Offset Defines how far the shadow extends past the shape.

影がshapeの位置から離れ、どれくらいの距離伸びるか定義します。

値は絶対的な測定あるいは形の断片的な値のいずれかです。断片的な場合、それらは50%から-50%まで変動します。

図形の位置からのオフセットのx、y量。値は、絶対的測定値か、図形の -0.5 ~ +0.5 の小数値かのいずれかである。
※pxは相対的単位であるが、OKである。

デフォルトは 2pt,2pt (offset.x, offset.y)

offset="属性値 "

<v:shadow on="True" color="green" color2="blue" type="perspective" offset="-0.5,-0.5" />

             

<v:shadow on="True" color="green" color2="blue" type="perspective" offset="0.5,0.5" />

             

<v:shadow on="True" color="green" color2="blue" type="double" offset="0.5,0.5" />

             

<v:shadow on="True" color="green" color2="blue" type="emboss" offset="0.5,0.5" />

             

<v:shadow on="True" color="green" color2="blue" type="double" offset="100px,100px" />
この場合は第二の影にも影響する?

 

             

 

Offset2 Defines a second offset. See the Type attribute for more information about second offsets.

第二のオフセットを定義します。第二のオフセットに関してより詳細には、タイプ属性を参照してください。

値は絶対的な測定あるいは形の断片的な値のいずれかです。断片的な場合、それらは50%から-50%まで変動します。

図形の位置からの第2オフセットのx、y量。値は、絶対的測定値か、図形の -0.5 ~ +0.5 の小数値かのいずれかである。
???type="double"の場合のみ?

デフォルトは 0pt,0pt (offset2.x, offset2.y)

offset2="属性値 "

<v:shadow on="True" color="green" color2="blue" type="perspective" offset2="-0.5,-0.5" />

             

<v:shadow on="True" color="green" color2="blue" type="perspective" offset2="0.5,0.5" />

             

<v:shadow on="True" color="green" color2="blue" type="double" offset2="0.5,0.5" />

             

<v:shadow on="True" color="green" color2="blue" type="emboss" offset2="0.5,0.5" />

             

 

<v:shadow on="True" color="green" color2="blue" type="double" offset2="100px,100px" />
第一の影には影響しない。

             

<v:shadow on="True" color="green" color2="blue" type="double" offset="-50pt,-50pt" offset2="100px,100px" />

 

             

 

On Determines whether a shadow is displayed.

影が表示されるかどうか決めます。

シャドウの表示をオンまたはオフにする。

デフォルトは、true。

on="属性値 "

<v:shadow on="True" color="green" color2="blue" type="perspective" matrix=",-92680f,,,,-95367431641e-17" on="t" origin=".5,.5" offset="0,0" />

             

<v:shadow on="True" color="green" color2="blue" type="perspective" matrix=",-92680f,,,,-95367431641e-17" on="f" origin=".5,.5" offset="0,0" />

             

 

Opacity Determines the transparency of a shadow.

影の透明度を決定します。

シャドウ効果の不透明度。

デフォルト価値は1です。0の値は完全に透明な影を作るでしょう。割合少数値、%どちらでもよい。

opacity="属性値 "

<v:shadow on="True" color="green" color2="blue" type="perspective" matrix=",-92680f,,,,-95367431641e-17" origin=".5,.5" offset="0,0" opacity="50%" />

             

<v:shadow on="True" color="green" color2="blue" type="perspective" matrix=",-92680f,,,,-95367431641e-17" origin=".5,.5" offset="0,0" opacity="0.5" />

             

<v:shadow on="True" color="green" color2="blue" type="perspective" matrix=",-92680f,,,,-95367431641e-17" origin=".5,.5" offset="0,0" opacity="100%" />

             

<v:shadow on="True" color="green" color2="blue" type="perspective" matrix=",-92680f,,,,-95367431641e-17" origin=".5,.5" offset="0,0" opacity="0.1" />

             

 

Origin Defines the center of the shadow.

影の中心を定義します。

図形の -0.5 ~ +0.5 の小数値の対。

50%から-50%に及ぶ形の1ペアの断片的な値。デフォルトは、(0,0)です。割合少数値、%どちらでも良い。

origin="属性値 "

<v:shadow on="True" color="green" color2="blue" type="perspective" matrix=",-92680f,,,,-95367431641e-17" origin="20%,20%" offset="0,0" />

             

<v:shadow on="True" color="green" color2="blue" type="perspective" matrix=",-92680f,,,,-95367431641e-17" origin="0,0" offset="0,0" />

             

<v:shadow on="True" color="green" color2="blue" type="perspective" matrix=",-92680f,,,,-95367431641e-17" origin="100%,100%" offset="0,0" />

             

<v:shadow on="True" color="green" color2="blue" type="perspective" matrix=",-92680f,,,,-95367431641e-17" origin="150%,150%" offset="0,0" />

             

単位なし

<v:shadow on="True" color="green" color2="blue" type="perspective" matrix=",-92680f,,,,-95367431641e-17" origin="3,3" offset="0,0" />

             

単位なし

<v:shadow on="True" color="green" color2="blue" type="perspective" matrix=",-92680f,,,,-95367431641e-17" origin="-3,-3" offset="0,0" />

             

ポイント数値+単位は有効か?

<v:shadow on="True" color="green" color2="blue" type="perspective" matrix=",-92680f,,,,-95367431641e-17" origin="3pt,3pt" offset="0,0" />

             

ポイント数値+単位は有効か?

<v:shadow on="True" color="green" color2="blue" type="perspective" matrix=",-92680f,,,,-95367431641e-17" origin="-3pt,-3pt" offset="0,0" />

             

ピクセル数値+単位は有効か?

<v:shadow on="True" color="green" color2="blue" type="perspective" matrix=",-92680f,,,,-95367431641e-17" origin="3px,3px" offset="0,0" />

             

ピクル数値+単位は有効か?

<v:shadow on="True" color="green" color2="blue" type="perspective" matrix=",-92680f,,,,-95367431641e-17" origin="-3px,-3px" offset="0,0" />

             

ミリ数値+単位は有効か?

<v:shadow on="True" color="green" color2="blue" type="perspective" matrix=",-92680f,,,,-95367431641e-17" origin="3mm,3mm" offset="0,0" />

             

ミリ数値+単位は有効か?

<v:shadow on="True" color="green" color2="blue" type="perspective" matrix=",-92680f,,,,-95367431641e-17" origin="-3mm,-3mm" offset="0,0" />

             

センチ数値+単位は有効か?

<v:shadow on="True" color="green" color2="blue" type="perspective" matrix=",-92680f,,,,-95367431641e-17" origin="3cm,3cm" offset="0,0" />

             

センチ数値+単位は有効か?

<v:shadow on="True" color="green" color2="blue" type="perspective" matrix=",-92680f,,,,-95367431641e-17" origin="-3cm,-3cm" offset="0,0" />

             

これはどうなってるの?

 

Type Specifies the type of shadow.

影のタイプを指定します。

取りうる値は "single | double | emboss | perspective" である。(W3Cノート)。

MSDNでは以下の通り。

Value Description
single

単一のシングル影。

double

二つの影を描画します。
Color2は第2の影の色のために使用されます。また、Offset2は第2の影のオフセットのために使用されます。

perspective

遠近法的見晴らしの影。

shapeRelative

影はshapeに関連のあるように作成されます。

drawingRelative

影は図面に比べて作成されます。意味不明??

emboss

浮き彫りにされた外観に見える。

type="属性値 "

いまひとつわからん。embossいろいろ試したが、浮き彫り風にはならない・・・誰か成功した人いるの?

<v:image src="sakuranboo.gif" strokecolor="red"  fillcolor="yellow" style="border:blue solid 1px; position:absolute; rotation:0; filter:alpha(opacity=100); left:0px; top:0px; width:70px; height:108px;">
<v:shadow on="True" type="single" obscured="t" offset="30px,30px" />
</v:image>

 

             

<v:image src="sakuranboo.gif" strokecolor="red"  fillcolor="yellow" style="border:blue solid 1px; position:absolute; rotation:0; filter:alpha(opacity=100); left:0px; top:0px; width:70px; height:108px;">
<v:shadow on="True" type="double" obscured="t" offset="30px,30px" />
</v:image>

 

             

<v:image src="sakuranboo.gif" strokecolor="red"  fillcolor="yellow" style="border:blue solid 1px; position:absolute; rotation:0; filter:alpha(opacity=100); left:0px; top:0px; width:70px; height:108px;">
<v:shadow on="True" type="perspective" obscured="t" offset="30px,30px" />
</v:image>

 

             

<v:image src="sakuranboo.gif" strokecolor="red"  fillcolor="yellow" style="border:blue solid 1px; position:absolute; rotation:0; filter:alpha(opacity=100); left:0px; top:0px; width:70px; height:108px;">
<v:shadow on="True" type="shaperelative" obscured="t" offset="30px,30px" />
</v:image>

 

             

<v:image src="sakuranboo.gif" strokecolor="red"  fillcolor="yellow" style="border:blue solid 1px; position:absolute; rotation:0; filter:alpha(opacity=100); left:0px; top:0px; width:70px; height:108px;">
<v:shadow on="True" type="drawingrelative" obscured="t" offset="30px,30px" />
</v:image>

 

             

<v:image src="sakuranboo.gif" strokecolor="red"  fillcolor="yellow" style="border:blue solid 1px; position:absolute; rotation:0; filter:alpha(opacity=100); left:0px; top:0px; width:70px; height:108px;">
<v:shadow on="True" type="emboss" obscured="f" offset="30px,30px" />
</v:image>

 

             

<v:image src="sakuranboo.gif" strokecolor="red"  fillcolor="yellow" style="border:blue solid 1px; position:absolute; rotation:0; filter:alpha(opacity=100); left:0px; top:0px; width:70px; height:108px;">
<v:shadow on="True" type="emboss" obscured="t" offset="30px,30px" />
</v:image>

 

             

その他、pathによる図形(Shape)のfillサブエレメントでGIF/JPEG/WMF画像でも試し、WORDにても試しましたが、エンボスになることはありませんでした。後試してないといえば、imagedataサブエレメントかなぁ?WORDの画像挿入でimagedataになるが、これでもだめなんだが・・・。

 


入力は半角で。全角や入れることのできない値・文字列は、エラーとなる場合があります。

type

singledoubleperspectiveshaperelativedrawingrelativeemboss

on

false      true

 obscured

     false      true

offset

x= y=
単位は入れてもよさそうだ・・・。

offset2

x= y=
単位は入れてもよさそうだ・・・。

 color

 
色を正確に入力

 color2


色を正確に入力

opacity

 
%

origin

rotation

 
°

 extruction on/off

 false      true

matrix 

例)

 matrix="sxx,sxy,syx,syy,px,py"

sxx= sxy= syx= syy= px= py=


shape図形にしか影は描画されない。imagedataも関係なし。

fillに画像をタイル状に貼り付けの場合)

             
             

<v:group style="width:1; height:1; rotation:0" coordsize="1,1" coordorigin="0,0" >
<v:shape id="s1" strokecolor="red"  strokeweight="2pt" style="border:blue solid 1px; width:100; height:100; rotation:0; position:absolute; left:250; top:250" coordsize="100,100" coordorigin="0,0" path="m 0 -57 c -66 -91 -101 20 0 67 c 101 20 66 -91 0 -57 x m 0 -33 c -38 -56 -67 -7 0 44 c 67 -7 38 -56 0 -33  x wr -2 -2 2 2 -1000 -1000 -1000 -999 x e">
<v:fill if="f1" color="yellow" />
<v:shadow id="sh1" on="True" offset="2pt,2pt" offset2="0pt,0pt" origin="0%,0%" matrix=",,,,,," />
<v:imagedata src="sakuranboo.gif" />
<v:extrusion id="e2" on="f" type="perspective" skewangle="0" foredepth="2mm" backdepth="2mm" color="green" metal="t" facet="0.01" viewpointorigin="0,0" viewpoint="0,0" rotationangle="20,30" lightposition="0,0,0" />
</v:shape >
</v:group>

<v:group style="width:1; height:1; rotation:0" coordsize="1,1" coordorigin="0,0" >
<v:shape id="s2" strokecolor="red" strokeweight="2pt" style="border:blue solid 1px; width:100; height:100; rotation:0; position:absolute; left:250; top:250" coordsize="100,100" coordorigin="0,0" path="m 0 -57 c -66 -91 -101 20 0 67 c 101 20 66 -91 0 -57 x m 0 -33 c -38 -56 -67 -7 0 44 c 67 -7 38 -56 0 -33  x wr -2 -2 2 2 -1000 -1000 -1000 -999 x e">
<v:fill if="f2" src="bbs12.gif" type="tile" />
<v:shadow id="sh2" on="True" offset="2pt,2pt" offset2="0pt,0pt" origin="0%,0%" matrix=",,,,,," />
<v:extrusion id="e2" on="f" type="perspective" skewangle="0" foredepth="2mm" backdepth="2mm" color="green" metal="t" facet="0.01" viewpointorigin="0,0" viewpoint="0,0" rotationangle="20,30" lightposition="0,0,0" />
</v:shape >
</v:group>

 

 Copyright TAXI 2008/6/30 敦子(とんこ)画像:ズサンヌ