MBS FileMaker Plugin Example Databases

Clip Image

All examples are included with download of MBS FileMaker Plugin.

Clip Image.fmp12

Overview
Tables1
Relationships0
Layouts1
Scripts2
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: 75 pt
                  • Left: 10 pt
                  • Bottom: 534 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: 75 pt
                  • Left: 493 pt
                  • Bottom: 534 pt
                  • Right: 967 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: 91 pt
                  • Left: 976 pt
                  • Bottom: 112 pt
                  • Right: 1055 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: 139 pt
                  • Left: 976 pt
                  • Bottom: 160 pt
                  • Right: 1055 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 transparent
                  • Top: 279 pt
                  • Left: 975 pt
                  • Bottom: 307 pt
                  • Right: 1085 pt
                  • Anchoring: Left, Top
                  Perform Script [ “Clip transparent” ]

                  Scripts:


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

                  Scripts:


                  Script Hierarchy

                  Clip gray
                  Clip transparent

                  Next Script: [Clip transparent]
                  Script NameClip gray
                  Run script with full access privilegesOff
                  Include In MenuYes
                  Layouts that use this script
                  Scripts that use this script
                    Script Definition
                    Script Steps
                    • #We cut the image according to the shortest side quadratic, define a circle and appley the alpha canal oft thr circle picture to the orignal picture. The picture is transparent on the pixel where the image of the circle is transperent to. The we put the image to a gray background.
                    • 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.Free"; $SourceImage) ]
                    • Set Variable [ $r; Value:MBS( "GMImage.Free"; $tempImage) ]
                    • Set Variable [ $r; Value:MBS( "GMImage.Free"; $clipImage) ]
                    • Set Variable [ $r; Value:MBS( "GMImage.Free"; $destImage) ]
                    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

                            Previous Script: [Clip gray]
                            Script NameClip transparent
                            Run script with full access privilegesOff
                            Include In MenuYes
                            Layouts that use this script
                            Scripts that use this script
                              Script Definition
                              Script Steps
                              • #We cut the image according to the shortest side quadratic, define a circle and appley the alpha canal oft thr circle picture to the orignal picture. The picture is transparent on the pixel where the image of the circle is transperent to.
                              • #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; "transparent") ]
                              • Set Variable [ $r; Value:MBS( "GMImage.CompositeXY"; $destImage; $tempImage; ($destWidth-$destSize)/2; ($destHeight-$destSize)/2; 1) ]
                              • Set Field [ Clip Image::Output; MBS( "GMImage.WriteToPNGContainer"; $tempImage) ]
                              • #Memory cleanup
                              • Set Variable [ $r; Value:MBS( "GMImage.Free"; $SourceImage) ]
                              • Set Variable [ $r; Value:MBS( "GMImage.Free"; $tempImage) ]
                              • Set Variable [ $r; Value:MBS( "GMImage.Free"; $clipImage) ]
                              • Set Variable [ $r; Value:MBS( "GMImage.Free"; $destImage) ]
                              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 FileMaker Plugins