MBS FileMaker Plugin Example Databases

Clip Image

All examples are included with download of MBS FileMaker Plugin.

Clip Image.fmp12

Overview
Tables1
Relationships0
Layouts1
Scripts1
Value Lists0
Custom Functions0
Custom Menus0
File Options
Default custom menu set[Standard FileMaker Menus]
When opening file
Minimum allowed version12.0
Login usingAccount Name; Account= Admin
Allow user to save passwordOff
Require iOS passcodeOff
Switch to layoutOff
Hide all toolbarsOff
Script triggers
OnFirstWindowOpenOff
OnLastWindowCloseOff
OnWindowOpenOff
OnWindowCloseOff
OnFileAVPlayerChangeOff
Thumbnail Settings
Generate ThumbnailsOn; Temporary

 

Tables

Table Name
Statistics
Occurrences in Relationship Graph
Clip Image
4 fields defined, 1 record
Clip Image

Fields

Table Name: Clip Image - 4 Fields
Field NameTypeOptionsCommentsOn LayoutsIn RelationshipsIn ScriptsIn Value Lists
InputNormal, BinaryAuto-Enter:
  • Allow editing
Validation:
  • Only during data entry
Storage:
  • Repetitions: 1
      OutputNormal, BinaryAuto-Enter:
      • Allow editing
      Validation:
      • Only during data entry
      Storage:
      • Repetitions: 1
          WidthNormal, NumberAuto-Enter:
          • Allow editing
          Validation:
          • Only during data entry
          Storage:
          • Repetitions: 1
          • Indexing: None
          • Automatically create indexes as needed
          • Index Language: German
              HeightNormal, NumberAuto-Enter:
              • Allow editing
              Validation:
              • Only during data entry
              Storage:
              • Repetitions: 1
              • Indexing: None
              • Automatically create indexes as needed
              • Index Language: German

                  Layout Objects: Clip Image

                  Regular Fields

                  Field Name: Clip Image::Input
                  Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                  • Top: 63 pt
                  • Left: 10 pt
                  • Bottom: 522 pt
                  • Right: 484 pt
                  • Anchoring: Left, Top
                  Field Format:
                  • Edit Box
                  Field Behavior:
                  • Allow field to be entered: In Find mode, In Browse mode
                  • Touch keyboard type: Default for Data Type
                  • Go to next field using: Tab key
                  No

                  Field Name: Clip Image::Output
                  Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                  • Top: 63 pt
                  • Left: 492 pt
                  • Bottom: 522 pt
                  • Right: 966 pt
                  • Anchoring: Left, Top
                  Field Format:
                  • Edit Box
                  Field Behavior:
                  • Allow field to be entered: In Find mode, In Browse mode
                  • Touch keyboard type: Default for Data Type
                  • Go to next field using: Tab key
                  No

                  Field Name: Clip Image::Width
                  Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                  • Top: 128 pt
                  • Left: 975 pt
                  • Bottom: 149 pt
                  • Right: 1054 pt
                  • Anchoring: Left, Top
                  Field Format:
                  • Edit Box
                  Field Behavior:
                  • Allow field to be entered: In Find mode, In Browse mode
                  • Touch keyboard type: Default for Data Type
                  • Go to next field using: Tab key
                  Yes

                  Field Name: Clip Image::Height
                  Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                  • Top: 183 pt
                  • Left: 975 pt
                  • Bottom: 204 pt
                  • Right: 1054 pt
                  • Anchoring: Left, Top
                  Field Format:
                  • Edit Box
                  Field Behavior:
                  • Allow field to be entered: In Find mode, In Browse mode
                  • Touch keyboard type: Default for Data Type
                  • Go to next field using: Tab key
                  Yes

                  Buttons

                  Button PropertiesCoordinatesScript/Script Step
                    Type:
                  • Text: Clip
                  • Top: 66 pt
                  • Left: 975 pt
                  • Bottom: 94 pt
                  • Right: 1085 pt
                  • Anchoring: Left, Top
                  Perform Script [ “Clip” ]

                  Scripts:


                  Script Hierarchy

                  Clip

                  Script NameClip
                  Run script with full access privilegesOff
                  Include In MenuYes
                  Layouts that use this script
                  Scripts that use this script
                    Script Definition
                    Script Steps
                    • Set Variable [ $gray; Value:"#777777" ]
                    • #Read in source image
                    • Set Variable [ $SourceImage; Value:MBS( "GMImage.NewFromContainer"; Clip Image::Input ) ]
                    • Set Variable [ $sourceWidth; Value:MBS( "GMImage.GetWidth"; $SourceImage) ]
                    • Set Variable [ $sourceHeight; Value:MBS( "GMImage.GetHeight"; $SourceImage) ]
                    • #Scale to dest size
                    • Set Variable [ $sourceSize; Value:If($sourceWidth > $sourceHeight; $sourceHeight; $sourceWidth) ]
                    • Set Variable [ $destWidth; Value:GetAsNumber ( Clip Image::Width ) ]
                    • Set Variable [ $destHeight; Value:GetAsNumber ( Clip Image::Height ) ]
                    • Set Variable [ $destSize; Value:If($destWidth > $destHeight; $destHeight; $destWidth) ]
                    • Set Variable [ $tempImage; Value:MBS( "GMImage.New"; $sourceSize & "x" & $sourceSize; "transparent" ) ]
                    • Set Variable [ $r; Value:MBS( "GMImage.CompositeXY"; $tempImage; $sourceImage; -($sourceWidth-$sourceSize)/2; -($sourceHeight-$sourceSize)/2; 1) ]
                    • Set Variable [ $r; Value:MBS( "GMImage.Scale"; $tempImage; $destSize & "x" & $destSize ) ]
                    • #Build mask
                    • Set Variable [ $clipImage; Value:MBS( "GMImage.New"; $destSize & "x" & $destSize; "transparent" ) ]
                    • Set Variable [ $r; Value:MBS( "GMImage.SetFillColor"; $clipImage; "black" ) ]
                    • Set Variable [ $radius; Value:$destSize/2 ]
                    • Set Variable [ $r; Value:MBS( "GMImage.DrawCircle"; $clipImage; $radius; $radius; 0; $radius ) ]
                    • #Apply mask
                    • Set Variable [ $r; Value:MBS( "GMImage.CopyChannel"; $tempImage; "Opacity"; $clipImage; "Opacity") ]
                    • #Create destination image
                    • Set Variable [ $destImage; Value:MBS( "GMImage.New"; $destWidth & "x" & $destHeight; $gray ) ]
                    • Set Variable [ $r; Value:MBS( "GMImage.CompositeXY"; $destImage; $tempImage; ($destWidth-$destSize)/2; ($destHeight-$destSize)/2; 1) ]
                    • Set Field [ Clip Image::Output; MBS( "GMImage.WriteToPNGContainer"; $destImage) ]
                    • #Memory cleanup
                    • Set Variable [ $r; Value:MBS( "GMImage.Destroy"; $SourceImage) ]
                    • Set Variable [ $r; Value:MBS( "GMImage.Destroy"; $tempImage) ]
                    • Set Variable [ $r; Value:MBS( "GMImage.Destroy"; $clipImage) ]
                    Fields used in this script
                    Scripts used in this script
                      Layouts used in this script
                        Tables used in this script
                        Table occurrences used by this script
                        Custom Functions used by this script
                          Custom menu set used by this script

                            Download example: Clip Image

                            Used functions:




                            Links
                            MBS Xojo PDF Plugins