Components All New MacOS Windows Linux iOS
Examples Mac & Win Server Client Guides Statistic FMM Blog Deprecated Old

MBS FileMaker Plugin Example Databases

Apply Mask

All examples are included with download of MBS FileMaker Plugin.

Apply Mask.fmp12

Overview
Tables 1
Relationships 0
Layouts 1
Scripts 1
Value Lists 1
Custom Functions 0
Custom Menus 32
File Options
Default custom menu set [Standard FileMaker Menus]
Default theme Enlightened
When opening file
Minimum allowed version 12.0
Login using Account Name; Account= Admin
Allow user to save password On
Require iOS passcode Off
Show Sign-in fields Off
Switch to layout Off
Hide all toolbars Off
Script triggers
OnFirstWindowOpen Off
OnLastWindowClose Off
OnWindowOpen Off
OnWindowClose Off
OnFileAVPlayerChange Off
OnWindowTransaction Off
Thumbnail Settings
Generate Thumbnails On; Temporary

 

Tables

Table Name
Statistics
Comments
Occurrences in Relationship Graph
Combine Pictures
3 fields defined, 1 record
Combine Pictures

Fields

Table Name: Combine Pictures - 3 Fields
Field Name Type Options Comments On Layouts In Relationships In Scripts In Value Lists
InputImage Normal, Binary Auto-Enter:
  • Allow editing
Validation:
  • Only during data entry
Storage:
  • Repetitions: 1
      Result Normal, Binary Auto-Enter:
      • Allow editing
      Validation:
      • Only during data entry
      Storage:
      • Repetitions: 1
          backgroundColor Normal, Text Auto-Enter:
          • Allow editing
          Validation:
          • Only during data entry
          Storage:
          • Repetitions: 1
          • Indexing: None
          • Automatically create indexes as needed
          • Index Language: German

              Layout Objects: Combine Pictures

              Regular Fields

              Field Name: Combine Pictures::InputImage
              Field Properties Coordinates Field Format Field Behavior Quick Find
              • Top: 54 pt
              • Left: 23 pt
              • Bottom: 539 pt
              • Right: 384 pt
              • Anchoring: Left, Top
              Field Format:
              • Edit Box
              Field Behavior:
              • Allow field to be entered: In Find mode, In Browse mode
              • Touch keyboard type: System Default
              • Go to next field using: Tab key
              No

              Field Name: Combine Pictures::Result
              Field Properties Coordinates Field Format Field Behavior Quick Find
              • Top: 54 pt
              • Left: 415 pt
              • Bottom: 539 pt
              • Right: 776 pt
              • Anchoring: Left, Top
              Field Format:
              • Edit Box
              Field Behavior:
              • Allow field to be entered: In Find mode, In Browse mode
              • Touch keyboard type: System Default
              • Go to next field using: Tab key
              No

              Field Name: Combine Pictures::backgroundColor
              Field Properties Coordinates Field Format Field Behavior Quick Find
              • Top: 131 pt
              • Left: 797 pt
              • Bottom: 152 pt
              • Right: 1050 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 Properties Coordinates Script/Script Step
                Type:
              • Text: Apply Mask
              • Top: 205 pt
              • Left: 863 pt
              • Bottom: 233 pt
              • Right: 984 pt
              • Anchoring: Left, Top
              Perform Script [ “CombinePictures” ]

              Scripts:


              Value Lists

              Value List Name Source Values On Layouts
              CompositeOp Custom
              • 0 = UndefinedCompositeOp, 1 = OverCompositeOp, 2 = InCompositeOp, 3 = OutCompositeOp, 4 = AtopCompositeOp, 5 = XorCompositeOp, 6 = PlusCompositeOp, 7 = MinusCompositeOp, 8 = AddCompositeOp, 9 = SubtractCompositeOp, 10 = DifferenceCompositeOp, 11 = MultiplyCompositeOp, 12 = BumpmapCompositeOp, 13 = CopyCompositeOp, 14 = CopyRedCompositeOp, 15 = CopyGreenCompositeOp, 16 = CopyBlueCompositeOp, 17 = CopyOpacityCompositeOp, 18 = ClearCompositeOp, 19 = DissolveCompositeOp, 20 = DisplaceCompositeOp, 21 = ModulateCompositeOp, 22 = ThresholdCompositeOp, 23 = NoCompositeOp, 24 = DarkenCompositeOp, 25 = LightenCompositeOp, 26 = HueCompositeOp, 27 = SaturateCompositeOp, 28 = ColorizeCompositeOp, 29 = LuminizeCompositeOp, 32 = CopyCyanCompositeOp, 33 = CopyMagentaCompositeOp, 34 = CopyYellowCompositeOp, 35 = CopyBlackCompositeOp, 36 = DivideCompositeOp

                Script Hierarchy

                CombinePictures

                Script Name CombinePictures
                Run script with full access privileges Off
                Siri Shortcut Visible Off
                Include In Menu Yes
                Layouts that use this script
                Scripts that use this script
                  Script Definition
                  Script Steps
                  • #Load the image from the container. Create a new image environment with the backgoundcolor from the field and position the original image on the new image. Copy properties and write the image into the container
                  • #open image
                  • Set Variable [ $Image; Value:MBS("GMImage.NewFromContainer"; Combine Pictures::InputImage) ]
                  • #create new image with matching size
                  • Set Variable [ $ImageWidth; Value:MBS("GMImage.GetWidth";$Image) ]
                  • Set Variable [ $ImageHeight; Value:MBS("GMImage.GetHeight";$Image) ]
                  • Set Variable [ $NewImage; Value:MBS("GMImage.New"; $ImageWidth & "x" & $ImageHeight; Combine Pictures::backgroundColor) ]
                  • #draw old picture on new picture
                  • Set Variable [ $Error; Value:MBS( "GMImage.CompositeXY"; $NewImage; $Image; 0; 0; 1 ) ]
                  • #copy whatever properties you like
                  • Set Variable [ $r; Value:MBS( "GMImage.SetDensity"; $NewImage; MBS("GMImage.GetDensity"; $Image) ) ]
                  • Set Variable [ $r; Value:MBS( "GMImage.SetResolutionUnits"; $NewImage; MBS("GMImage.GetResolutionUnits"; $Image) ) ]
                  • #save
                  • Set Field [ Combine Pictures::Result; MBS( "GMImage.WriteToPNGContainer"; $NewImage ) ]
                  • #Cleanup
                  • Set Variable [ $Error; Value:MBS("GMImage.Free";$NewImage) ]
                  • Set Variable [ $Error; Value:MBS("GMImage.Free";$Image) ]
                  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: Apply Mask

                          Used functions: