Application Object
209
ActiveDocument.InsertText(’<p></p>’, false);
}
}
}
GetImageHeight
Syntax
GetImageHeight(const wsImageName: WideString): Integer;
Description
Returns the height in pixels of the passed image. Returns
0
on error.
Example
/*
Tests GetImageHeight, GetImageWidth
Looks for first GIF image in current directory
*/
function Main(){
with (Application) {
aFileObj= new ActiveXObject("Scripting.FileSystemObject");
aFolder= aFileObj.GetFolder(CurrentFolder);
aFiles= new Enumerator(aFolder.files);
sExtToTest= ’gif’;
sFile= ’’;
for (; !aFiles.atEnd(); aFiles.moveNext()){
if (aFileObj.GetExtensionName(aFiles.item())
== sExtToTest){
sFile = aFiles.item();
break;
}
}
if (!sFile == ’’){
sMsg = sFile + ’\n\n’ + ’Height = ’ +
GetImageHeight(sFile) + ’\n’;
sMsg = sMsg + ’Width = ’ + GetImageWidth(sFile);
MessageBox(sMsg, ’GetImageHeight/Width Test’, 0);
}
else{
MessageBox(’No images found in current directory’,
’GetImageHeight/Width Test’, 0);
}
}
Содержание ColdFusion Server 5
Страница 18: ...xviii About This Book...
Страница 26: ...8 Chapter 1 Setting Up the Product...
Страница 42: ...24 Chapter 2 Configuring Browsers and Servers...
Страница 60: ...42 Chapter 3 Exploring the Workspace...
Страница 100: ...82 Chapter 6 Editing Pages...
Страница 126: ...108 Chapter 7 Using Web Development Languages...
Страница 212: ...194 Chapter 13 Customizing the Development Environment...
Страница 320: ...302 Glossary...