MBS FileMaker Plugin Example Databases

Annotate Image

All examples are included with download of MBS FileMaker Plugin.

Annotate Image.fmp12

Overview
Tables1
Relationships0
Layouts1
Scripts4
Value Lists0
Custom Functions0
Custom Menus33
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
Annotate Image
5 fields defined, 1 record
Annotate Image

Fields

Table Name: Annotate Image - 5 Fields
Field NameTypeOptionsCommentsOn LayoutsIn RelationshipsIn ScriptsIn Value Lists
InputImageNormal, BinaryAuto-Enter:
  • Allow editing
Validation:
  • Only during data entry
Storage:
  • Repetitions: 1
      OutputImageNormal, BinaryAuto-Enter:
      • Allow editing
      Validation:
      • Only during data entry
      Storage:
      • Repetitions: 1
          TextNormal, TextAuto-Enter:
          • Allow editing
          Validation:
          • Only during data entry
          Storage:
          • Repetitions: 1
          • Indexing: None
          • Automatically create indexes as needed
          • Index Language: German
              FontPathNormal, TextAuto-Enter:
              • Allow editing
              Validation:
              • Only during data entry
              Storage:
              • Repetitions: 1
              • Indexing: None
              • Automatically create indexes as needed
              • Index Language: German
                  FontSizeNormal, NumberAuto-Enter:
                  • Allow editing
                  Validation:
                  • Only during data entry
                  Storage:
                  • Repetitions: 1
                  • Indexing: None
                  • Automatically create indexes as needed
                  • Index Language: German

                      Layout Objects: Annotate Image

                      Regular Fields

                      Field Name: Annotate Image::InputImage
                      Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                      • Top: 43 pt
                      • Left: 138 pt
                      • Bottom: 288 pt
                      • Right: 495 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: Annotate Image::OutputImage
                      Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                      • Top: 43 pt
                      • Left: 600 pt
                      • Bottom: 288 pt
                      • Right: 957 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: Annotate Image::Text
                      Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                      • Top: 295 pt
                      • Left: 138 pt
                      • Bottom: 316 pt
                      • Right: 391 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
                      Yes

                      Field Name: Annotate Image::FontPath
                      Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                      • Top: 323 pt
                      • Left: 138 pt
                      • Bottom: 344 pt
                      • Right: 391 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
                      Yes

                      Field Name: Annotate Image::FontSize
                      Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                      • Top: 351 pt
                      • Left: 138 pt
                      • Bottom: 372 pt
                      • Right: 217 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
                      Yes

                      Buttons

                      Button PropertiesCoordinatesScript/Script Step
                        Type:
                      • Text: Run
                      • Top: 296 pt
                      • Left: 600 pt
                      • Bottom: 331 pt
                      • Right: 722 pt
                      • Anchoring: Left, Top
                      Perform Script [ “Run” ]

                      Scripts:


                      Script Hierarchy

                      Run
                      Run Transparent
                      Run Transparent with shadow
                      Clear

                      Next Script: [Run Transparent]
                      Script NameRun
                      Run script with full access privilegesOff
                      Include In MenuYes
                      Layouts that use this script
                      Scripts that use this script
                        Script Definition
                        Script Steps
                        • #This script loade the original picture to an image environment set the settings for the font and write a text on a picture. Then we save the image in a container.
                        • Set Variable [ $ref; Value:MBS("GMImage.NewFromContainer"; Annotate Image::InputImage) ]
                        • #Settings for the font
                        • Set Variable [ $r; Value:MBS("GMImage.SetFontPointsize"; $ref; Annotate Image::FontSize) ]
                        • Set Variable [ $r; Value:MBS("GMImage.SetFont"; $ref; Annotate Image::FontPath) ]
                        • Set Variable [ $r; Value:MBS("GMImage.SetFillColor"; $ref; "RGB 0 0 0") ]
                        • #Write the text to the picture
                        • Set Variable [ $r; Value:MBS("GMImage.Annotate"; $ref; Annotate Image::Text; "100x200+10+40"; 1) ]
                        • Set Field [ Annotate Image::OutputImage; MBS( "GMImage.WriteToPNGContainer"; $ref ) ]
                        • #Free image
                        • Set Variable [ $Error; Value:MBS("GMImage.Free";$ref) ]
                        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: [Run]Next Script: [Run Transparent with shadow]
                                Script NameRun Transparent
                                Run script with full access privilegesOff
                                Include In MenuYes
                                Layouts that use this script
                                  Scripts that use this script
                                    Script Definition
                                    Script Steps
                                    • #This script loade the original picture to an image environment set the settings for the font and write a text on a picture. Add transparency to make the text more transperant. Then we save the image in a container.
                                    • Set Variable [ $ref; Value:MBS("GMImage.NewFromContainer"; Annotate Image::InputImage) ]
                                    • #Create a temporary image
                                    • Set Variable [ $temp; Value:MBS("GMImage.New"; MBS("GMImage.Columns"; $ref) & "x" & MBS("GMImage.Rows"; $ref); "transparent") ]
                                    • #Settings for the font
                                    • Set Variable [ $r; Value:MBS("GMImage.SetFontPointsize"; $temp; 72) ]
                                    • Set Variable [ $r; Value:MBS("GMImage.SetFont"; $temp; "Arial Black") ]
                                    • Set Variable [ $r; Value:MBS("GMImage.SetFillColor"; $temp; "RGB 0 0 0") ]
                                    • #Write the text to the picture
                                    • Set Variable [ $r; Value:MBS("GMImage.Annotate"; $temp; "Hello World"; "100x200+10+80"; 1) ]
                                    • #add extra transparency to make text 50% transparent
                                    • Set Variable [ $r; Value:MBS( "GMImage.MultiplyChannel"; $temp; "opacity"; ,5; 0; 127 ) ]
                                    • Set Variable [ $r; Value:MBS( "GMImage.Composite"; $ref; $temp; "CenterGravity"; 1 ) ]
                                    • Set Variable [ $Error; Value:MBS("GMImage.Free";$temp) ]
                                    • Set Field [ Annotate Image::OutputImage; MBS( "GMImage.WriteToPNGContainer"; $ref ) ]
                                    • #Free image
                                    • Set Variable [ $Error; Value:MBS("GMImage.Free";$ref) ]
                                    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: [Run Transparent]Next Script: [Clear]
                                            Script NameRun Transparent with shadow
                                            Run script with full access privilegesOff
                                            Include In MenuYes
                                            Layouts that use this script
                                              Scripts that use this script
                                                Script Definition
                                                Script Steps
                                                • #This script loade the original picture to an image environment write a Shadowtext that we blur with the blur effect and make it 50% transparent. Then set the settings for the font of the normal text and write it on a transparent Backgound. Add transparency to make the text more transperant. Composit the layers. Then write the image in a container.
                                                • #Starts logging all plugin calls to a text file
                                                • Set Variable [ $r; Value:MBS("Trace") ]
                                                • Set Variable [ $ref; Value:MBS("GMImage.NewFromContainer"; Annotate Image::InputImage) ]
                                                • #1. shadow
                                                • #Create image with the size of the original
                                                • Set Variable [ $temp; Value:MBS("GMImage.New"; MBS("GMImage.Columns"; $ref) & "x" & MBS("GMImage.Rows"; $ref); "transparent") ]
                                                • #Settings for the font of the shadow
                                                • Set Variable [ $r; Value:MBS("GMImage.SetFontPointsize"; $temp; 72) ]
                                                • Set Variable [ $r; Value:MBS("GMImage.SetFont"; $temp; "Arial Black") ]
                                                • Set Variable [ $r; Value:MBS("GMImage.SetFillColor"; $temp; "RGB 0 0 0") ]
                                                • #Write the shadow text to a transparent image.
                                                • Set Variable [ $r; Value:MBS("GMImage.Annotate"; $temp; "Hello World"; "100x200+15+85"; 1) ]
                                                • #blur the shadow text
                                                • Set Variable [ $r; Value:MBS("GMImage.Blur"; $temp; 10; 5) ]
                                                • #add extra transparency to make text 50% transparent
                                                • Set Variable [ $r; Value:MBS( "GMImage.MultiplyChannel"; $temp; "opacity"; ,5; 0; 127 ) ]
                                                • #composit the original image and the shadow picture
                                                • Set Variable [ $r; Value:MBS( "GMImage.Composite"; $ref; $temp; "CenterGravity"; 1 ) ]
                                                • Set Variable [ $Error; Value:MBS("GMImage.Free";$temp) ]
                                                • #2. normal text
                                                • Set Variable [ $temp; Value:MBS("GMImage.New"; MBS("GMImage.Columns"; $ref) & "x" & MBS("GMImage.Rows"; $ref); "transparent") ]
                                                • #Settings for the font
                                                • Set Variable [ $r; Value:MBS("GMImage.SetFontPointsize"; $temp; 72) ]
                                                • Set Variable [ $r; Value:MBS("GMImage.SetFont"; $temp; "Arial Black") ]
                                                • Set Variable [ $r; Value:MBS("GMImage.SetFillColor"; $temp; "RGB 0 0 0") ]
                                                • Set Variable [ $r; Value:MBS("GMImage.Annotate"; $temp; "Hello World"; "100x200+10+80"; 1) ]
                                                • #add extra transparency to make text 50% transparent
                                                • Set Variable [ $r; Value:MBS( "GMImage.MultiplyChannel"; $temp; "opacity"; ,5; 0; 127 ) ]
                                                • #composit the original with the shadow image and the text picture
                                                • Set Variable [ $r; Value:MBS( "GMImage.Composite"; $ref; $temp; "CenterGravity"; 1 ) ]
                                                • Set Variable [ $Error; Value:MBS("GMImage.Free";$temp) ]
                                                • #write the final image to a container
                                                • Set Field [ Annotate Image::OutputImage; MBS( "GMImage.WriteToPNGContainer"; $ref ) ]
                                                • Set Variable [ $Error; Value:MBS("GMImage.Free";$ref) ]
                                                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: [Run Transparent with shadow]
                                                        Script NameClear
                                                        Run script with full access privilegesOff
                                                        Include In MenuYes
                                                        Layouts that use this script
                                                          Scripts that use this script
                                                            Script Definition
                                                            Script Steps
                                                            • #Clear the Output
                                                            • Set Field [ Annotate Image::OutputImage; "" ]
                                                            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: Annotate Image

                                                                    Used functions:




                                                                    Links
                                                                    MBS Xojo Plugins