Image display at 100% Width OR Height

Version 2

     

    Web Viewer

     

    Compatibility
    Creator
    Mac OS X, Windows
    Nicolaus Busch
    FMP 9, 10, 11
    N. Busch GmbH
    Web: No
    File Type: None
    Server: Yes
    FileSize: 0 kilobytes
    http://www.nbusch.net

    Description

    An image is displayed in the webviewer. The image will always use the full width or height of the webviewer depending on the images dimensions no matter how the webviewer is resized.

     


    Code

    Let(

    tmp_Path = Case( Abs( Get ( SystemPlatform ) = 1) ; "file:///Volumes/" & Substitute( Path ; ":" ; "/" ) ; Path )

    ;

    Case(

    TrFile_Exists( "-unused" ; tmp_Path ) <> 1 ;

    "";

    GetAsNumber( RightWords ( Dimensions ; 1)) > GetAsNumber( LeftWords( Dimensions ; 1)) ;

    "data:text/html,

     

     

     

     

     

    " ;

    "data:text/html,

     

     

     

     

     

     

     

    "

    ) // end case

    ) // end let

     

    Sample Input

    Sample Output


    Developer's Notes

     

    This code is intended for a webviewer object set to autoresize in all directions. The image will always be displayed in such a way that either the width or the heigth of the webviewer is used completely, depending on the images dimensions.

     

    We use the Troi File Plugin to do two things beforehand:

    - grab the path and write it to the datafield “Path”

    - using TrFile_MetaData we fill the field “Dimension” with a text like “1600 x 1300”

     

     


    FileMaker Inc. provides this content on an “As Is” basis, without any warranty, and subject to the terms of the FileMaker Technical Network Agreement. FileMaker makes no representations and is not liable for any content or related information. You may use the content as part of your own solutions and for your customers, but you may not otherwise publicly distribute any content that you did not submit. ©2009-2011 FileMaker, Inc. All Rights Reserved. FileMaker is a trademark of FileMaker, Inc. registered in the U.S. and other countries.