AddImageClip

導入

v1.0

詳細

イメージ ソースからクリップ コンテナに新しいイメージ クリップを作成、追加します。 このコマンドを実行するには、Sources コンテナにイメージ ソースが存在しなければなりません。イメージ ソースを作成するには、AddImageSource コマンドを使用します。このコマンドは、構文と動作が SIAddImageClip コマンドと似ていますが、パラメータではなく関数呼び出しによって値を戻す点が異なります。

ヒント: ファイル名から直接クリップに移動するショートカットとして、CreateImageClip コマンドも使用できます(AddImageSourceAddImageClip を組み合わせて使用した場合と同様です)。

スクリプト構文

oReturn = AddImageClip( Source, [Name] );

戻り値

新しい ImageClip を戻します。

パラメータ

パラメータ タイプ 説明
Source 文字列 クリップの作成に使用するソース
Name 文字列 新しいクリップに付ける名前

VBScript の例

'------------------------------------------------------------------

' This example shows how to add an image clip from an image source.

'------------------------------------------------------------------

option explicit

' First, add an image source.

Dim oSourceObj, ImageFile

ImageFile = Application.InstallationPath( siFactoryPath ) & "/Data/XSI_SAMPLES/Pictures/xsilogo.jpg"

SIAddImageSource ImageFile, "XSIlogo", oSourceObj

' Now create an image clip from the image source.

Dim oClipObj 

set oClipObj = AddImageClip( oSourceObj, "XSIlogo_Clip" )

' Now output some information about the clip, and its source.

Dim SourceName, SourceFile, XRes, YRes

SourceName = GetValue( oClipObj & ".Source.Name" )

logmessage oClipObj & " Source       : " & CStr(SourceName)

SourceFile = GetValue( oClipObj & ".SourceFileName" )

logmessage oClipObj & " Source File  : " & CStr(SourceFile)

XRes = GetValue( "Sources." & SourceName & ".XRes" )

logmessage oClipObj & " X Resolution : " & CInt(XRes)

YRes = GetValue( "Sources." & SourceName & ".YRes" )

logmessage oClipObj & " Y Resolution : " & CInt(YRes)

'---------------------------------------------------------

' Output from this script:

'INFO : "Clips.XSIlogo_Clip Source       : XSIlogo"

'INFO : "Clips.XSIlogo_Clip Source File  : <FactoryPath>\Data\XSI_SAMPLES\Pictures\xsilogo.jpg"

'INFO : "Clips.XSIlogo_Clip X Resolution : 500"

'INFO : "Clips.XSIlogo_Clip Y Resolution : 513"

'---------------------------------------------------------

関連項目

SIAddImageClip CreateImageClip AddImageSource SIAddImageSource