'
' This example shows how to add an image clip from an image source.
'
option explicit
' First, add an image source.
Dim oSourceObj, ImageFile
ImageFile = XSIUtils.BuildPath( _
Application.InstallationPath( siProjectPath ), _
"Pictures", "xsilogo.jpg" _
)
SIAddImageSource ImageFile, "XSIlogo", oSourceObj
' Now create an image clip from the image source.
Dim oClipObj
SIAddImageClip oSourceObj, "XSIlogo_Clip", oClipObj
' Now output some information about the clip, and its source.
Dim SourceName, SourceFile, XRes, YRes
SourceName = GetValue( oClipObj & ".Source.Name" )
Application.LogMessage oClipObj & " Source : " & CStr(SourceName)
SourceFile = GetValue( oClipObj & ".SourceFileName" )
Application.LogMessage oClipObj & " Source File : " & CStr(SourceFile)
XRes = GetValue( "Sources." & SourceName & ".XRes" )
Application.LogMessage oClipObj & " X Resolution : " & CInt(XRes)
YRes = GetValue( "Sources." & SourceName & ".YRes" )
Application.LogMessage oClipObj & " Y Resolution : " & CInt(YRes)
' Expected results:
'INFO : "Clips.XSIlogo_Clip Source : XSIlogo"
'INFO : "Clips.XSIlogo_Clip Source File : <ProjectPath>\Pictures\xsilogo.jpg"
'INFO : "Clips.XSIlogo_Clip X Resolution : 500"
'INFO : "Clips.XSIlogo_Clip Y Resolution : 513" |