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
Tables1
Relationships0
Layouts1
Scripts1
Value Lists1
Custom Functions0
Custom Menus32
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
Combine Pictures
3 fields defined, 1 record
Combine Pictures

Fields

Table Name: Combine Pictures - 3 Fields
Field NameTypeOptionsCommentsOn LayoutsIn RelationshipsIn ScriptsIn Value Lists
InputImageNormal, BinaryAuto-Enter:
  • Allow editing
Validation:
  • Only during data entry
Storage:
  • Repetitions: 1
      ResultNormal, BinaryAuto-Enter:
      • Allow editing
      Validation:
      • Only during data entry
      Storage:
      • Repetitions: 1
          backgroundColorNormal, TextAuto-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 PropertiesCoordinatesField FormatField BehaviorQuick 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 PropertiesCoordinatesField FormatField BehaviorQuick 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 PropertiesCoordinatesField FormatField BehaviorQuick 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 PropertiesCoordinatesScript/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 NameSourceValuesOn Layouts
              CompositeOpCustom
              • 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 NameCombinePictures
                Run script with full access privilegesOff
                Include In MenuYes
                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: